[Kst] extragear/graphics/kst/kst

George Staikos staikos at kde.org
Tue Oct 11 03:45:54 CEST 2005


SVN commit 469397 by staikos:

restore backward compatibility with older kst files


 M  +11 -6     kstequation.cpp  


--- trunk/extragear/graphics/kst/kst/kstequation.cpp #469396:469397
@@ -81,6 +81,7 @@
   int ns = -1;
   double x0 = 0.0, x1 = 1.0;
   QString xvtag;
+  bool haveVector = false;
 
   _doInterp = false;
 
@@ -103,6 +104,7 @@
         xvtag = e.text();
       } else if (e.tagName() == "xvector") {
         _inputVectorLoadQueue.append(qMakePair(XVECTOR, e.text()));
+        haveVector = true;
       } else if (e.tagName() == "interpolate") {
         _doInterp = true;
       }
@@ -110,7 +112,7 @@
     n = n.nextSibling();
   }
 
-  if (_inputVectorLoadQueue.isEmpty()) {
+  if (!haveVector) {
     if (ns < 0) {
       ns = 2;
     }
@@ -118,12 +120,15 @@
       x1 = x0 + 2;
     }
 
-    KstVectorPtr xvector;
-    QString vtag = KST::suggestVectorName(
-      QString( "(%1..%2)" ).arg( x0 ).arg( x1 ) );
+    QString vtag;
+    if (xvtag.isEmpty()) {
+      vtag = KST::suggestVectorName(QString("(%1..%2)").arg(x0).arg(x1));
+    } else {
+      vtag = xvtag;
+    }
 
-    xvector = new KstSVector(x0, x1, ns, vtag);
-    KST::addVectorToList( xvector );
+    KstVectorPtr xvector = new KstSVector(x0, x1, ns, vtag);
+    KST::addVectorToList(xvector);
 
     _doInterp = false;
     _xVector = _inputVectors.insert(XVECTOR, xvector);


More information about the Kst mailing list