ports/70688: tab stops corruption in QTextParagraph (Qt 3.3.3)

Andriy I Pylypenko bamby at oranta.ua
Fri Aug 20 06:30:34 UTC 2004


>Number:         70688
>Category:       ports
>Synopsis:       tab stops corruption in QTextParagraph (Qt 3.3.3)
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 20 06:30:31 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Andriy I Pylypenko
>Release:        4.10-BETA
>Organization:
NSIC Oranta
>Environment:
FreeBSD 310-1117.ho.ornt 4.10-BETA FreeBSD 4.10-BETA #4: Thu May  6 12:18:58 EEST 2004     root at it-pilai.kv.ornt:/usr/src/sys/compile/BAMBY  i386
>Description:
At least the QTextEdit widget changes tab stops in the associated 
text with one whitespace each.
This is the old bug triggered by recent changes in the Qt 3.3.3.
Side effect of this bug is for example the corruption of the source
C++ files edited by Qt Designer.
The problem is in the QTextParagraph::paint() method that does this
tab stop (and newline) conversion for painting but occasionaly
modifies the original text rather than copy of it.
>How-To-Repeat:
Create widget with QTextEdit instance (non-readonly, non-hidden)
put in it string containing '\t' and retreive the string back using
QTextEdit::text() method. You'll receive the string with tab stops 
replaced by whitespaces.
>Fix:
--- src/kernel/qrichtext.cpp.orig	Thu Aug 19 20:27:12 2004
+++ src/kernel/qrichtext.cpp	Thu Aug 19 20:28:05 2004
@@ -61,6 +61,7 @@
 #include "qcleanuphandler.h"
 #include "qtextengine_p.h"
 #include <private/qunicodetables_p.h>
+#include <qdeepcopy.h>
 
 #include <stdlib.h>
 
@@ -4509,7 +4510,7 @@ void QTextParagraph::paint( QPainter &pa
     if ( drawSelections && fullWidthStyle )
 	fullSelectionWidth = (hasdoc ? document()->width() : r.width());
 
-    QString qstr = str->toString();
+    QString qstr = QDeepCopy<QString>(str->toString());
     // ### workaround so that \n are not drawn, actually this should
     // be fixed in QFont somewhere (under Windows you get ugly boxes
     // otherwise)

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list