[Libreoffice-commits] core.git: xmloff/source

Jan Holesovsky kendy at collabora.com
Wed Jun 22 13:51:53 UTC 2016


 xmloff/source/chart/SchXMLPlotAreaContext.cxx |   25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

New commits:
commit 56a4c9b9ce28a87f18ea82675d215328905c2f12
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Jun 22 15:49:56 2016 +0200

    Simplify dynamic_cast followed by a static_cast.
    
    Change-Id: Ie4b92f3763d2d695709a4919faceb520f874897f

diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
index 04b31d8..65ddc9a 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
@@ -798,18 +798,17 @@ void SchXMLWallFloorContext::StartElement( const uno::Reference< xml::sax::XAttr
                                                      ? mxWallFloorSupplier->getWall()
                                                      : mxWallFloorSupplier->getFloor(),
                                                      uno::UNO_QUERY );
-        if( xProp.is())
+        if (xProp.is())
         {
-            if( !sAutoStyleName.isEmpty())
+            if (!sAutoStyleName.isEmpty())
             {
                 const SvXMLStylesContext* pStylesCtxt = mrImportHelper.GetAutoStylesContext();
-                if( pStylesCtxt )
+                if (pStylesCtxt)
                 {
-                    const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
-                        SchXMLImportHelper::GetChartFamilyID(), sAutoStyleName );
+                    SvXMLStyleContext* pStyle = const_cast<SvXMLStyleContext*>(pStylesCtxt->FindStyleChildContext(SchXMLImportHelper::GetChartFamilyID(), sAutoStyleName));
 
-                    if( pStyle && dynamic_cast< const XMLPropStyleContext*>(pStyle) !=  nullptr)
-                        const_cast<XMLPropStyleContext*>( static_cast<const XMLPropStyleContext*>( pStyle ) )->FillPropertySet( xProp );
+                    if (XMLPropStyleContext* pPropStyle = dynamic_cast<XMLPropStyleContext*>(pStyle))
+                        pPropStyle->FillPropertySet(xProp);
                 }
             }
         }
@@ -870,16 +869,16 @@ void SchXMLStockContext::StartElement( const uno::Reference< xml::sax::XAttribut
                     xProp = mxStockPropProvider->getMinMaxLine();
                     break;
             }
-            if( xProp.is())
+
+            if (xProp.is())
             {
                 const SvXMLStylesContext* pStylesCtxt = mrImportHelper.GetAutoStylesContext();
-                if( pStylesCtxt )
+                if (pStylesCtxt)
                 {
-                    const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
-                        SchXMLImportHelper::GetChartFamilyID(), sAutoStyleName );
+                    SvXMLStyleContext* pStyle = const_cast<SvXMLStyleContext*>(pStylesCtxt->FindStyleChildContext(SchXMLImportHelper::GetChartFamilyID(), sAutoStyleName));
 
-                    if( pStyle && dynamic_cast< const XMLPropStyleContext*>(pStyle) !=  nullptr)
-                        const_cast<XMLPropStyleContext*>( static_cast<const XMLPropStyleContext*>( pStyle ) )->FillPropertySet( xProp );
+                    if (XMLPropStyleContext* pPropStyle = dynamic_cast<XMLPropStyleContext*>(pStyle))
+                        pPropStyle->FillPropertySet(xProp);
                 }
             }
         }


More information about the Libreoffice-commits mailing list