[Kst] branches/kst/1.2/kst/kst
George Staikos
staikos at kde.org
Fri Feb 24 16:37:41 CET 2006
SVN commit 513205 by staikos:
backport fix for 122386
M +1 -8 kstviewlabel.cpp
M +12 -0 labelparser.cpp
--- branches/kst/1.2/kst/kst/kstviewlabel.cpp #513204:513205
@@ -584,11 +584,7 @@
}
} else {
- // replace \n & \t with tabs and newlines for the text edit box
- QString tmpstr = text();
- tmpstr.replace(QString("\\n"), "\n");
- tmpstr.replace(QString("\\t"), "\t");
- widget->_text->setText(tmpstr);
+ widget->_text->setText(text());
widget->_precision->setValue(int(dataPrecision()));
widget->_rotation->setValue(double(rotation()));
@@ -616,10 +612,7 @@
return false;
}
- // Replace tabs and newlines in text edit box with \n and \t
_txt = widget->_text->text();
- _txt.replace(QString("\n"), "\\n");
- _txt.replace(QString("\t"), "\\t");
setDataPrecision(widget->_precision->value());
setRotation(widget->_rotation->value());
--- branches/kst/1.2/kst/kst/labelparser.cpp #513204:513205
@@ -345,6 +345,18 @@
QChar c = txt[i];
Chunk::VOffset dir = Chunk::Down;
switch (c.unicode()) {
+ case '\n':
+ if (!ctail || !ctail->text.isEmpty() || ctail->locked()) {
+ ctail = new Chunk(ctail);
+ }
+ ctail->linebreak = true;
+ break;
+ case '\t':
+ if (!ctail || !ctail->text.isEmpty() || ctail->locked()) {
+ ctail = new Chunk(ctail);
+ }
+ ctail->tab = true;
+ break;
case 0x5c: // \ /**/
if (ctail->vOffset != Chunk::None && !ctail->text.isEmpty()) {
ctail = new Chunk(ctail->prev);
More information about the Kst
mailing list