summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-01-16 14:05:19 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-01-17 11:28:43 +0000
commit87d0f136dede84f694240f55a958d94e3d0fe9ce (patch)
tree49bc63dc7cbab681c6c048740462919dea64d9c1 /sc
parent377a8c8ed7dd997d1ac96918b69f805880d208af (diff)
XUnoTunnel->dynamic_cast in ScNamedRangeObj
Change-Id: Ib298d8ba676f5a6ddf3fe9b7a49dc45c46d7adbc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145636 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/nameuno.hxx7
-rw-r--r--sc/source/ui/unoobj/nameuno.cxx14
-rw-r--r--sc/source/ui/vba/vbaname.cxx4
3 files changed, 2 insertions, 23 deletions
diff --git a/sc/inc/nameuno.hxx b/sc/inc/nameuno.hxx
index 4cd5423cfc0b..ee37dc365d2f 100644
--- a/sc/inc/nameuno.hxx
+++ b/sc/inc/nameuno.hxx
@@ -31,7 +31,6 @@
#include <com/sun/star/sheet/XNamedRanges.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/document/XActionLockable.hpp>
#include <cppuhelper/implbase.hxx>
@@ -47,7 +46,6 @@ class SC_DLLPUBLIC ScNamedRangeObj final : public ::cppu::WeakImplHelper<
css::sheet::XFormulaTokens,
css::sheet::XCellRangeReferrer,
css::beans::XPropertySet,
- css::lang::XUnoTunnel,
css::lang::XServiceInfo >,
public SfxListener
{
@@ -109,11 +107,6 @@ public:
virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
- /// XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
-
- static const css::uno::Sequence<sal_Int8>& getUnoTunnelId();
-
/// XServiceInfo
virtual OUString SAL_CALL getImplementationName() override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx
index 6d6a56a6d85b..a49748b1a951 100644
--- a/sc/source/ui/unoobj/nameuno.cxx
+++ b/sc/source/ui/unoobj/nameuno.cxx
@@ -419,20 +419,6 @@ uno::Sequence<OUString> SAL_CALL ScNamedRangeObj::getSupportedServiceNames()
return {SCNAMEDRANGEOBJ_SERVICE, SCLINKTARGET_SERVICE};
}
-// XUnoTunnel
-
-sal_Int64 SAL_CALL ScNamedRangeObj::getSomething(
- const uno::Sequence<sal_Int8 >& rId )
-{
- return comphelper::getSomethingImpl(rId, this);
-}
-
-const uno::Sequence<sal_Int8>& ScNamedRangeObj::getUnoTunnelId()
-{
- static const comphelper::UnoIdInit theScNamedRangeObjUnoTunnelId;
- return theScNamedRangeObjUnoTunnelId.getSeq();
-}
-
ScNamedRangesObj::ScNamedRangesObj(ScDocShell* pDocSh) :
mbModifyAndBroadcast(true),
pDocShell( pDocSh )
diff --git a/sc/source/ui/vba/vbaname.cxx b/sc/source/ui/vba/vbaname.cxx
index ec0dbe982d28..98a242401e7d 100644
--- a/sc/source/ui/vba/vbaname.cxx
+++ b/sc/source/ui/vba/vbaname.cxx
@@ -87,7 +87,7 @@ ScVbaName::setVisible( sal_Bool /*bVisible*/ )
OUString ScVbaName::getContent( const formula::FormulaGrammar::Grammar eGrammar )
{
- ScNamedRangeObj* pNamedRange = comphelper::getFromUnoTunnel< ScNamedRangeObj >( mxNamedRange );
+ ScNamedRangeObj* pNamedRange = dynamic_cast< ScNamedRangeObj* >( mxNamedRange.get() );
OUString aContent;
if ( pNamedRange )
{
@@ -105,7 +105,7 @@ void ScVbaName::setContent( const OUString& rContent, const formula::FormulaGra
OUString sContent( rContent );
if (sContent.startsWith("="))
sContent = sContent.copy(1);
- ScNamedRangeObj* pNamedRange = comphelper::getFromUnoTunnel< ScNamedRangeObj >( mxNamedRange );
+ ScNamedRangeObj* pNamedRange = dynamic_cast< ScNamedRangeObj* >( mxNamedRange.get() );
// We should be able to do the below by just setting calling SetCode on pNamedRange
// right?