[Kst] extragear/graphics/kst/kst

George Staikos staikos at kde.org
Fri Oct 7 23:33:56 CEST 2005


SVN commit 468377 by staikos:

save X, Y, top labels in plots


 M  +3 -10     kst2dplot.cpp  
 M  +18 -0     kstplotlabel.cpp  
 M  +1 -0      kstplotlabel.h  


--- trunk/extragear/graphics/kst/kst/kst2dplot.cpp #468376:468377
@@ -131,10 +131,6 @@
   _suppressRight = false;
   _xScaleModeDefault = AUTO;
   _yScaleModeDefault = AUTOBORDER;
-  _xTicksInPlot = true;
-  _xTicksOutPlot = false;
-  _yTicksInPlot = true;
-  _yTicksOutPlot = false;
   _xTransformed = false;
   _yTransformed = false;
   _xReversed = false;
@@ -2637,18 +2633,15 @@
   }
 
   ts << indent << "<toplabel>" << endl;
-  // FIXME
-  //TopLabel->save(ts, l2);
+  _topLabel->save(ts, l2);
   ts << indent << "</toplabel>" << endl;
 
   ts << indent << "<xlabel>" << endl;
-  // FIXME
-  //XLabel->save(ts, l2, false);
+  _xLabel->save(ts, l2, false);
   ts << indent << "</xlabel>" << endl;
 
   ts << indent << "<ylabel>" << endl;
-  // FIXME
-  //YLabel->save(ts, l2, false);
+  _yLabel->save(ts, l2, false);
   ts << indent << "</ylabel>" << endl;
 
   ts << indent << "<xfullticklabel>" << endl;
--- trunk/extragear/graphics/kst/kst/kstplotlabel.cpp #468376:468377
@@ -24,6 +24,8 @@
 #include "labelrenderer.h"
 
 #include <qdom.h>
+#include <qstylesheet.h>
+#include <qtextstream.h>
 
 #include <kdebug.h>
 #include <kglobal.h>
@@ -231,4 +233,20 @@
 }
 
 
+void KstPlotLabel::save(QTextStream &ts, const QString& indent, bool save_pos) const {
+  QString l2 = indent + "  ";
+  ts << indent << "<text>" << QStyleSheet::escape(_txt) << "</text>" << endl;
+  if (_interpret) {
+    ts << indent << "<interpret/>" << endl;
+  }
+  ts << indent << "<rotation>" << _rotation << "</rotation>" << endl;
+  if (save_pos) {
+    // FIXME
+    // ts << indent << "<justify>" << _justify << "</justify>" << endl;
+  }
+  ts << indent << "<fontfamily>" << QStyleSheet::escape(_fontName) << "</fontfamily>" << endl;
+  ts << indent << "<symbolfontfamily>" << QStyleSheet::escape(_symbolFontName) << "</symbolfontfamily>" << endl;
+  ts << indent << "<size>" << _fontSize << "</size>" << endl;
+}
+
 // vim: ts=2 sw=2 et
--- trunk/extragear/graphics/kst/kst/kstplotlabel.h #468376:468377
@@ -56,6 +56,7 @@
     QSize size() const;
 
     void load(const QDomElement& e);
+    void save(QTextStream& ts, const QString& indent = QString::null, bool save_pos = false) const;
 
   private:
     void commonConstructor(const QString& txt, const QString& font, int fontSize, KstLJustifyType justify, float rotation);


More information about the Kst mailing list