diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2017-12-27 23:53:51 +0100 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2017-12-28 06:57:52 +0100 |
commit | 9bf5c139d1081a25dec990c5ca478a8b5d2f33a3 (patch) | |
tree | 029ce3d463516530b232d3f40178b17f4533cd02 /filter | |
parent | Fix spelling in comments (diff) | |
download | core-9bf5c139d1081a25dec990c5ca478a8b5d2f33a3.tar.gz core-9bf5c139d1081a25dec990c5ca478a8b5d2f33a3.zip |
Simplify dynamic_cast check
Change-Id: Ib16168c0b87c99bceae3970b739aaba1667b154b
Reviewed-on: https://gerrit.libreoffice.org/47115
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/msfilter/escherex.cxx | 9 |
1 files changed, 3 insertions, 6 deletions
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; |