diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-09-12 17:22:23 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-09-13 12:49:46 +0200 |
commit | 0c88fd43aebc57ebe8e4e49b74c1b6bef067ad89 (patch) | |
tree | 16173deb89a3b34d040a36ce2a25590d6bc0e849 /sfx2/source/view | |
parent | 35377971467be9b2ba30bab3e9b0983be11b4196 (diff) |
Unify the code used to get object shell for components
and their parents across the codebase.
Change-Id: Ifb37fb940d285f81c1724a912204533e8c3b0044
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102546
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sfx2/source/view')
-rw-r--r-- | sfx2/source/view/frame.cxx | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index c7aa11f97b08..8997b9367317 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -30,7 +30,6 @@ #include <vcl/menu.hxx> #include <svl/intitem.hxx> #include <svl/stritem.hxx> -#include <tools/globname.hxx> #include <tools/svborder.hxx> #include <osl/diagnose.h> @@ -691,15 +690,10 @@ void SfxFrame::Resize() SfxInPlaceClient* pClient = GetCurrentViewFrame()->GetViewShell() ? GetCurrentViewFrame()->GetViewShell()->GetUIActiveIPClient_Impl() : nullptr; if ( pClient ) { - uno::Reference < lang::XUnoTunnel > xObj( pClient->GetObject()->getComponent(), uno::UNO_QUERY ); - uno::Sequence < sal_Int8 > aSeq( SvGlobalName( SFX_GLOBAL_CLASSID ).GetByteSequence() ); - sal_Int64 nHandle = (xObj.is()? xObj->getSomething( aSeq ): 0); - if ( nHandle ) - { - SfxObjectShell* pDoc = reinterpret_cast< SfxObjectShell* >( sal::static_int_cast< sal_IntPtr >( nHandle )); - SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pDoc ); - pWork = pFrame ? pFrame->GetFrame().GetWorkWindow_Impl() : nullptr; - } + SfxObjectShell* pDoc + = SfxObjectShell::GetShellFromComponent(pClient->GetObject()->getComponent()); + SfxViewFrame* pFrame = SfxViewFrame::GetFirst(pDoc); + pWork = pFrame ? pFrame->GetFrame().GetWorkWindow_Impl() : nullptr; } if ( pWork ) |