diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-01-10 13:58:50 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-01-10 14:59:31 +0100 |
commit | 8f453c674f19188360ba5895c2bd9bd80273a83b (patch) | |
tree | ce569bb8caeaea0b110e1e23e845716cb841588f /oox | |
parent | c5367ee0a60966b755e726de6d175dfcd1630741 (diff) |
static_cast after dynamic_cast
Change-Id: I3792ddadad9582a7e6f4740829c081d9571ddaff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109049
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/shapes.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index aae5ed633d85..58246d08f231 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -2141,12 +2141,13 @@ ShapeExport& ShapeExport::WriteOLE2Shape( const Reference< XShape >& xShape ) SdrObject* pSdrOLE2( GetSdrObjectFromXShape( xShape ) ); // The spec doesn't allow <p:pic> here, but PowerPoint requires it. bool bEcma = mpFB->getVersion() == oox::core::ECMA_DIALECT; - if (dynamic_cast<const SdrOle2Obj*>( pSdrOLE2) && bEcma) - { - const Graphic* pGraphic = static_cast<SdrOle2Obj*>(pSdrOLE2)->GetGraphic(); - if (pGraphic) - WriteGraphicObjectShapePart( xShape, pGraphic ); - } + if (bEcma) + if (auto pOle2Obj = dynamic_cast<SdrOle2Obj*>(pSdrOLE2)) + { + const Graphic* pGraphic = pOle2Obj->GetGraphic(); + if (pGraphic) + WriteGraphicObjectShapePart( xShape, pGraphic ); + } mpFS->endElementNS( mnXmlNamespace, XML_oleObj ); |