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

Mike Kaganski mike.kaganski at collabora.com
Thu Dec 28 05:58:16 UTC 2017


 filter/source/msfilter/escherex.cxx |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

New commits:
commit 9bf5c139d1081a25dec990c5ca478a8b5d2f33a3
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Wed Dec 27 23:53:51 2017 +0100

    Simplify dynamic_cast check
    
    Change-Id: Ib16168c0b87c99bceae3970b739aaba1667b154b
    Reviewed-on: https://gerrit.libreoffice.org/47115
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index fc74cf75490f..6f1457e88e1a 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1246,8 +1246,7 @@ bool EscherPropertyContainer::CreateOLEGraphicProperties(const uno::Reference<dr
     if ( rXShape.is() )
     {
         SdrObject* pObject = GetSdrObjectFromXShape(rXShape); // SJ: leaving unoapi, because currently there is
-        const SdrOle2Obj* pOle2Obj = pObject == nullptr ? nullptr : dynamic_cast<const SdrOle2Obj*>(pObject);
-        if (pOle2Obj != nullptr) // no access to the native graphic object
+        if (auto pOle2Obj = dynamic_cast<const SdrOle2Obj*>(pObject)) // no access to the native graphic object
         {
             const Graphic* pGraphic = pOle2Obj->GetGraphic();
             if (pGraphic)
@@ -1297,8 +1296,7 @@ bool EscherPropertyContainer::CreateMediaGraphicProperties(const uno::Reference<
     if ( rXShape.is() )
     {
         SdrObject* pSdrObject(GetSdrObjectFromXShape(rXShape));  // SJ: leaving unoapi, because currently there is
-        auto* pSdrMediaObj = dynamic_cast<const SdrMediaObj*>(pSdrObject);
-        if (pSdrMediaObj != nullptr)               // no access to the native graphic object
+        if (auto pSdrMediaObj = dynamic_cast<const SdrMediaObj*>(pSdrObject)) // no access to the native graphic object
         {
             std::unique_ptr<GraphicObject> xGraphicObject(new GraphicObject(pSdrMediaObj->getSnapshot()));
             bRetValue = CreateGraphicProperties(rXShape, *xGraphicObject);
@@ -4610,8 +4608,7 @@ sal_uInt32 EscherConnectorListEntry::GetConnectorRule( bool bFirst )
                 else if ( nGluePointType == drawing::EnhancedCustomShapeGluePointType::SEGMENTS )
                 {
                     SdrObject* pObject = pCustoShape->DoConvertToPolyObj(true, true);
-                    const SdrPathObj* pSdrPathObj = dynamic_cast<const SdrPathObj*>(pObject);
-                    if (pSdrPathObj != nullptr)
+                    if (auto pSdrPathObj = dynamic_cast<const SdrPathObj*>(pObject))
                     {
                         sal_Int16 a, b, nIndex = 0;
                         sal_uInt32 nDistance = 0xffffffff;


More information about the Libreoffice-commits mailing list