Skip to content

Commit

Permalink
dynamic_casts, axistype(), coverity issue 1075789, re #11152
Browse files Browse the repository at this point in the history
  • Loading branch information
FedeMPouzols committed Feb 22, 2015
1 parent 6d8efcb commit a8d647b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Code/Mantid/MantidPlot/src/Graph.cpp
Expand Up @@ -427,7 +427,11 @@ ScaleDraw::ScaleType Graph::axisType(int axis)
if (!d_plot->axisEnabled(axis))
return ScaleDraw::Numeric;

return dynamic_cast<ScaleDraw *>(d_plot->axisScaleDraw(axis))->scaleType();
ScaleDraw *sd = dynamic_cast<ScaleDraw *>(d_plot->axisScaleDraw(axis));
if (sd)
return sd->scaleType();
else // assuming this is a good default
return ScaleDraw::Numeric;
}

void Graph::setLabelsNumericFormat(int axis, int format, int prec, const QString& formula)
Expand Down

0 comments on commit a8d647b

Please sign in to comment.