[Kst] branches/work/kst/1.6/kst/src/libkstapp

Andrew Walker arwalker at sumusltd.com
Wed Jan 9 01:21:02 CET 2008


SVN commit 758753 by arwalker:

cleanup of code

 M  +3 -17     kst2dplot.cpp  
 M  +0 -1      kst2dplot.h  


--- branches/work/kst/1.6/kst/src/libkstapp/kst2dplot.cpp #758752:758753
@@ -1881,7 +1881,7 @@
 
 void Kst2DPlot::genAxisTickLabel(QString& label, double z, bool isLog, double logBase, bool minorTick) {
   if (isLog) {
-    if (z > -4 && z < 4 || minorTick) {
+    if (z > -4.0 && z < 4.0 || minorTick) {
       label = QString::number(pow(logBase, z), 'g', LABEL_PRECISION);
     } else {
       label = i18n("%2 to the power of %1", "%2^{%1}").arg(z, 0, 'f', 0).arg(logBase, 0, 'f', 0);
@@ -2527,26 +2527,12 @@
 }
 
 
-void Kst2DPlot::updateDirtyFromLabels() {
-#if 0
-  bool dirty = this->dirty();
-  // FIXME: dirty for xlabel, ylabel, toplabel
-  // don't know what there is to fix... plotlabels no longer cache (and don't need to).
-  //dirty = dirty || XLabel->dirty() || YLabel->dirty() || TopLabel->dirty();
-  XLabel->setDirty(false);
-  YLabel->setDirty(false);
-  TopLabel->setDirty(false);
-  setDirty(dirty);
-#endif
-}
-
-
 void Kst2DPlot::updateSelf() {
   bool wasDirty(dirty());
   KstPlotBase::updateSelf();
   const QSize sizeNew(size());
   const QRect alignment(KST::alignment.limits(geometry()));
-  updateDirtyFromLabels();
+
   if (wasDirty || sizeNew != _oldSize || alignment != _oldAlignment) {
     forEachChild(&KstViewObject::setDirty, true); // FIXME: hack,remove
     draw();
@@ -5068,7 +5054,7 @@
   }
   if (prevMarker(currCenter, newCenter)) {
     if (_xLog) {
-      if (newCenter > 0) {
+      if (newCenter > 0.0) {
         newCenter = logXLo(newCenter);
       } else {
         return; //don't scroll left past 0 in log mode
--- branches/work/kst/1.6/kst/src/libkstapp/kst2dplot.h #758752:758753
@@ -467,7 +467,6 @@
   // for backwards compatibility with old labels - convert an old saved label to a KstViewLabel
   KstViewLabelPtr convertLabelToViewLabel(const QDomElement &e);
 
-  void updateDirtyFromLabels();
   void setCursorPos(QWidget *view);
   void unsetCursorPos(QWidget *view);
   void drawCursorPos(QWidget *view);


More information about the Kst mailing list