diff options
author | Jan Holesovsky <kendy@collabora.com> | 2016-06-23 10:22:34 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2016-06-23 10:58:32 +0200 |
commit | 4d1118e5cc9f2a4dc20ea73fba4cb09d9e2a3ce5 (patch) | |
tree | 609cf615c17498f45ecf383a096fd206d6263a6a /xmloff/source/chart | |
parent | a07a69850acddae631d6bd9496ace0c35accdda5 (diff) |
Simplify dynamic_cast followed by a static_cast.
Change-Id: Ia8b1145d43828a40611e5f59651d9dc6ff7d5360
Diffstat (limited to 'xmloff/source/chart')
-rw-r--r-- | xmloff/source/chart/SchXMLAxisContext.cxx | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/xmloff/source/chart/SchXMLAxisContext.cxx b/xmloff/source/chart/SchXMLAxisContext.cxx index 652e223214ed..41fad4d761f0 100644 --- a/xmloff/source/chart/SchXMLAxisContext.cxx +++ b/xmloff/source/chart/SchXMLAxisContext.cxx @@ -465,17 +465,13 @@ void SchXMLAxisContext::CreateAxis() if( !m_aAutoStyleName.isEmpty()) { const SvXMLStylesContext* pStylesCtxt = m_rImportHelper.GetAutoStylesContext(); - if( pStylesCtxt ) + if (pStylesCtxt) { - const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext( - SchXMLImportHelper::GetChartFamilyID(), m_aAutoStyleName ); + SvXMLStyleContext* pStyle = const_cast<SvXMLStyleContext*>(pStylesCtxt->FindStyleChildContext(SchXMLImportHelper::GetChartFamilyID(), m_aAutoStyleName)); - if( pStyle && dynamic_cast<const XMLPropStyleContext*>( pStyle) != nullptr) + if (XMLPropStyleContext * pPropStyleContext = dynamic_cast<XMLPropStyleContext*>(pStyle)) { - // note: SvXMLStyleContext::FillPropertySet is not const - XMLPropStyleContext * pPropStyleContext = const_cast< XMLPropStyleContext * >( dynamic_cast< const XMLPropStyleContext * >( pStyle )); - if( pPropStyleContext ) - pPropStyleContext->FillPropertySet( m_xAxisProps ); + pPropStyleContext->FillPropertySet(m_xAxisProps); if( m_bAdaptWrongPercentScaleValues && m_aCurrentAxis.eDimension==SCH_XML_AXIS_Y ) { @@ -498,7 +494,7 @@ void SchXMLAxisContext::CreateAxis() if( xAxisSuppl.is() ) { Reference< beans::XPropertySet > xXAxisProp( xAxisSuppl->getAxis(0), uno::UNO_QUERY ); - const_cast<XMLPropStyleContext*>( static_cast< const XMLPropStyleContext* >( pStyle ))->FillPropertySet( xXAxisProp ); + pPropStyleContext->FillPropertySet(xXAxisProp); } //set scale data of added x axis back to default |