diff options
author | Noel <noelgrandin@gmail.com> | 2020-10-12 16:09:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-13 09:30:12 +0200 |
commit | f9ac067da9e61f479e2433d500b9b940e5a45470 (patch) | |
tree | 1b057d3b97cc7dcf6d3de377da34cbf23af9c3ee /filter | |
parent | tdf#137180 RTF import: fix bad left margin with direct format/para style/num (diff) | |
download | core-f9ac067da9e61f479e2433d500b9b940e5a45470.tar.gz core-f9ac067da9e61f479e2433d500b9b940e5a45470.zip |
static_cast after dynamic_cast
Change-Id: I487b5dc148f5a3d0d45f198c00179002841242ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104213
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/msfilter/svdfppt.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 02c8ce67068a..786c538e18ea 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -778,12 +778,13 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, Svx case PPT_PST_RecolorInfoAtom : { - if ( dynamic_cast<const SdrGrafObj* >(pRet) != nullptr && static_cast<SdrGrafObj*>(pRet)->HasGDIMetaFile() ) - { - Graphic aGraphic( static_cast<SdrGrafObj*>(pRet)->GetGraphic() ); - RecolorGraphic( rSt, aClientDataHd.nRecLen, aGraphic ); - static_cast<SdrGrafObj*>(pRet)->SetGraphic( aGraphic ); - } + if ( auto pSdrGrafObj = dynamic_cast<const SdrGrafObj* >(pRet) ) + if ( pSdrGrafObj->HasGDIMetaFile() ) + { + Graphic aGraphic( pSdrGrafObj->GetGraphic() ); + RecolorGraphic( rSt, aClientDataHd.nRecLen, aGraphic ); + static_cast<SdrGrafObj*>(pRet)->SetGraphic( aGraphic ); + } } break; } @@ -7103,9 +7104,8 @@ PPTTextObj& PPTTextObj::operator=( PPTTextObj& rTextObj ) static bool IsLine( const SdrObject* pObj ) { - return dynamic_cast< const SdrPathObj* >(pObj) != nullptr && - static_cast<const SdrPathObj*>(pObj)->IsLine() && - static_cast<const SdrPathObj*>(pObj)->GetPointCount() == 2; + auto pSdrPathObj = dynamic_cast< const SdrPathObj* >(pObj); + return pSdrPathObj && pSdrPathObj->IsLine() && pSdrPathObj->GetPointCount() == 2; } static bool GetCellPosition( const SdrObject* pObj, const std::set< sal_Int32 >& rRows, const std::set< sal_Int32 >& rColumns, |