Kaydet (Commit) 4d1118e5 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

Simplify dynamic_cast followed by a static_cast.

Change-Id: Ia8b1145d43828a40611e5f59651d9dc6ff7d5360
üst a07a6985
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment