Date: Fri, 20 Aug 2004 06:24:04 GMT From: Andriy I Pylypenko <bamby@oranta.ua> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/70688: tab stops corruption in QTextParagraph (Qt 3.3.3) Message-ID: <200408200624.i7K6O4dY019527@www.freebsd.org> Resent-Message-ID: <200408200630.i7K6UYNc082397@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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@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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200408200624.i7K6O4dY019527>