SVN commit 484478 by netterfield: Tabs and spaces come and go properly in text edit M +16 -1 kstviewlabel.cpp --- trunk/extragear/graphics/kst/kst/kstviewlabel.cpp #484477:484478 @@ -37,6 +37,7 @@ #include #include #include +#include #include @@ -576,7 +577,14 @@ if (!w) { return false; } - widget->_text->setText(_txt); + // replace \n & \t with tabs and newlines for the text edit box + QString tmpstr = _txt; + QRegExp cr("\\\\n"); + QRegExp tab("\\\\t"); + tmpstr.replace(cr,"\n"); + tmpstr.replace(tab,"\t"); + widget->_text->setText(tmpstr); + return true; } @@ -585,7 +593,14 @@ if (!w) { return false; } + + // Replace tabs and newlines in text edit box with \n and \t + QRegExp cr("\n"); + QRegExp tab("\t"); _txt = widget->_text->text(); + _txt.replace(cr, "\\n"); + _txt.replace(tab, "\\t"); + reparse(); // calls setDirty() return true; }