[Kst] [Bug 127381] Label color does not revert to default

George Staikos staikos at kde.org
Mon May 15 21:40:43 CEST 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=127381         
staikos kde org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From staikos kde org  2006-05-15 21:40 -------
SVN commit 541239 by staikos:

Fix off-by-one in color parsing
BUG: 127381


 M  +1 -1      src/libkstmath/labelparser.cpp  
 M  +9 -1      tests/testlabelparser.cpp  


--- trunk/extragear/graphics/kst/src/libkstmath/labelparser.cpp #541238:541239
 @ -341,7 +341,7  @
         if (!working->attributes.color.isValid() || txt[parseStart + firstSkip + 1] != '{') {
           return false;
         }
-        parseStart += firstSkip + 1;
+        parseStart += firstSkip + 2;
         parseInternal(working, txt, parseStart, txt.length(), interpretNewLine);
         *skip = parseStart - from + 1;
         dumpattr(working, "end group for textcolor");
--- trunk/extragear/graphics/kst/tests/testlabelparser.cpp #541238:541239
 @ -15,7 +15,7  @
 
 
 static void dumpAttributes(Label::Chunk *l, QString indent) {
-  printf("%sb:%d i:%d u:%d\n", indent.latin1(), l->attributes.bold, l->attributes.italic, l->attributes.underline);
+  printf("%sb:%d i:%d u:%d c:%s\n", indent.latin1(), l->attributes.bold, l->attributes.italic, l->attributes.underline, l->attributes.color.name().latin1());
 }
 
 
 @ -471,6 +471,14  @
   // FIXME
   delete parsed;
 
+  parsed = Label::parse("\\textcolor{red}{red}black");
+  // FIXME
+  delete parsed;
+
+  parsed = Label::parse("\\textbf{bold}unbold");
+  // FIXME
+  delete parsed;
+
   // more to test...
 }


More information about the Kst mailing list