From c7b898df4d452746399621f6adc8e7da088f0f3a Mon Sep 17 00:00:00 2001 From: Noel Date: Sun, 7 Mar 2021 18:41:56 +0200 Subject: clean up some more dynamic/static casting using a hacked version of the staticdynamic plugin and some judgement Change-Id: I5e6668b19320025e419f84bebceade4239577729 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112137 Tested-by: Jenkins Reviewed-by: Noel Grandin --- svx/source/engine3d/view3d.cxx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'svx/source/engine3d/view3d.cxx') diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx index 4ab95d4b5ca2..decbf61b7b0c 100644 --- a/svx/source/engine3d/view3d.cxx +++ b/svx/source/engine3d/view3d.cxx @@ -324,17 +324,18 @@ std::unique_ptr E3dView::CreateMarkedObjModel() const { const SdrObject* pObj = GetMarkedObjectByIndex(nObjs); - if(!bSpecialHandling && dynamic_cast< const E3dCompoundObject*>(pObj)) - { - // if the object is selected, but it's scene not, - // we need special handling - pScene = static_cast(pObj)->getRootE3dSceneFromE3dObject(); - - if(nullptr != pScene && !IsObjMarked(pScene)) + if(!bSpecialHandling) + if(auto pCompoundObj = dynamic_cast< const E3dCompoundObject*>(pObj)) { - bSpecialHandling = true; + // if the object is selected, but it's scene not, + // we need special handling + pScene = pCompoundObj->getRootE3dSceneFromE3dObject(); + + if(nullptr != pScene && !IsObjMarked(pScene)) + { + bSpecialHandling = true; + } } - } if(auto p3dObject = dynamic_cast< const E3dObject*>(pObj)) { -- cgit