[Kst] extragear/graphics/kst/kst

Rick Chern rchern at interchange.ubc.ca
Wed Jul 13 21:27:52 CEST 2005


SVN commit 434345 by rchern:

Save datasources used by matrices as well

 M  +12 -2     kstdoc.cpp  


--- trunk/extragear/graphics/kst/kst/kstdoc.cpp #434344:434345
@@ -534,17 +534,27 @@
   ts << "\" />" << endl;
 
   KstRVectorList rvl = kstObjectSubList<KstVector,KstRVector>(KST::vectorList);
+  KstRMatrixList rml = kstObjectSubList<KstMatrix,KstRMatrix>(KST::matrixList);
 
   // save files
   KST::dataSourceList.lock().readLock();
   for (uint i = 0; i < KST::dataSourceList.count(); i++) {
     KstDataSourcePtr dsp = KST::dataSourceList[i];
-    for (KstRVectorList::Iterator it = rvl.begin(); it != rvl.end(); ++it) {
+    bool saved = false;
+    for (KstRVectorList::Iterator it = rvl.begin(); it != rvl.end() && !saved; ++it) {
       if ((*it)->dataSource() == dsp) {
         ts << "  <kstfile>" << endl;
         dsp->save(ts, "    ");
         ts << "  </kstfile>" << endl;
-        break;
+        saved = true;
+      } 
+    }
+    for (KstRMatrixList::Iterator it = rml.begin(); it != rml.end() && !saved; ++it) {
+      if ((*it)->dataSource() == dsp) {
+        ts << "  <kstfile>" << endl;
+        dsp->save(ts, "    ");
+        ts << "  </kstfile>" << endl;
+        saved = true;
       }
     }
   }


More information about the Kst mailing list