[Kst] extragear/graphics/kst/kst
George Staikos
staikos at kde.org
Fri Jul 8 02:34:04 CEST 2005
SVN commit 432623 by staikos:
separate linebreaks in the parser to make rendering easier
M +6 -3 labelparser.cpp
M +1 -0 labelparser.h
--- trunk/extragear/graphics/kst/kst/labelparser.cpp #432622:432623
@@ -25,7 +25,7 @@
using namespace Label;
Chunk::Chunk(Chunk *parent, VOffset dir, bool group)
-: next(0L), prev(0L), up(0L), down(0L), symbol(false), scalar(false), group(group), vOffset(dir) {
+: next(0L), prev(0L), up(0L), down(0L), symbol(false), scalar(false), group(group), linebreak(false), vOffset(dir) {
assert(parent || vOffset == None);
if (parent) { // attach and inherit
switch (vOffset) {
@@ -70,7 +70,7 @@
bool Chunk::locked() const {
- return scalar || group;
+ return scalar || group || linebreak;
}
@@ -163,7 +163,10 @@
return true;
} else {
*skip = 1;
- setNormalChar('\n', tail);
+ if (!*tail || !(*tail)->text.isEmpty() || (*tail)->locked() || (*tail)->symbol) {
+ *tail = new Chunk(*tail);
+ }
+ (*tail)->linebreak = true;
return true;
}
break;
--- trunk/extragear/graphics/kst/kst/labelparser.h #432622:432623
@@ -50,6 +50,7 @@
bool symbol : 1;
bool scalar : 1;
bool group : 1;
+ bool linebreak : 1;
VOffset vOffset : 2;
QString text;
};
More information about the Kst
mailing list