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 /starmath/source/unomodel.cxx | |
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 'starmath/source/unomodel.cxx')
-rw-r--r-- | starmath/source/unomodel.cxx | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx index 17d52ce7b4d6..bb46211914e3 100644 --- a/starmath/source/unomodel.cxx +++ b/starmath/source/unomodel.cxx @@ -1063,15 +1063,8 @@ void SAL_CALL SmModel::setParent( const uno::Reference< uno::XInterface >& xPare { SolarMutexGuard aGuard; SfxBaseModel::setParent( xParent ); - uno::Reference< lang::XUnoTunnel > xParentTunnel( xParent, uno::UNO_QUERY ); - if ( xParentTunnel.is() ) - { - SvGlobalName aSfxIdent( SFX_GLOBAL_CLASSID ); - SfxObjectShell* pDoc = reinterpret_cast<SfxObjectShell *>(xParentTunnel->getSomething( - aSfxIdent.GetByteSequence() ) ); - if ( pDoc ) - GetObjectShell()->OnDocumentPrinterChanged( pDoc->GetDocumentPrinter() ); - } + if (SfxObjectShell* pDoc = SfxObjectShell::GetShellFromComponent(xParent)) + GetObjectShell()->OnDocumentPrinterChanged(pDoc->GetDocumentPrinter()); } void SmModel::writeFormulaOoxml( |