[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    Bug#2058: Selection does funny things
From:       Michael Haeckel <Michael.Haeckel () stud ! uni-bayreuth ! de>
Date:       1999-09-28 13:19:24
[Download RAW message or body]

Package: khexdit
Version: 0.6

When I select something and move with pressed left mouse button over the
right side with the clear text khexdit doesn't realize that I am no
longer on the left side and paints the cursor at completetely wrong
places and doesn't remove it later.

When I paste the things khexdit puts in the clipboard in an editor then
the new line starts at a wrong position. When the selection starts at an
odd byte then there arn't line breaks at all.

Fix:
------------------------------------------------------------------------
diff -u khexdit/hexfile.cpp khexdit.new/hexfile.cpp
--- khexdit/hexfile.cpp Thu Nov 12 14:33:51 1998
+++ khexdit.new/hexfile.cpp     Tue Sep 28 15:16:29 1999
@@ -426,6 +426,8 @@
 void HexFile::mousePressEvent (QMouseEvent *e) {

     startDrag = translate(e->pos());
+    if (startDrag.x() > 15)
+        startDrag.setX(15);
     if (indexOf(startDrag) > data->size())
        startDrag = nullPoint;

@@ -447,6 +449,8 @@

 void HexFile::mouseMoveEvent ( QMouseEvent *e ) {
     QPoint tmp = translate(e->pos());
+    if (tmp.x() > 15)
+        tmp.setX(15);

     if (indexOf(tmp) > data->size())
        return;
@@ -689,7 +693,7 @@
        char buffer[6];
        sprintf(buffer, "%02x%02x ",data->byteAt(i), data->byteAt(i+1));
        tmp << buffer;
-       if (i % 16 == 0)
+       if ((i-start) % 16 == 14)
            tmp << "\n";
     }
     clp->setText(tmp);
------------------------------------------------------------------------

Greetings,
Michael Häckel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic