sc/source/ui/vba/vbaname.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
New commits: commit adb426d297503adc168e791036b5006185b911e7 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Wed Dec 21 11:17:57 2022 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Wed Dec 21 14:02:07 2022 +0000 Use ScNameRangeObj's existing XUnoTunnel Change-Id: I968484d9c140dd9407732c07b2bbc042f0342725 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144679 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> 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?