[Kst] branches/work/kst/portto4/kst/src/libkstapp
Mike Fenton
mike at staikos.net
Mon Sep 8 21:43:37 CEST 2008
SVN commit 858825 by fenton:
Fix Segfaults when creating objects and not placing them in Plots.
M +6 -4 csddialog.cpp
M +6 -4 curvedialog.cpp
M +6 -4 equationdialog.cpp
M +6 -5 histogramdialog.cpp
M +6 -4 imagedialog.cpp
M +6 -4 powerspectrumdialog.cpp
--- branches/work/kst/portto4/kst/src/libkstapp/csddialog.cpp #858824:858825
@@ -250,11 +250,13 @@
break;
}
- PlotRenderItem *renderItem = plotItem->renderItem(PlotRenderItem::Cartesian);
- renderItem->addRelation(kst_cast<Relation>(image));
- plotItem->update();
+ if (_CSDTab->curvePlacement()->place() != CurvePlacement::NoPlot) {
+ PlotRenderItem *renderItem = plotItem->renderItem(PlotRenderItem::Cartesian);
+ renderItem->addRelation(kst_cast<Relation>(image));
+ plotItem->update();
- plotItem->parentView()->appendToLayout(_CSDTab->curvePlacement()->layout(), plotItem, _CSDTab->curvePlacement()->gridColumns());
+ plotItem->parentView()->appendToLayout(_CSDTab->curvePlacement()->layout(), plotItem, _CSDTab->curvePlacement()->gridColumns());
+ }
return ObjectPtr(image.data());
}
--- branches/work/kst/portto4/kst/src/libkstapp/curvedialog.cpp #858824:858825
@@ -402,11 +402,13 @@
break;
}
- PlotRenderItem *renderItem = plotItem->renderItem(PlotRenderItem::Cartesian);
- renderItem->addRelation(kst_cast<Relation>(curve));
- plotItem->update();
+ if (_curveTab->curvePlacement()->place() != CurvePlacement::NoPlot) {
+ PlotRenderItem *renderItem = plotItem->renderItem(PlotRenderItem::Cartesian);
+ renderItem->addRelation(kst_cast<Relation>(curve));
+ plotItem->update();
- plotItem->parentView()->appendToLayout(_curveTab->curvePlacement()->layout(), plotItem, _curveTab->curvePlacement()->gridColumns());
+ plotItem->parentView()->appendToLayout(_curveTab->curvePlacement()->layout(), plotItem, _curveTab->curvePlacement()->gridColumns());
+ }
return ObjectPtr(curve.data());
}
--- branches/work/kst/portto4/kst/src/libkstapp/equationdialog.cpp #858824:858825
@@ -328,11 +328,13 @@
break;
}
- PlotRenderItem *renderItem = plotItem->renderItem(PlotRenderItem::Cartesian);
- renderItem->addRelation(kst_cast<Relation>(curve));
- plotItem->update();
+ if (_equationTab->curvePlacement()->place() != CurvePlacement::NoPlot) {
+ PlotRenderItem *renderItem = plotItem->renderItem(PlotRenderItem::Cartesian);
+ renderItem->addRelation(kst_cast<Relation>(curve));
+ plotItem->update();
- plotItem->parentView()->appendToLayout(_equationTab->curvePlacement()->layout(), plotItem, _equationTab->curvePlacement()->gridColumns());
+ plotItem->parentView()->appendToLayout(_equationTab->curvePlacement()->layout(), plotItem, _equationTab->curvePlacement()->gridColumns());
+ }
return ObjectPtr(equation.data());
}
--- branches/work/kst/portto4/kst/src/libkstapp/histogramdialog.cpp #858824:858825
@@ -395,12 +395,13 @@
break;
}
- PlotRenderItem *renderItem = plotItem->renderItem(PlotRenderItem::Cartesian);
- renderItem->addRelation(kst_cast<Relation>(curve));
- plotItem->update();
+ if (_histogramTab->curvePlacement()->place() != CurvePlacement::NoPlot) {
+ PlotRenderItem *renderItem = plotItem->renderItem(PlotRenderItem::Cartesian);
+ renderItem->addRelation(kst_cast<Relation>(curve));
+ plotItem->update();
- plotItem->parentView()->appendToLayout(_histogramTab->curvePlacement()->layout(), plotItem, _histogramTab->curvePlacement()->gridColumns());
-
+ plotItem->parentView()->appendToLayout(_histogramTab->curvePlacement()->layout(), plotItem, _histogramTab->curvePlacement()->gridColumns());
+ }
return ObjectPtr(histogram.data());
}
--- branches/work/kst/portto4/kst/src/libkstapp/imagedialog.cpp #858824:858825
@@ -469,11 +469,13 @@
break;
}
- PlotRenderItem *renderItem = plotItem->renderItem(PlotRenderItem::Cartesian);
- renderItem->addRelation(kst_cast<Relation>(image));
- plotItem->update();
+ if (_imageTab->curvePlacement()->place() != CurvePlacement::NoPlot) {
+ PlotRenderItem *renderItem = plotItem->renderItem(PlotRenderItem::Cartesian);
+ renderItem->addRelation(kst_cast<Relation>(image));
+ plotItem->update();
- plotItem->parentView()->appendToLayout(_imageTab->curvePlacement()->layout(), plotItem, _imageTab->curvePlacement()->gridColumns());
+ plotItem->parentView()->appendToLayout(_imageTab->curvePlacement()->layout(), plotItem, _imageTab->curvePlacement()->gridColumns());
+ }
return ObjectPtr(image.data());
}
--- branches/work/kst/portto4/kst/src/libkstapp/powerspectrumdialog.cpp #858824:858825
@@ -253,11 +253,13 @@
break;
}
- PlotRenderItem *renderItem = plotItem->renderItem(PlotRenderItem::Cartesian);
- renderItem->addRelation(kst_cast<Relation>(curve));
- plotItem->update();
+ if (_powerSpectrumTab->curvePlacement()->place() != CurvePlacement::NoPlot) {
+ PlotRenderItem *renderItem = plotItem->renderItem(PlotRenderItem::Cartesian);
+ renderItem->addRelation(kst_cast<Relation>(curve));
+ plotItem->update();
- plotItem->parentView()->appendToLayout(_powerSpectrumTab->curvePlacement()->layout(), plotItem, _powerSpectrumTab->curvePlacement()->gridColumns());
+ plotItem->parentView()->appendToLayout(_powerSpectrumTab->curvePlacement()->layout(), plotItem, _powerSpectrumTab->curvePlacement()->gridColumns());
+ }
return ObjectPtr(powerspectrum.data());
}
More information about the Kst
mailing list