From 3c08e71af3629bc653f9eca8e570a3be9eaabac8 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 20 Jan 2023 13:24:35 +0200 Subject: XUnoTunnel->dynamic_cast in SvUnoImageMapObject/SvUnoImageMap Change-Id: Ia8b862e5bfe4ade3f70521874e8549f939de810e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145930 Tested-by: Jenkins Reviewed-by: Noel Grandin --- svtools/source/uno/unoimap.cxx | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx index 4d64cc8b405e..64d7521fc63b 100644 --- a/svtools/source/uno/unoimap.cxx +++ b/svtools/source/uno/unoimap.cxx @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -69,15 +68,12 @@ class SvUnoImageMapObject : public OWeakAggObject, public XEventsSupplier, public XServiceInfo, public PropertySetHelper, - public XTypeProvider, - public XUnoTunnel + public XTypeProvider { public: SvUnoImageMapObject( IMapObjectType nType, const SvEventDescription* pSupportedMacroItems ); SvUnoImageMapObject( const IMapObject& rMapObject, const SvEventDescription* pSupportedMacroItems ); - UNO3_GETIMPLEMENTATION_DECL( SvUnoImageMapObject ) - std::unique_ptr createIMapObject() const; rtl::Reference mxEvents; @@ -124,8 +120,6 @@ private: } -UNO3_GETIMPLEMENTATION_IMPL( SvUnoImageMapObject ); - rtl::Reference SvUnoImageMapObject::createPropertySetInfo( IMapObjectType nType ) { switch( nType ) @@ -317,8 +311,6 @@ Any SAL_CALL SvUnoImageMapObject::queryAggregation( const Type & rType ) aAny <<= Reference< XEventsSupplier >(this); else if( rType == cppu::UnoType::get()) aAny <<= Reference< XMultiPropertySet >(this); - else if( rType == cppu::UnoType::get()) - aAny <<= Reference< XUnoTunnel >(this); else aAny = OWeakAggObject::queryAggregation( rType ); @@ -343,8 +335,7 @@ uno::Sequence< uno::Type > SAL_CALL SvUnoImageMapObject::getTypes() cppu::UnoType::get(), cppu::UnoType::get(), cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get() }; + cppu::UnoType::get() }; return aTypes; } @@ -499,7 +490,7 @@ Reference< XNameReplace > SAL_CALL SvUnoImageMapObject::getEvents() namespace { -class SvUnoImageMap : public WeakImplHelper< XIndexContainer, XServiceInfo, XUnoTunnel > +class SvUnoImageMap : public WeakImplHelper< XIndexContainer, XServiceInfo > { public: explicit SvUnoImageMap(); @@ -509,8 +500,6 @@ public: /// @throws IllegalArgumentException static SvUnoImageMapObject* getObject( const Any& aElement ); - UNO3_GETIMPLEMENTATION_DECL( SvUnoImageMap ) - // XIndexContainer virtual void SAL_CALL insertByIndex( sal_Int32 Index, const Any& Element ) override; virtual void SAL_CALL removeByIndex( sal_Int32 Index ) override; @@ -539,8 +528,6 @@ private: } -UNO3_GETIMPLEMENTATION_IMPL( SvUnoImageMap ); - SvUnoImageMap::SvUnoImageMap() { } @@ -563,7 +550,7 @@ SvUnoImageMapObject* SvUnoImageMap::getObject( const Any& aElement ) Reference< XInterface > xObject; aElement >>= xObject; - SvUnoImageMapObject* pObject = comphelper::getFromUnoTunnel( xObject ); + SvUnoImageMapObject* pObject = dynamic_cast( xObject.get() ); if( nullptr == pObject ) throw IllegalArgumentException(); @@ -709,7 +696,7 @@ Reference< XInterface > SvUnoImageMap_createInstance( const ImageMap& rMap, cons bool SvUnoImageMap_fillImageMap( const Reference< XInterface >& xImageMap, ImageMap& rMap ) { - SvUnoImageMap* pUnoImageMap = comphelper::getFromUnoTunnel( xImageMap ); + SvUnoImageMap* pUnoImageMap = dynamic_cast( xImageMap.get() ); if( nullptr == pUnoImageMap ) return false; -- cgit v1.2.3