diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-05-11 20:52:33 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-05-11 21:06:01 +0100 |
commit | fe6308ac60fa4d83d7a236ce0d233e0bbaac95bd (patch) | |
tree | dbb484dd26d6e6a200d28fbd00103d58c639fbe5 /chart2/source/tools/AxisHelper.cxx | |
parent | 934a7925de64f93c09429fc8482245635937c271 (diff) |
coverity#1158099 Unchecked dynamic_cast
Change-Id: I7c294042a3f4d7293fb6d93d33687eb265871e76
Diffstat (limited to 'chart2/source/tools/AxisHelper.cxx')
-rw-r--r-- | chart2/source/tools/AxisHelper.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx index d5e6db4032a4..6157fbb7b079 100644 --- a/chart2/source/tools/AxisHelper.cxx +++ b/chart2/source/tools/AxisHelper.cxx @@ -148,10 +148,14 @@ sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis( { bool bFormatSet = false; //check whether we have a percent scale -> use percent format + ChartModel* pModel = NULL; if( xNumberFormatsSupplier.is() ) { - ChartModel* pModel = dynamic_cast<ChartModel*>( xChartDoc.get() ); + pModel = dynamic_cast<ChartModel*>( xChartDoc.get() ); assert(pModel); + } + if (pModel) + { ScaleData aData = AxisHelper::getDateCheckedScale( xAxis, *pModel ); if( aData.AxisType==AxisType::PERCENT ) { |