summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-12-21 11:17:57 +0100
committerStephan Bergmann <sbergman@redhat.com>2022-12-21 14:02:07 +0000
commitadb426d297503adc168e791036b5006185b911e7 (patch)
treea0ae92c5ca0266585144b8ce94ae110fd2a2f5ee /sc
parent701ec65fff1cc532f7ee7b8be3883c6a536e2c85 (diff)
Use ScNameRangeObj's existing XUnoTunnel
Change-Id: I968484d9c140dd9407732c07b2bbc042f0342725 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144679 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/vba/vbaname.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sc/source/ui/vba/vbaname.cxx b/sc/source/ui/vba/vbaname.cxx
index eece5396c27c..ec0dbe982d28 100644
--- a/sc/source/ui/vba/vbaname.cxx
+++ b/sc/source/ui/vba/vbaname.cxx
@@ -26,6 +26,8 @@
#include <compiler.hxx>
#include <tokenarray.hxx>
+#include <comphelper/servicehelper.hxx>
+
#include <memory>
#include <utility>
@@ -85,7 +87,7 @@ ScVbaName::setVisible( sal_Bool /*bVisible*/ )
OUString ScVbaName::getContent( const formula::FormulaGrammar::Grammar eGrammar )
{
- ScNamedRangeObj* pNamedRange = dynamic_cast< ScNamedRangeObj* >( mxNamedRange.get() );
+ ScNamedRangeObj* pNamedRange = comphelper::getFromUnoTunnel< ScNamedRangeObj >( mxNamedRange );
OUString aContent;
if ( pNamedRange )
{
@@ -103,7 +105,7 @@ void ScVbaName::setContent( const OUString& rContent, const formula::FormulaGra
OUString sContent( rContent );
if (sContent.startsWith("="))
sContent = sContent.copy(1);
- ScNamedRangeObj* pNamedRange = dynamic_cast< ScNamedRangeObj* >( mxNamedRange.get() );
+ ScNamedRangeObj* pNamedRange = comphelper::getFromUnoTunnel< ScNamedRangeObj >( mxNamedRange );
// We should be able to do the below by just setting calling SetCode on pNamedRange
// right?