summaryrefslogtreecommitdiff
path: root/sc/source/ui/vba
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-12-21 11:54:23 +0100
committerStephan Bergmann <sbergman@redhat.com>2022-12-21 14:41:10 +0000
commit5940427063f7a6ef914b65cf9e2396eb2cc828ca (patch)
treeeb689b3c398353f05b6fc047517e5b1254da7946 /sc/source/ui/vba
parentadb426d297503adc168e791036b5006185b911e7 (diff)
Use ScModelObj's existing XUnoTunnel
Change-Id: I2f0a6bbc5fe382a64d0a32ba955a28f44dad388c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144681 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sc/source/ui/vba')
-rw-r--r--sc/source/ui/vba/excelvbahelper.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sc/source/ui/vba/excelvbahelper.cxx b/sc/source/ui/vba/excelvbahelper.cxx
index 317b064543b2..1c1824d89533 100644
--- a/sc/source/ui/vba/excelvbahelper.cxx
+++ b/sc/source/ui/vba/excelvbahelper.cxx
@@ -21,6 +21,7 @@
#include <basic/basmgr.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/servicehelper.hxx>
#include <vbahelper/vbahelper.hxx>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/sheet/XSheetCellRange.hpp>
@@ -238,7 +239,7 @@ ScDocShell*
getDocShell( const css::uno::Reference< css::frame::XModel>& xModel )
{
uno::Reference< uno::XInterface > xIf( xModel, uno::UNO_QUERY_THROW );
- ScModelObj* pModel = dynamic_cast< ScModelObj* >( xIf.get() );
+ ScModelObj* pModel = comphelper::getFromUnoTunnel< ScModelObj >( xIf );
ScDocShell* pDocShell = nullptr;
if ( pModel )
pDocShell = static_cast<ScDocShell*>(pModel->GetEmbeddedObject());