diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-08-06 12:36:18 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-08-06 12:29:38 +0200 |
commit | 1bc52b8ae3b7913eef449ecfa5b807784fb760f3 (patch) | |
tree | 038fe408e239752b4f4db03e5a7729282f815144 /sd/source | |
parent | a5b08e3ad777295e5977eb9880184fc3ad21249f (diff) |
Simplify a bit
Change-Id: Iffc22c60572f230e3c13d6e4de89856d50244eec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171521
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/view/drviews1.cxx | 52 |
1 files changed, 12 insertions, 40 deletions
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index 8f2a2190cc73..b8e5f82b9343 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -193,51 +193,23 @@ void DrawViewShell::SelectionHasChanged() try { - Client* pIPClient = static_cast<Client*>(rBase.GetIPClient()); - if ( pIPClient && pIPClient->IsObjectInPlaceActive() ) + if (pOleObj) + { + if (const auto& xObj = pOleObj->GetObjRef()) + rBase.SetVerbs(xObj->getSupportedVerbs()); + } + else if (auto* pIPClient = rBase.GetIPClient(); + pIPClient && pIPClient->IsObjectInPlaceActive()) { // as appropriate take ole-objects into account and deactivate // this means we recently deselected an inplace active ole object so // we need to deselect it now - if (!pOleObj) - { - //#i47279# disable frame until after object has completed unload - LockUI aUILock(GetViewFrame()); - pIPClient->DeactivateObject(); - //HMHmpDrView->ShowMarkHdl(); - } - else - { - const uno::Reference < embed::XEmbeddedObject >& xObj = pOleObj->GetObjRef(); - if ( xObj.is() ) - { - rBase.SetVerbs( xObj->getSupportedVerbs() ); - } - else - { - rBase.SetVerbs( uno::Sequence < embed::VerbDescriptor >() ); - } - } - } - else - { - if ( pOleObj ) - { - const uno::Reference < embed::XEmbeddedObject >& xObj = pOleObj->GetObjRef(); - if ( xObj.is() ) - { - rBase.SetVerbs( xObj->getSupportedVerbs() ); - } - else - { - rBase.SetVerbs( uno::Sequence < embed::VerbDescriptor >() ); - } - } - else - { - rBase.SetVerbs( uno::Sequence < embed::VerbDescriptor >() ); - } + + //#i47279# disable frame until after object has completed unload + LockUI aUILock(GetViewFrame()); + pIPClient->DeactivateObject(); + //HMHmpDrView->ShowMarkHdl(); } } catch( css::uno::Exception& ) |