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

List:       kde-commits
Subject:    KOFFICE_1_3_BRANCH: koffice/lib/kotext
From:       David Faure <faure () kde ! org>
Date:       2004-02-11 11:38:42
Message-ID: 20040211113842.875B69914 () office ! kde ! org
[Download RAW message or body]

CVS commit by faure: 

Fix uninit read and wrong painting when a paragraph starts with a tab.


  M +3 -4      kotextformatter.cc   1.81.2.1


--- koffice/lib/kotext/kotextformatter.cc  #1.81:1.81.2.1
@@ -159,5 +159,7 @@ bool KoTextFormatterCore::format()
         currentRightMargin += parag->firstLineMargin();
     int initialRMargin = currentRightMargin;
-
+    // Those two things must be done before calling determineCharWidth
+    i = start;
+    parag->tabCache().clear();
 
     // We need the width of the first char for adjustMargins
@@ -205,5 +207,4 @@ bool KoTextFormatterCore::format()
     QValueList<TemporaryWordData> tempWordData;
 
-    i = start;
 #ifdef DEBUG_FORMATTER
     kdDebug(32500) << "Initial KoTextParagLineStart at y=" << y << endl;
@@ -232,6 +233,4 @@ bool KoTextFormatterCore::format()
     int lastPixelx = 0;
 
-    parag->tabCache().clear();
-
     KoTextStringChar* lastChr = 0;
     for ( ; i < len; ++i, ++col ) {


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

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