[Kst] extragear/graphics/kst/kst

George Staikos staikos at kde.org
Wed Dec 21 00:37:38 CET 2005


SVN commit 490163 by staikos:

allow borders on transparent objects again
- also avoid QRegExp when we don't need it, for speed
BUG: 118753


 M  +6 -9      kstviewlabel.cpp  
 M  +1 -1      kstviewlegend.cpp  


--- trunk/extragear/graphics/kst/kst/kstviewlabel.cpp #490162:490163
@@ -567,10 +567,8 @@
   } else { 
     // replace \n & \t with tabs and newlines for the text edit box
     QString tmpstr = text();
-    QRegExp cr("\\\\n");
-    QRegExp tab("\\\\t");
-    tmpstr.replace(cr,"\n");
-    tmpstr.replace(tab,"\t");
+    tmpstr.replace(QString("\\n"), "\n");
+    tmpstr.replace(QString("\\t"), "\t");
     widget->_text->setText(tmpstr);
 
     widget->_precision->setValue(int(dataPrecision()));
@@ -592,6 +590,7 @@
   return true;
 }
 
+
 bool KstViewLabel::readConfigWidget(QWidget *w) {
   ViewLabelWidget *widget = dynamic_cast<ViewLabelWidget*>(w);
   if (!widget) {
@@ -599,11 +598,9 @@
   }
 
   // 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");
+  _txt.replace(QString("\n"), "\\n");
+  _txt.replace(QString("\t"), "\\t");
 
   setDataPrecision(widget->_precision->value());
   setRotation(widget->_rotation->value());
@@ -615,7 +612,7 @@
 
   setTransparent(widget->_transparent->isChecked());
   setAutoResize(widget->_autoResize->isChecked());
-  setBorderWidth(transparent() ? 0 : widget->_border->value());
+  setBorderWidth(widget->_border->value());
   setBorderColor(widget->_boxColors->foreground());
   setBackgroundColor(widget->_boxColors->background());
   setPadding(widget->_margin->value());
--- trunk/extragear/graphics/kst/kst/kstviewlegend.cpp #490162:490163
@@ -487,7 +487,7 @@
   setFontName(widget->_font->currentFont());
 
   setTransparent(widget->_transparent->isChecked());
-  setBorderWidth(transparent() ? 0 : widget->_border->value());
+  setBorderWidth(widget->_border->value());
   setBorderColor(widget->_boxColors->foreground());
   setBackgroundColor(widget->_boxColors->background());
   setPadding(widget->_margin->value());


More information about the Kst mailing list