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

List:       koffice-devel
Subject:    Re: Bug in qrichtext.cpp KoTextParag::paintDefault.
From:       David Faure <david () mandrakesoft ! com>
Date:       2002-05-16 10:54:10
[Download RAW message or body]

On Monday 13 May 2002 11:42, qt-bugs@trolltech.com wrote:
> > Hi,
> > If you have 2 (or more) custom chars with word delimitter(s) in 
> > between, selecting the left one also paints the next one as selected.
> > 
> > Patch attached.
> > Mvh, Dag
> 
> Hi Dag
> 
> This patch is not for qt's qrichtext.cpp but for KDE's own version. This report \
> should go to them and not to us. It looked good to me though :-)

Well the initial source code is the same. Apart from the search-n-replace I
did to avoid symbol conflicts, it's basically the same code. The patch applies
to both. Since you seem to really require a patch that applies directly,
please find it attached.

The patch also includes another fix. The paragraph width was wrong when
the "formatAgain" goto was used, because the value from the first try was
used in the QMIN( usedw, r.width() ). I don't know how to give a testcase
where QRT hits formatAgain - this needs formatVertically to give a y offset,
and then to see the bug, adjustLMargin has to return a different value the
second time (e.g. because something's on the topleft corner of the 2nd page).
Ah well, Reggie know what it's about ;)

-- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://people.mandrakesoft.com/~david/
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
KDE, Making The Future of Computing Available Today


["qrichtext.cpp.diff" (text/x-diff)]

Index: qrichtext.cpp
===================================================================
RCS file: /home/kde/qt-copy/src/kernel/qrichtext.cpp,v
retrieving revision 1.48
diff -u -p -r1.48 qrichtext.cpp
--- qrichtext.cpp	2002/04/26 20:55:37	1.48
+++ qrichtext.cpp	2002/05/16 10:50:54
@@ -3972,7 +3972,6 @@ void QTextParag::format( int start, bool
 	return;
 
     r.moveTopLeft( QPoint( documentX(), p ? p->r.y() + p->r.height() : documentY() ) );
-    r.setWidth( documentWidth() );
     if ( p )
 	p->lastInFrame = FALSE;
 
@@ -3981,6 +3980,7 @@ void QTextParag::format( int start, bool
 
  formatAgain:
 
+    r.setWidth( documentWidth() );
     if ( hasdoc && mFloatingItems ) {
 	for ( QTextCustomItem *i = mFloatingItems->first(); i; i = mFloatingItems->next() ) {
 	    i->ypos = r.y();
@@ -4427,7 +4427,7 @@ void QTextParag::paint( QPainter &painte
 	    } else {
 		if ( chr->customItem()->placement() == QTextCustomItem::PlaceInline ) {
 		    chr->customItem()->draw( &painter, chr->x, cy, clipx - r.x(), clipy - r.y(), clipw, cliph, cg,
-					     nSels && selectionStarts[ 0 ] <= i && selectionEnds[ 0 ] >= i );
+					     nSels && selectionStarts[ 0 ] <= i && selectionEnds[ 0 ] > i );
 		    paintStart = i+1;
 		    paintEnd = -1;
 		    formatChar = chr;

_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel

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

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