[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Fri Jun 20 20:41:44 CEST 2003


CVS commit by staikos: 

wipe out another copy of addPlot()


  M +5 -42     kstcurvedialog_i.cpp   1.16
  M +0 -1      kstcurvedialog_i.h   1.7


--- kdeextragear-2/kst/kst/kstcurvedialog_i.cpp  #1.15:1.16
@@ -218,16 +218,16 @@ void KstCurveDialogI::new_I() {
   curve->Point.setType(_curveAppearance->pointType());
 
-  if (_curvePlacement->existingPlot()) {
+  if (_curvePlacement->newPlot()) {
     /* assign curve to plot */
-    plot = KST::plotList.FindKstPlot(_curvePlacement->plotName());
+    plot = KST::plotList.addPlot(QString::null, _curvePlacement->columns());
+    _curvePlacement->appendPlot(plot->tagName(), true);
     plot->addCurve(curve);
+    plot->GenerateDefaultLabels();
   }
 
-  if (_curvePlacement->newPlot()) {
-    addPlot();
+  if (_curvePlacement->existingPlot()) {
     /* assign curve to plot */
     plot = KST::plotList.FindKstPlot(_curvePlacement->plotName());
     plot->addCurve(curve);
-    plot->GenerateDefaultLabels();
   }
 
@@ -308,41 +308,4 @@ void KstCurveDialogI::delete_I() {
   doc->removeDataObject(tag);
   _curves.removeTag(tag);
-}
-
-
-void KstCurveDialogI::addPlot() {
-  KstPlot *newplot;
-  int i;
-  QString plot_name;
-  int cols, rows, n_plots;
-  int i_plot;
-  float width, height, ltx, lty;
-
-  i = KST::plotList.count();
-
-  do {
-    plot_name = "P"+QString::number(i);
-    i++;
-  } while (KST::plotList.FindKstPlot(plot_name));
-
-  newplot = new KstPlot(plot_name);
-  KST::plotList.append(newplot);
-
-  cols = _curvePlacement->columns();
-  // FIXME: refactor this (arrangePlots()?)
-  n_plots = KST::plotList.count();
-  rows = (n_plots-1)/cols + 1;
-  width = 1.0/float(cols);
-  height = 1.0/float(rows);
-
-  for (i_plot = 0; i_plot < n_plots; i_plot++) {
-    ltx = width * float(i_plot%cols);
-    lty = height * float(i_plot/cols);
-    KST::plotList.at(i_plot)->setDims(width, height, ltx, lty);
-  }
-
-  _curvePlacement->appendPlot(plot_name, true);
-
-  KST::plotList.setPlotCols(cols);
 }
 

--- kdeextragear-2/kst/kst/kstcurvedialog_i.h  #1.6:1.7
@@ -27,5 +27,4 @@ public slots:
   void delete_I();
 
-  void addPlot();
 private:
   KstDoc *doc;




More information about the Kst mailing list