diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-11-02 09:44:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-11-02 13:30:14 +0100 |
commit | a6cf6ac1f6df02c9fe733858f2aae866ffd38569 (patch) | |
tree | b32b5e5ad055586024a2aab6daded70d061a4204 /chart2 | |
parent | 965ffbf0c22a1ad780ad92e2e7c54522d9e6a7d0 (diff) |
tdf#54857 elide more dynamic_cast
Change-Id: I0cbdb2ee46600559d9a37f09b574d484e72a0e0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142133
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/drawinglayer/DrawViewWrapper.cxx | 2 | ||||
-rw-r--r-- | chart2/source/controller/main/ChartController_Window.cxx | 2 | ||||
-rw-r--r-- | chart2/source/controller/main/SelectionHelper.cxx | 7 |
3 files changed, 5 insertions, 6 deletions
diff --git a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx index 3918a296e638..cb63c2d690a8 100644 --- a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx +++ b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx @@ -168,7 +168,7 @@ SdrObject* DrawViewWrapper::getHitObject( const Point& rPnt ) const //3d objects need a special treatment //because the simple PickObj method is not accurate in this case for performance reasons - E3dObject* pE3d = dynamic_cast< E3dObject* >(pRet); + E3dObject* pE3d = DynCastE3dObject(pRet); if( pE3d ) { E3dScene* pScene(pE3d->getRootE3dSceneFromE3dObject()); diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index 41cb6e592db0..91295002cf03 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -844,7 +844,7 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt ) awt::Size aPageSize( ChartModelHelper::getPageSize( getChartModel() ) ); tools::Rectangle aPageRect( 0,0,aPageSize.Width,aPageSize.Height ); - const E3dObject* pE3dObject(dynamic_cast< const E3dObject*>(pObj)); + const E3dObject* pE3dObject(DynCastE3dObject(pObj)); if(nullptr != pE3dObject) { E3dScene* pScene(pE3dObject->getRootE3dSceneFromE3dObject()); diff --git a/chart2/source/controller/main/SelectionHelper.cxx b/chart2/source/controller/main/SelectionHelper.cxx index 177d7acf588b..46f648399980 100644 --- a/chart2/source/controller/main/SelectionHelper.cxx +++ b/chart2/source/controller/main/SelectionHelper.cxx @@ -465,7 +465,7 @@ SelectionHelper::~SelectionHelper() bool SelectionHelper::getFrameDragSingles() { //true == green == surrounding handles - return dynamic_cast<const E3dObject*>( m_pSelectedObj) == nullptr; + return DynCastE3dObject( m_pSelectedObj) == nullptr; } SdrObject* SelectionHelper::getMarkHandlesObject( SdrObject* pObj ) @@ -532,7 +532,7 @@ E3dScene* SelectionHelper::getSceneToRotate( SdrObject* pObj ) if(pObj) { - pRotateable = dynamic_cast<E3dObject*>(pObj); + pRotateable = DynCastE3dObject(pObj); if( !pRotateable ) { SolarMutexGuard aSolarGuard; @@ -542,8 +542,7 @@ E3dScene* SelectionHelper::getSceneToRotate( SdrObject* pObj ) SdrObjListIter aIterator(pSubList, SdrIterMode::DeepWithGroups); while( aIterator.IsMore() && !pRotateable ) { - SdrObject* pSubObj = aIterator.Next(); - pRotateable = dynamic_cast<E3dObject*>(pSubObj); + pRotateable = DynCastE3dObject(aIterator.Next()); } } } |