Summary: | Label color does not revert to default | ||
---|---|---|---|
Product: | [Applications] kst | Reporter: | Andrew Walker <arwalker> |
Component: | general | Assignee: | kst |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 1.x | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Andrew Walker
2006-05-15 20:47:29 UTC
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... } |