Skip to content

Commit

Permalink
dynamic_cast, updateSecondaryAxis(), issues 1075799,800,803, re #11152
Browse files Browse the repository at this point in the history
  • Loading branch information
FedeMPouzols committed Feb 22, 2015
1 parent 9bdd252 commit 27a4b6e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Code/Mantid/MantidPlot/src/Graph.cpp
Expand Up @@ -954,7 +954,7 @@ void Graph::updateSecondaryAxis(int axis)

if (it->rtti() == QwtPlotItem::Rtti_PlotSpectrogram){
Spectrogram *sp = dynamic_cast<Spectrogram *>(it);
if (sp->colorScaleAxis() == axis)
if (!sp || sp->colorScaleAxis() == axis)
return;
}

Expand All @@ -971,7 +971,10 @@ void Graph::updateSecondaryAxis(int axis)
return;

ScaleEngine *sc_engine = dynamic_cast<ScaleEngine *>(d_plot->axisScaleEngine(axis));
sc_engine->clone(dynamic_cast<ScaleEngine *>(d_plot->axisScaleEngine(a)));
if (sc_engine) {
ScaleEngine *a_engine = dynamic_cast<ScaleEngine *>(d_plot->axisScaleEngine(a));
sc_engine->clone(a_engine);
}

/*QwtScaleEngine *qwtsc_engine = d_plot->axisScaleEngine(axis);
ScaleEngine *sc_engine=dynamic_cast<ScaleEngine*>(qwtsc_engine);
Expand Down

0 comments on commit 27a4b6e

Please sign in to comment.