[Kst] [Bug 143803] Kst crashes when using invalid vector

Adam Treat treat at kde.org
Wed Apr 4 22:03:02 CEST 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=143803         
treat kde org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From treat kde org  2007-04-04 22:03 -------
SVN commit 650551 by treat:

* Don't allow non-existent values

BUG:143803


 M  +5 -4      matrixselector.ui.h  
 M  +5 -1      scalarselector.ui.h  
 M  +5 -1      stringselector.ui.h  
 M  +5 -4      vectorselector.ui.h  


--- trunk/extragear/graphics/kst/src/widgets/matrixselector.ui.h #650550:650551
 @ -15,10 +15,11  @
 
 QString MatrixSelector::selectedMatrix()
 {
-    if (_provideNoneMatrix && _matrix->currentItem() == 0) {
-	return QString::null;
-    }
-    return _matrix->currentText();
+    KstMatrixPtr ptr = *KST::matrixList.findTag(_matrix->currentText());
+    if (!ptr || (_provideNoneMatrix && _matrix->currentItem() == 0))
+        return QString::null;
+    else
+        return _matrix->currentText();
 }
 
 
--- trunk/extragear/graphics/kst/src/widgets/scalarselector.ui.h #650550:650551
 @ -192,7 +192,11  @
 
 QString ScalarSelector::selectedScalar()
 {
-    return _scalar->currentText();
+    KstScalarPtr ptr = *KST::scalarList.findTag(_scalar->currentText());
+    if (ptr)
+        return _scalar->currentText();
+    else
+        return QString::null;
 }
 
 void ScalarSelector::allowDirectEntry( bool allowed )
--- trunk/extragear/graphics/kst/src/widgets/stringselector.ui.h #650550:650551
 @ -172,7 +172,11  @
 
 QString StringSelector::selectedString()
 {
-    return _string->currentText();
+    KstStringPtr ptr = *KST::stringList.findTag(_string->currentText());
+    if (ptr)
+        return _string->currentText();
+    else
+        return QString::null;
 }
 
 void StringSelector::allowDirectEntry( bool allowed )
--- trunk/extragear/graphics/kst/src/widgets/vectorselector.ui.h #650550:650551
 @ -26,10 +26,11  @
 
 QString VectorSelector::selectedVector()
 {
-    if (_provideNoneVector && _vector->currentItem() == 0) {
-	return QString::null;
-    }
-    return _vector->currentText();
+    KstVectorPtr ptr = *KST::vectorList.findTag(_vector->currentText());
+    if (!ptr || (_provideNoneVector && _vector->currentItem() == 0))
+        return QString::null;
+    else
+        return _vector->currentText();
 }


More information about the Kst mailing list