[Kst] branches/work/kst/portto4/kst/src

Barth Netterfield netterfield at astro.utoronto.ca
Tue May 15 17:32:50 UTC 2012


SVN commit 1294981 by netterfield:

BUG: 299615

-Don't crash when including a shared axis box in a shared axis box.
-Abort the command when including a sharedd axis box in a shared axis box.



 M  +1 -1      datasources/ascii/asciisource.cpp  
 M  +5 -4      libkstapp/sharedaxisboxitem.cpp  


--- branches/work/kst/portto4/kst/src/datasources/ascii/asciisource.cpp #1294980:1294981
@@ -328,7 +328,7 @@
 #define MAXBUFREADLEN KST_PREALLOC
 Kst::Object::UpdateType AsciiSource::internalDataSourceUpdate(bool read_completely)
 {
-  MeasureTime t("AsciiSource::internalDataSourceUpdate");
+  MeasureTime t("AsciiSource::internalDataSourceUpdate: " + _filename);
 
   if (!_haveHeader) {
     _haveHeader = initRowIndex();
--- branches/work/kst/portto4/kst/src/libkstapp/sharedaxisboxitem.cpp #1294980:1294981
@@ -35,6 +35,7 @@
 SharedAxisBoxItem::SharedAxisBoxItem(View *parent)
     : ViewItem(parent),
       _layout(0),
+      _keyPlot(0),
       _loaded(false),
       _firstPaint(true),
       _dirty(false),
@@ -140,7 +141,6 @@
 
 bool SharedAxisBoxItem::acceptItems() {
   bool bReturn = false;
-
   if (_loaded) {
     return true;
   } else {
@@ -164,7 +164,8 @@
           ViewItem *parent = static_cast<ViewItem*>(plotItem->parentItem());
           SharedAxisBoxItem *shareBox = qobject_cast<SharedAxisBoxItem*>(parent);
           if (shareBox) {
-            shareBox->breakShare();
+            // share boxes can't contain share boxes.  Bail out now!
+            return false;
           } else if (parent != parentItem()) {
             continue;
           }
@@ -1172,9 +1173,9 @@
     if (shareBox->acceptItems()) {
       CreateCommand::creationComplete();
     } else {
-      delete _item;
+      kstApp->mainWindow()->clearDrawingMarker();
       deleteLater();
-      kstApp->mainWindow()->clearDrawingMarker();
+      _item->deleteLater();
     }
   }
 }


More information about the Kst mailing list