diff options
author | Noel <noelgrandin@gmail.com> | 2020-10-13 11:02:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-13 12:47:38 +0200 |
commit | 1374f5fdcbbd24b9ba614b378fd94f5ff95ad102 (patch) | |
tree | a47982a70463150dced3c7c1a7d13c669febd681 /sd/source/ui/unoidl | |
parent | 97b7b6030a6cf5b28ae0c1f61f7f55167b82dab6 (diff) |
static_cast after dynamic_cast
Change-Id: I53e10fbebfd07c471ddd9b264562317251700500
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104225
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui/unoidl')
-rw-r--r-- | sd/source/ui/unoidl/unopage.cxx | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 1c95cb1820a6..5b2debfcd06e 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -1760,8 +1760,8 @@ static void refreshpage( SdDrawDocument* pDoc, const PageKind ePageKind ) if( !pViewSh ) return; - if( dynamic_cast<const ::sd::DrawViewShell* >(pViewSh) != nullptr ) - static_cast< ::sd::DrawViewShell*>(pViewSh)->ResetActualPage(); + if( auto pDrawViewShell = dynamic_cast<::sd::DrawViewShell* >(pViewSh) ) + pDrawViewShell->ResetActualPage(); Size aPageSize = pDoc->GetSdPage(0, ePageKind)->GetSize(); const long nWidth = aPageSize.Width(); @@ -1891,8 +1891,9 @@ sal_Bool SAL_CALL SdPageLinkTargets::hasElements() { SdrObject* pObj = aIter.Next(); OUString aStr( pObj->GetName() ); - if( aStr.isEmpty() && dynamic_cast< const SdrOle2Obj *>( pObj ) != nullptr ) - aStr = static_cast< const SdrOle2Obj* >( pObj )->GetPersistName(); + if( aStr.isEmpty() ) + if (auto pOleObj = dynamic_cast< const SdrOle2Obj *>( pObj )) + aStr = pOleObj->GetPersistName(); if( !aStr.isEmpty() ) return true; } @@ -1936,8 +1937,9 @@ Sequence< OUString > SAL_CALL SdPageLinkTargets::getElementNames() { SdrObject* pObj = aIter.Next(); OUString aStr( pObj->GetName() ); - if( aStr.isEmpty() && dynamic_cast< const SdrOle2Obj *>( pObj ) != nullptr ) - aStr = static_cast< const SdrOle2Obj* >( pObj )->GetPersistName(); + if( aStr.isEmpty() ) + if (auto pOleObj = dynamic_cast< const SdrOle2Obj *>( pObj )) + aStr = pOleObj->GetPersistName(); if( !aStr.isEmpty() ) nObjCount++; } @@ -1953,8 +1955,9 @@ Sequence< OUString > SAL_CALL SdPageLinkTargets::getElementNames() { SdrObject* pObj = aIter.Next(); OUString aStr( pObj->GetName() ); - if( aStr.isEmpty() && dynamic_cast< const SdrOle2Obj *>( pObj ) != nullptr ) - aStr = static_cast< const SdrOle2Obj* >( pObj )->GetPersistName(); + if( aStr.isEmpty() ) + if (auto pOleObj = dynamic_cast< const SdrOle2Obj *>( pObj )) + aStr = pOleObj->GetPersistName(); if( !aStr.isEmpty() ) *pStr++ = aStr; } @@ -1982,8 +1985,9 @@ SdrObject* SdPageLinkTargets::FindObject( const OUString& rName ) const throw() { SdrObject* pObj = aIter.Next(); OUString aStr( pObj->GetName() ); - if( aStr.isEmpty() && dynamic_cast< const SdrOle2Obj *>( pObj ) != nullptr ) - aStr = static_cast< const SdrOle2Obj* >( pObj )->GetPersistName(); + if( aStr.isEmpty() ) + if (auto pOleObj = dynamic_cast< const SdrOle2Obj *>( pObj )) + aStr = pOleObj->GetPersistName(); if( !aStr.isEmpty() && (aStr == rName) ) return pObj; } |