[Kst] extragear/graphics/kst/kst

George Staikos staikos at kde.org
Fri Oct 7 23:49:10 CEST 2005


SVN commit 468378 by staikos:

add assignment operator for plot labels and implement copy to keep that working
for now.


 M  +6 -4      kst2dplot.cpp  
 M  +14 -0     kstplotlabel.cpp  
 M  +2 -0      kstplotlabel.h  


--- trunk/extragear/graphics/kst/kst/kst2dplot.cpp #468377:468378
@@ -431,10 +431,6 @@
     plotName = name;
   }
 
-  // FIXME: copy x, y, top labels
-  _labelFontSize = plot._labelFontSize;
-  _labelFontName = plot._labelFontName;
-
   commonConstructor(plotName,
                     plot._xScaleMode,
                     plot._yScaleMode,
@@ -445,6 +441,12 @@
                     plot._xLog,
                     plot._yLog);
 
+  _labelFontSize = plot._labelFontSize;
+  _labelFontName = plot._labelFontName;
+  *_xLabel = *(plot._xLabel);
+  *_yLabel = *(plot._yLabel);
+  *_topLabel = *(plot._topLabel);
+
   _xOffsetMode = plot._xOffsetMode;
   _yOffsetMode = plot._yOffsetMode;
   _xMajorGrid = plot._xMajorGrid;
--- trunk/extragear/graphics/kst/kst/kstplotlabel.cpp #468377:468378
@@ -249,4 +249,18 @@
   ts << indent << "<size>" << _fontSize << "</size>" << endl;
 }
 
+
+KstPlotLabel& KstPlotLabel::operator=(const KstPlotLabel& l) {
+  _fontName = l._fontName;
+  _symbolFontName = l._symbolFontName;
+  _fontSize = l._fontSize;
+  _rotation = l._rotation;
+  _interpret = l._interpret;
+  _replace = l._replace;
+  updateLineSpacing();
+  setText(l._txt);
+  return *this;
+}
+
+
 // vim: ts=2 sw=2 et
--- trunk/extragear/graphics/kst/kst/kstplotlabel.h #468377:468378
@@ -58,6 +58,8 @@
     void load(const QDomElement& e);
     void save(QTextStream& ts, const QString& indent = QString::null, bool save_pos = false) const;
 
+    KstPlotLabel& operator=(const KstPlotLabel&);
+
   private:
     void commonConstructor(const QString& txt, const QString& font, int fontSize, KstLJustifyType justify, float rotation);
     void drawToPainter(Label::Parsed *lp, QPainter& p);


More information about the Kst mailing list