diff options
180 files changed, 242 insertions, 1255 deletions
diff --git a/accessibility/inc/extended/accessiblelistbox.hxx b/accessibility/inc/extended/accessiblelistbox.hxx index 7138820123ad..339e32f3b0b7 100644 --- a/accessibility/inc/extended/accessiblelistbox.hxx +++ b/accessibility/inc/extended/accessiblelistbox.hxx @@ -35,14 +35,12 @@ namespace accessibility { class AccessibleListBoxEntry; - using AccessibleListBox_Base = cppu::ImplHelper2< - css::accessibility::XAccessible, - css::accessibility::XAccessibleSelection>; - /** the class OAccessibleListBoxEntry represents the base class for an accessible object of a listbox entry */ class AccessibleListBox : - public AccessibleListBox_Base, + public cppu::ImplHelper2< + css::accessibility::XAccessible, + css::accessibility::XAccessibleSelection>, public VCLXAccessibleComponent { diff --git a/accessibility/source/extended/accessiblelistbox.cxx b/accessibility/source/extended/accessiblelistbox.cxx index bb1131d0ab4f..df4a9a759c0f 100644 --- a/accessibility/source/extended/accessiblelistbox.cxx +++ b/accessibility/source/extended/accessiblelistbox.cxx @@ -58,10 +58,8 @@ namespace accessibility dispose(); } } - IMPLEMENT_FORWARD_XINTERFACE2( - AccessibleListBox, VCLXAccessibleComponent, AccessibleListBox_Base); - IMPLEMENT_FORWARD_XTYPEPROVIDER2( - AccessibleListBox, VCLXAccessibleComponent, AccessibleListBox_Base); + IMPLEMENT_FORWARD_XINTERFACE2(AccessibleListBox, VCLXAccessibleComponent, ImplHelper2) + IMPLEMENT_FORWARD_XTYPEPROVIDER2(AccessibleListBox, VCLXAccessibleComponent, ImplHelper2) void AccessibleListBox::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) { diff --git a/basegfx/source/tools/canvastools.cxx b/basegfx/source/tools/canvastools.cxx index 1f65e89b182b..d388356199a2 100644 --- a/basegfx/source/tools/canvastools.cxx +++ b/basegfx/source/tools/canvastools.cxx @@ -30,7 +30,6 @@ #include <com/sun/star/rendering/XPolyPolygon2D.hpp> #include <com/sun/star/rendering/XGraphicDevice.hpp> #include <com/sun/star/awt/Rectangle.hpp> -#include <comphelper/servicehelper.hxx> #include <basegfx/utils/unopolypolygon.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/matrix/b3dhommatrix.hxx> @@ -252,7 +251,7 @@ namespace basegfx::unotools ::basegfx::B2DPolyPolygon b2DPolyPolygonFromXPolyPolygon2D( const uno::Reference< rendering::XPolyPolygon2D >& xPoly ) { ::basegfx::unotools::UnoPolyPolygon* pPolyImpl = - comphelper::getFromUnoTunnel< ::basegfx::unotools::UnoPolyPolygon >( xPoly ); + dynamic_cast< ::basegfx::unotools::UnoPolyPolygon* >( xPoly.get() ); if( pPolyImpl ) { diff --git a/basegfx/source/tools/unopolypolygon.cxx b/basegfx/source/tools/unopolypolygon.cxx index 099cbee5eb75..0c3b59abac9b 100644 --- a/basegfx/source/tools/unopolypolygon.cxx +++ b/basegfx/source/tools/unopolypolygon.cxx @@ -27,7 +27,6 @@ #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <basegfx/utils/unopolypolygon.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <utility> @@ -61,7 +60,7 @@ namespace basegfx::unotools } B2DPolyPolygon aSrcPoly; - const UnoPolyPolygon* pSrc( comphelper::getFromUnoTunnel< UnoPolyPolygon >(polyPolygon) ); + const UnoPolyPolygon* pSrc( dynamic_cast< UnoPolyPolygon* >(polyPolygon.get()) ); // try to extract polygon data from interface. First, // check whether it's the same implementation object, @@ -435,15 +434,6 @@ namespace basegfx::unotools return { "com.sun.star.rendering.PolyPolygon2D" }; } - sal_Int64 UnoPolyPolygon::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl(aIdentifier, this); - } - - css::uno::Sequence<sal_Int8> const & UnoPolyPolygon::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); - } - B2DPolyPolygon UnoPolyPolygon::getPolyPolygon() const { std::unique_lock const guard( m_aMutex ); diff --git a/basic/source/basmgr/basicmanagerrepository.cxx b/basic/source/basmgr/basicmanagerrepository.cxx index 803d8ed4caa0..7a2ed5efd20a 100644 --- a/basic/source/basmgr/basicmanagerrepository.cxx +++ b/basic/source/basmgr/basicmanagerrepository.cxx @@ -35,7 +35,6 @@ #include <vcl/svapp.hxx> #include <tools/debug.hxx> #include <comphelper/diagnose_ex.hxx> -#include <comphelper/servicehelper.hxx> #include <tools/urlobj.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/documentinfo.hxx> @@ -463,7 +462,7 @@ namespace basic } // knit the containers with the BasicManager - LibraryContainerInfo aInfo( xBasicLibs, xDialogLibs, comphelper::getFromUnoTunnel< SfxScriptLibraryContainer >( xBasicLibs ) ); + LibraryContainerInfo aInfo( xBasicLibs, xDialogLibs, dynamic_cast< SfxScriptLibraryContainer* >( xBasicLibs.get() ) ); OSL_ENSURE( aInfo.mpOldBasicPassword, "ImplRepository::impl_createManagerForModel: wrong BasicLibraries implementation!" ); _out_rpBasicManager->SetLibraryContainerInfo( aInfo ); diff --git a/basic/source/inc/scriptcont.hxx b/basic/source/inc/scriptcont.hxx index f4886d216fad..2d0e8bcf3232 100644 --- a/basic/source/inc/scriptcont.hxx +++ b/basic/source/inc/scriptcont.hxx @@ -21,18 +21,15 @@ #include "namecont.hxx" #include <basic/basmgr.hxx> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/script/vba/XVBAModuleInfo.hpp> #include <comphelper/uno3.hxx> -#include <cppuhelper/implbase.hxx> #include <cppuhelper/implbase1.hxx> namespace basic { -class SfxScriptLibraryContainer final : - public cppu::ImplInheritanceHelper<SfxLibraryContainer, css::lang::XUnoTunnel> +class SfxScriptLibraryContainer final : public SfxLibraryContainer { css::uno::Reference< css::container::XNameAccess > mxCodeNameAccess; @@ -102,9 +99,6 @@ public: // Library password handling for 5.0 documents void setLibraryPassword( const OUString& rLibraryName, const OUString& rPassword ); - - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); }; diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx index ea69032aa795..eea449ac47fc 100644 --- a/basic/source/uno/scriptcont.cxx +++ b/basic/source/uno/scriptcont.cxx @@ -30,7 +30,6 @@ #include <com/sun/star/task/ErrorCodeIOException.hpp> #include <com/sun/star/script/ModuleType.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <comphelper/servicehelper.hxx> #include <comphelper/storagehelper.hxx> #include <unotools/ucbstreamhelper.hxx> #include <sal/log.hxx> @@ -108,16 +107,6 @@ void SfxScriptLibraryContainer::setLibraryPassword( const OUString& rLibraryName catch(const NoSuchElementException& ) {} } -sal_Int64 SfxScriptLibraryContainer::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) -{ - return comphelper::getSomethingImpl(aIdentifier, this); -} - -css::uno::Sequence<sal_Int8> const & SfxScriptLibraryContainer::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); -} - // Ctor for service SfxScriptLibraryContainer::SfxScriptLibraryContainer() { diff --git a/canvas/inc/parametricpolypolygon.hxx b/canvas/inc/parametricpolypolygon.hxx index ca2e1cda348e..474bd5da247a 100644 --- a/canvas/inc/parametricpolypolygon.hxx +++ b/canvas/inc/parametricpolypolygon.hxx @@ -20,7 +20,6 @@ #pragma once #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/rendering/XParametricPolyPolygon2D.hpp> #include <comphelper/compbase.hxx> #include <basegfx/polygon/b2dpolygon.hxx> @@ -37,8 +36,7 @@ namespace com::sun::star::rendering { class XGraphicDevice; } namespace canvas { typedef comphelper::WeakComponentImplHelper< css::rendering::XParametricPolyPolygon2D, - css::lang::XServiceInfo, - css::lang::XUnoTunnel > ParametricPolyPolygon_Base; + css::lang::XServiceInfo > ParametricPolyPolygon_Base; class CANVASTOOLS_DLLPUBLIC ParametricPolyPolygon final : public ParametricPolyPolygon_Base { @@ -106,9 +104,6 @@ namespace canvas virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - /// Query all defining values of this object atomically Values getValues() const; diff --git a/canvas/source/cairo/cairo_cachedbitmap.cxx b/canvas/source/cairo/cairo_cachedbitmap.cxx index 56ca57c913bc..d829e27ac3b5 100644 --- a/canvas/source/cairo/cairo_cachedbitmap.cxx +++ b/canvas/source/cairo/cairo_cachedbitmap.cxx @@ -23,7 +23,6 @@ #include <com/sun/star/rendering/RepaintResult.hpp> #include <utility> #include <comphelper/diagnose_ex.hxx> -#include <comphelper/servicehelper.hxx> #include "cairo_cachedbitmap.hxx" #include "cairo_repainttarget.hxx" @@ -60,7 +59,7 @@ namespace cairocanvas "CachedBitmap::doRedraw(): base called with changed view transform " "(told otherwise during construction)" ); - RepaintTarget* pTarget = comphelper::getFromUnoTunnel< RepaintTarget >(rTargetCanvas); + RepaintTarget* pTarget = dynamic_cast< RepaintTarget* >(rTargetCanvas.get()); ENSURE_OR_THROW( pTarget, "CachedBitmap::redraw(): cannot cast target to RepaintTarget" ); diff --git a/canvas/source/cairo/cairo_canvas.cxx b/canvas/source/cairo/cairo_canvas.cxx index 255b8d84d80c..60b807e8196b 100644 --- a/canvas/source/cairo/cairo_canvas.cxx +++ b/canvas/source/cairo/cairo_canvas.cxx @@ -24,7 +24,6 @@ #include <com/sun/star/lang/NoSupportException.hpp> #include <osl/mutex.hxx> #include <comphelper/diagnose_ex.hxx> -#include <comphelper/servicehelper.hxx> #include <vcl/sysdata.hxx> #include <vcl/skia/SkiaHelper.hxx> #include <cppuhelper/supportsservice.hxx> @@ -129,12 +128,6 @@ namespace cairocanvas return { getServiceName() }; } - sal_Int64 Canvas::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl_skipDerived( - aIdentifier, this, comphelper::MixinToGetSomethingOf<SurfaceProvider>{}, - comphelper::FallbackToGetSomethingOf<RepaintTarget>{}); - } - bool Canvas::repaint( const SurfaceSharedPtr& pSurface, const rendering::ViewState& viewState, const rendering::RenderState& renderState ) diff --git a/canvas/source/cairo/cairo_canvas.hxx b/canvas/source/cairo/cairo_canvas.hxx index e9b7863b1741..0c41a8a5c0d3 100644 --- a/canvas/source/cairo/cairo_canvas.hxx +++ b/canvas/source/cairo/cairo_canvas.hxx @@ -50,8 +50,7 @@ namespace cairocanvas css::util::XUpdatable, css::beans::XPropertySet, css::lang::XServiceName, - css::lang::XServiceInfo, - css::lang::XUnoTunnel > GraphicDeviceBase_Base; + css::lang::XServiceInfo > GraphicDeviceBase_Base; typedef ::canvas::GraphicDeviceBase< ::canvas::BaseMutexHelper< GraphicDeviceBase_Base >, DeviceHelper, ::osl::MutexGuard, @@ -123,9 +122,6 @@ namespace cairocanvas virtual OUString SAL_CALL getImplementationName() override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - // XUnoTunnel - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - // RepaintTarget virtual bool repaint( const ::cairo::SurfaceSharedPtr& pSurface, const css::rendering::ViewState& viewState, diff --git a/canvas/source/cairo/cairo_canvasbitmap.cxx b/canvas/source/cairo/cairo_canvasbitmap.cxx index 30ccb2cda8e8..ebf4f26c5321 100644 --- a/canvas/source/cairo/cairo_canvasbitmap.cxx +++ b/canvas/source/cairo/cairo_canvasbitmap.cxx @@ -143,17 +143,6 @@ namespace cairocanvas return aRV; } - sal_Int64 CanvasBitmap::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl( - aIdentifier, this, comphelper::MixinToGetSomethingOf<SurfaceProvider>{}, - comphelper::FallbackToGetSomethingOf<RepaintTarget>{}); - } - - css::uno::Sequence<sal_Int8> const & CanvasBitmap::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); - } - OUString SAL_CALL CanvasBitmap::getImplementationName( ) { return "CairoCanvas.CanvasBitmap"; diff --git a/canvas/source/cairo/cairo_canvasbitmap.hxx b/canvas/source/cairo/cairo_canvasbitmap.hxx index 21479b387069..8826bc82ebe2 100644 --- a/canvas/source/cairo/cairo_canvasbitmap.hxx +++ b/canvas/source/cairo/cairo_canvasbitmap.hxx @@ -22,7 +22,6 @@ #include <cppuhelper/compbase.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/rendering/XBitmapCanvas.hpp> #include <com/sun/star/rendering/XIntegerBitmap.hpp> #include <com/sun/star/beans/XFastPropertySet.hpp> @@ -43,8 +42,7 @@ namespace cairocanvas typedef ::cppu::WeakComponentImplHelper< css::rendering::XBitmapCanvas, css::rendering::XIntegerBitmap, css::lang::XServiceInfo, - css::beans::XFastPropertySet, - css::lang::XUnoTunnel> CanvasBitmapBase_Base; + css::beans::XFastPropertySet > CanvasBitmapBase_Base; class CanvasBitmapSpriteSurface_Base : public ::canvas::BaseMutexHelper<CanvasBitmapBase_Base>, public SurfaceProvider @@ -115,9 +113,6 @@ namespace cairocanvas virtual css::uno::Any SAL_CALL getFastPropertyValue(sal_Int32 nHandle) override; virtual void SAL_CALL setFastPropertyValue(sal_Int32, const css::uno::Any&) override {} - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - private: SurfaceProviderRef mpSurfaceProvider; ::cairo::SurfaceSharedPtr mpBufferSurface; diff --git a/canvas/source/cairo/cairo_canvascustomsprite.cxx b/canvas/source/cairo/cairo_canvascustomsprite.cxx index e5f22e9c4a9c..f7fffb6e50be 100644 --- a/canvas/source/cairo/cairo_canvascustomsprite.cxx +++ b/canvas/source/cairo/cairo_canvascustomsprite.cxx @@ -146,12 +146,6 @@ namespace cairocanvas { return { "com.sun.star.rendering.CanvasCustomSprite" }; } - - sal_Int64 CanvasCustomSprite::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl_skipDerived( - aIdentifier, this, comphelper::MixinToGetSomethingOf<SurfaceProvider>{}, - comphelper::FallbackToGetSomethingOf<RepaintTarget>{}); - } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/canvas/source/cairo/cairo_canvascustomsprite.hxx b/canvas/source/cairo/cairo_canvascustomsprite.hxx index 03890bf1985d..ffe766ab0966 100644 --- a/canvas/source/cairo/cairo_canvascustomsprite.hxx +++ b/canvas/source/cairo/cairo_canvascustomsprite.hxx @@ -23,7 +23,6 @@ #include <comphelper/uno3.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/rendering/XBitmapCanvas.hpp> #include <com/sun/star/rendering/XCustomSprite.hpp> #include <com/sun/star/rendering/XIntegerBitmap.hpp> @@ -47,8 +46,7 @@ namespace cairocanvas typedef ::cppu::WeakComponentImplHelper< css::rendering::XCustomSprite, css::rendering::XBitmapCanvas, css::rendering::XIntegerBitmap, - css::lang::XServiceInfo, - css::lang::XUnoTunnel > CanvasCustomSpriteBase_Base; + css::lang::XServiceInfo > CanvasCustomSpriteBase_Base; /** Mixin Sprite Have to mixin the Sprite interface before deriving from @@ -115,9 +113,6 @@ namespace cairocanvas virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - // XUnoTunnel - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - // Sprite virtual void redraw( const ::cairo::CairoSharedPtr& pCairo, bool bBufferedUpdate ) const override; diff --git a/canvas/source/cairo/cairo_canvasfont.cxx b/canvas/source/cairo/cairo_canvasfont.cxx index 9c660a5c4c6e..36c1733ef62a 100644 --- a/canvas/source/cairo/cairo_canvasfont.cxx +++ b/canvas/source/cairo/cairo_canvasfont.cxx @@ -21,7 +21,6 @@ #include <basegfx/numeric/ftools.hxx> #include <com/sun/star/rendering/PanoseProportion.hpp> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <i18nlangtag/languagetag.hxx> #include <rtl/math.hxx> @@ -148,15 +147,6 @@ namespace cairocanvas return { "com.sun.star.rendering.CanvasFont" }; } - sal_Int64 CanvasFont::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl(aIdentifier, this); - } - - css::uno::Sequence<sal_Int8> const & CanvasFont::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); - } - vcl::Font const & CanvasFont::getVCLFont() const { return *maFont; diff --git a/canvas/source/cairo/cairo_canvasfont.hxx b/canvas/source/cairo/cairo_canvasfont.hxx index 3bb03847c3ce..0ebe9acd81ce 100644 --- a/canvas/source/cairo/cairo_canvasfont.hxx +++ b/canvas/source/cairo/cairo_canvasfont.hxx @@ -23,7 +23,6 @@ #include <cppuhelper/basemutex.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/geometry/Matrix2D.hpp> #include <com/sun/star/rendering/FontRequest.hpp> #include <com/sun/star/rendering/XCanvasFont.hpp> @@ -40,8 +39,7 @@ namespace cairocanvas { typedef ::cppu::WeakComponentImplHelper< css::rendering::XCanvasFont, - css::lang::XServiceInfo, - css::lang::XUnoTunnel > CanvasFont_Base; + css::lang::XServiceInfo > CanvasFont_Base; class CanvasFont : public ::cppu::BaseMutex, public CanvasFont_Base @@ -72,9 +70,6 @@ namespace cairocanvas virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - vcl::Font const & getVCLFont() const; private: diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx index 89a7ac65fd07..14113e89361f 100644 --- a/canvas/source/cairo/cairo_canvashelper.cxx +++ b/canvas/source/cairo/cairo_canvashelper.cxx @@ -29,7 +29,6 @@ #include <basegfx/utils/canvastools.hxx> #include <basegfx/utils/keystoplerp.hxx> #include <basegfx/utils/lerp.hxx> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/rendering/ColorComponentTag.hpp> #include <com/sun/star/rendering/ColorSpaceType.hpp> #include <com/sun/star/rendering/CompositeOperation.hpp> @@ -41,7 +40,6 @@ #include <com/sun/star/rendering/XIntegerBitmapColorSpace.hpp> #include <com/sun/star/util/Endianness.hpp> #include <comphelper/sequence.hxx> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/implbase.hxx> #include <rtl/math.hxx> #include <comphelper/diagnose_ex.hxx> @@ -296,12 +294,11 @@ constexpr OUStringLiteral PARAMETRICPOLYPOLYGON_IMPLEMENTATION_NAME = u"Canvas:: **/ static SurfaceSharedPtr surfaceFromXBitmap( const uno::Reference< rendering::XBitmap >& xBitmap ) { - CanvasBitmap* pBitmapImpl = comphelper::getFromUnoTunnel< CanvasBitmap >( xBitmap ); + CanvasBitmap* pBitmapImpl = dynamic_cast< CanvasBitmap* >( xBitmap.get() ); if( pBitmapImpl ) return pBitmapImpl->getSurface(); - SurfaceProvider* pSurfaceProvider - = comphelper::getFromUnoTunnel<SurfaceProvider>( xBitmap ); + SurfaceProvider* pSurfaceProvider = dynamic_cast<SurfaceProvider*>( xBitmap.get() ); if( pSurfaceProvider ) return pSurfaceProvider->getSurface(); @@ -1342,7 +1339,7 @@ constexpr OUStringLiteral PARAMETRICPOLYPOLYGON_IMPLEMENTATION_NAME = u"Canvas:: namespace { - class CairoColorSpace : public cppu::WeakImplHelper< css::rendering::XIntegerBitmapColorSpace, css::lang::XUnoTunnel > + class CairoColorSpace : public cppu::WeakImplHelper< css::rendering::XIntegerBitmapColorSpace > { private: uno::Sequence< sal_Int8 > maComponentTags; @@ -1500,7 +1497,7 @@ constexpr OUStringLiteral PARAMETRICPOLYPOLYGON_IMPLEMENTATION_NAME = u"Canvas:: virtual uno::Sequence<double> SAL_CALL convertFromIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor, const uno::Reference< rendering::XColorSpace >& targetColorSpace ) override { - if( comphelper::getFromUnoTunnel<CairoColorSpace>(targetColorSpace) ) + if( dynamic_cast<CairoColorSpace*>(targetColorSpace.get()) ) { const sal_Int8* pIn( deviceColor.getConstArray() ); const std::size_t nLen( deviceColor.getLength() ); @@ -1531,7 +1528,7 @@ constexpr OUStringLiteral PARAMETRICPOLYPOLYGON_IMPLEMENTATION_NAME = u"Canvas:: virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertToIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor, const uno::Reference< rendering::XIntegerBitmapColorSpace >& targetColorSpace ) override { - if( comphelper::getFromUnoTunnel<CairoColorSpace>(targetColorSpace) ) + if( dynamic_cast<CairoColorSpace*>(targetColorSpace.get()) ) { // it's us, so simply pass-through the data return deviceColor; @@ -1688,17 +1685,6 @@ constexpr OUStringLiteral PARAMETRICPOLYPOLYGON_IMPLEMENTATION_NAME = u"Canvas:: pBitCounts[2] = pBitCounts[3] = 8; } - - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) - override - { - return comphelper::getSomethingImpl(aIdentifier, this); - } - - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); - } }; class CairoNoAlphaColorSpace : public cppu::WeakImplHelper< css::rendering::XIntegerBitmapColorSpace > @@ -1833,7 +1819,7 @@ constexpr OUStringLiteral PARAMETRICPOLYPOLYGON_IMPLEMENTATION_NAME = u"Canvas:: virtual uno::Sequence<double> SAL_CALL convertFromIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor, const uno::Reference< rendering::XColorSpace >& targetColorSpace ) override { - if( comphelper::getFromUnoTunnel<CairoColorSpace>(targetColorSpace) ) + if( dynamic_cast<CairoColorSpace*>(targetColorSpace.get()) ) { const sal_Int8* pIn( deviceColor.getConstArray() ); const std::size_t nLen( deviceColor.getLength() ); diff --git a/canvas/source/cairo/cairo_canvashelper_text.cxx b/canvas/source/cairo/cairo_canvashelper_text.cxx index 982c16c24377..6973607d4824 100644 --- a/canvas/source/cairo/cairo_canvashelper_text.cxx +++ b/canvas/source/cairo/cairo_canvashelper_text.cxx @@ -24,7 +24,6 @@ #include <rtl/math.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <comphelper/diagnose_ex.hxx> -#include <comphelper/servicehelper.hxx> #include <vcl/canvastools.hxx> #include <vcl/metric.hxx> #include <vcl/virdev.hxx> @@ -173,7 +172,7 @@ namespace cairocanvas { setupOutDevState( rOutDev, pOwner, viewState, renderState ); - CanvasFont* pFont = comphelper::getFromUnoTunnel< CanvasFont >( xFont ); + CanvasFont* pFont = dynamic_cast< CanvasFont* >( xFont.get() ); ENSURE_ARG_OR_THROW( pFont, "CanvasHelper::setupTextOutput(): Font not compatible with this canvas" ); @@ -248,7 +247,7 @@ namespace cairocanvas // TODO(F2): alpha mpVirtualDevice->SetLayoutMode( nLayoutMode ); - rtl::Reference pTextLayout( new TextLayout(text, textDirection, 0, CanvasFont::Reference(comphelper::getFromUnoTunnel< CanvasFont >( xFont )), mpSurfaceProvider) ); + rtl::Reference pTextLayout( new TextLayout(text, textDirection, 0, CanvasFont::Reference(dynamic_cast< CanvasFont* >( xFont.get() )), mpSurfaceProvider) ); pTextLayout->draw(*mpVirtualDevice, aOutpos, viewState, renderState); } @@ -263,7 +262,7 @@ namespace cairocanvas ENSURE_ARG_OR_THROW( xLayoutedText.is(), "CanvasHelper::drawTextLayout(): layout is NULL"); - TextLayout* pTextLayout = comphelper::getFromUnoTunnel< TextLayout >( xLayoutedText ); + TextLayout* pTextLayout = dynamic_cast< TextLayout* >( xLayoutedText.get() ); if( pTextLayout ) { diff --git a/canvas/source/cairo/cairo_repainttarget.hxx b/canvas/source/cairo/cairo_repainttarget.hxx index 3fab51dbc3bb..94d3d3845b3e 100644 --- a/canvas/source/cairo/cairo_repainttarget.hxx +++ b/canvas/source/cairo/cairo_repainttarget.hxx @@ -21,9 +21,6 @@ #include <com/sun/star/rendering/RenderState.hpp> #include <com/sun/star/rendering/ViewState.hpp> -#include <com/sun/star/uno/Sequence.hxx> -#include <comphelper/servicehelper.hxx> -#include <sal/types.h> #include <vcl/cairo.hxx> @@ -36,7 +33,7 @@ namespace cairocanvas This interface must be implemented on all canvas implementations that hand out XCachedPrimitives */ - class RepaintTarget + class SAL_LOPLUGIN_ANNOTATE("crosscast") RepaintTarget { public: virtual ~RepaintTarget() {} @@ -45,15 +42,6 @@ namespace cairocanvas virtual bool repaint( const ::cairo::SurfaceSharedPtr& pSurface, const css::rendering::ViewState& viewState, const css::rendering::RenderState& renderState ) = 0; - - sal_Int64 getSomething(css::uno::Sequence<sal_Int8> const & id) { - return comphelper::getSomethingImpl(id, this); - } - - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); - } }; } diff --git a/canvas/source/cairo/cairo_spritecanvas.cxx b/canvas/source/cairo/cairo_spritecanvas.cxx index 2d33d4a14c7a..5a394d2718aa 100644 --- a/canvas/source/cairo/cairo_spritecanvas.cxx +++ b/canvas/source/cairo/cairo_spritecanvas.cxx @@ -151,12 +151,6 @@ namespace cairocanvas return { getServiceName() }; } - sal_Int64 SpriteCanvas::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl_skipDerived( - aIdentifier, this, comphelper::MixinToGetSomethingOf<SurfaceProvider>{}, - comphelper::FallbackToGetSomethingOf<RepaintTarget>{}); - } - SurfaceSharedPtr SpriteCanvas::getSurface() { return maDeviceHelper.getBufferSurface(); diff --git a/canvas/source/cairo/cairo_spritecanvas.hxx b/canvas/source/cairo/cairo_spritecanvas.hxx index 41a1c5cb24d5..7790e68904b0 100644 --- a/canvas/source/cairo/cairo_spritecanvas.hxx +++ b/canvas/source/cairo/cairo_spritecanvas.hxx @@ -23,7 +23,6 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/lang/XServiceName.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/awt/XWindowListener.hpp> #include <com/sun/star/util/XUpdatable.hpp> #include <com/sun/star/rendering/XSpriteCanvas.hpp> @@ -55,8 +54,7 @@ namespace cairocanvas css::util::XUpdatable, css::beans::XPropertySet, css::lang::XServiceName, - css::lang::XServiceInfo, - css::lang::XUnoTunnel > WindowGraphicDeviceBase_Base; + css::lang::XServiceInfo > WindowGraphicDeviceBase_Base; typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::DisambiguationHelper< WindowGraphicDeviceBase_Base >, SpriteDeviceHelper, ::osl::MutexGuard, @@ -132,9 +130,6 @@ namespace cairocanvas virtual OUString SAL_CALL getImplementationName() override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - // XUnoTunnel - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - // SurfaceProvider virtual ::cairo::SurfaceSharedPtr getSurface() override; virtual ::cairo::SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize, int aContent ) override; diff --git a/canvas/source/cairo/cairo_surfaceprovider.hxx b/canvas/source/cairo/cairo_surfaceprovider.hxx index e0293373451f..1ff6f2aa7d3f 100644 --- a/canvas/source/cairo/cairo_surfaceprovider.hxx +++ b/canvas/source/cairo/cairo_surfaceprovider.hxx @@ -20,10 +20,7 @@ #pragma once #include <rtl/ref.hxx> -#include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/uno/XInterface.hpp> -#include <comphelper/servicehelper.hxx> -#include <sal/types.h> #include <basegfx/vector/b2isize.hxx> #include <vcl/cairo.hxx> @@ -40,7 +37,7 @@ namespace cairocanvas This interface must be implemented on all canvas implementations that hand out XCachedPrimitives */ - class SurfaceProvider : public css::uno::XInterface + class SAL_LOPLUGIN_ANNOTATE("crosscast") SurfaceProvider : public css::uno::XInterface { public: virtual ~SurfaceProvider() {} @@ -65,15 +62,6 @@ namespace cairocanvas /** Provides the underlying vcl outputdevice this surface renders on */ virtual OutputDevice* getOutputDevice() = 0; - - sal_Int64 getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl(aIdentifier, this); - } - - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); - } }; typedef ::rtl::Reference< SurfaceProvider > SurfaceProviderRef; diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx index 4324aad832bb..1a6f0143a60a 100644 --- a/canvas/source/cairo/cairo_textlayout.cxx +++ b/canvas/source/cairo/cairo_textlayout.cxx @@ -28,7 +28,6 @@ #include <basegfx/numeric/ftools.hxx> #include <cppuhelper/supportsservice.hxx> #include <comphelper/diagnose_ex.hxx> -#include <comphelper/servicehelper.hxx> #include <utility> #include <vcl/kernarray.hxx> #include <vcl/metric.hxx> @@ -345,15 +344,6 @@ namespace cairocanvas { return { "com.sun.star.rendering.TextLayout" }; } - - sal_Int64 TextLayout::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl(aIdentifier, this); - } - - css::uno::Sequence<sal_Int8> const & TextLayout::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); - } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/canvas/source/cairo/cairo_textlayout.hxx b/canvas/source/cairo/cairo_textlayout.hxx index c2a85ceab72a..bec692e75707 100644 --- a/canvas/source/cairo/cairo_textlayout.hxx +++ b/canvas/source/cairo/cairo_textlayout.hxx @@ -23,7 +23,6 @@ #include <cppuhelper/basemutex.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/rendering/RenderState.hpp> #include <com/sun/star/rendering/ViewState.hpp> #include <com/sun/star/rendering/XTextLayout.hpp> @@ -38,8 +37,7 @@ namespace cairocanvas { typedef ::cppu::WeakComponentImplHelper< css::rendering::XTextLayout, - css::lang::XServiceInfo, - css::lang::XUnoTunnel > TextLayout_Base; + css::lang::XServiceInfo > TextLayout_Base; class TextLayout : public ::cppu::BaseMutex, public TextLayout_Base @@ -82,9 +80,6 @@ namespace cairocanvas virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - void draw( OutputDevice& rOutDev, const Point& rOutpos, const css::rendering::ViewState& viewState, diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx index 28337013e965..1b84879b005c 100644 --- a/canvas/source/opengl/ogl_canvashelper.cxx +++ b/canvas/source/opengl/ogl_canvashelper.cxx @@ -21,7 +21,6 @@ #include <rtl/crc.h> #include <rtl/math.hxx> #include <comphelper/diagnose_ex.hxx> -#include <comphelper/servicehelper.hxx> #include <vcl/font.hxx> #include <vcl/kernarray.hxx> #include <vcl/metric.hxx> @@ -554,7 +553,7 @@ namespace oglcanvas // try to cast XParametricPolyPolygon2D reference to // our implementation class. ::canvas::ParametricPolyPolygon* pGradient = - comphelper::getFromUnoTunnel< ::canvas::ParametricPolyPolygon >( textures[0].Gradient ); + dynamic_cast< ::canvas::ParametricPolyPolygon* >( textures[0].Gradient.get() ); if( pGradient ) { diff --git a/canvas/source/tools/canvastools.cxx b/canvas/source/tools/canvastools.cxx index aa9e7ac6ab97..1ff393005758 100644 --- a/canvas/source/tools/canvastools.cxx +++ b/canvas/source/tools/canvastools.cxx @@ -39,7 +39,6 @@ #include <com/sun/star/geometry/AffineMatrix2D.hpp> #include <com/sun/star/geometry/Matrix2D.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/rendering/ColorComponentTag.hpp> #include <com/sun/star/rendering/ColorSpaceType.hpp> #include <com/sun/star/rendering/CompositeOperation.hpp> @@ -55,7 +54,6 @@ #include <sal/log.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <comphelper/diagnose_ex.hxx> -#include <comphelper/servicehelper.hxx> #include <vcl/canvastools.hxx> #include <vcl/window.hxx> @@ -178,7 +176,7 @@ namespace canvas::tools namespace { - class StandardColorSpace : public cppu::WeakImplHelper< css::rendering::XIntegerBitmapColorSpace, css::lang::XUnoTunnel > + class StandardColorSpace : public cppu::WeakImplHelper< css::rendering::XIntegerBitmapColorSpace > { private: uno::Sequence< sal_Int8 > maComponentTags; @@ -329,7 +327,7 @@ namespace canvas::tools virtual uno::Sequence<double> SAL_CALL convertFromIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor, const uno::Reference< rendering::XColorSpace >& targetColorSpace ) override { - if( comphelper::getFromUnoTunnel<StandardColorSpace>(targetColorSpace) ) + if( dynamic_cast<StandardColorSpace*>(targetColorSpace.get()) ) { const sal_Int8* pIn( deviceColor.getConstArray() ); const std::size_t nLen( deviceColor.getLength() ); @@ -360,7 +358,7 @@ namespace canvas::tools virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertToIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor, const uno::Reference< rendering::XIntegerBitmapColorSpace >& targetColorSpace ) override { - if( comphelper::getFromUnoTunnel<StandardColorSpace>(targetColorSpace) ) + if( dynamic_cast<StandardColorSpace*>(targetColorSpace.get()) ) { // it's us, so simply pass-through the data return deviceColor; @@ -511,20 +509,9 @@ namespace canvas::tools pBitCounts[2] = pBitCounts[3] = 8; } - - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) - override - { - return comphelper::getSomethingImpl(aIdentifier, this); - } - - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); - } }; - class StandardNoAlphaColorSpace : public cppu::WeakImplHelper< css::rendering::XIntegerBitmapColorSpace, css::lang::XUnoTunnel > + class StandardNoAlphaColorSpace : public cppu::WeakImplHelper< css::rendering::XIntegerBitmapColorSpace > { private: uno::Sequence< sal_Int8 > maComponentTags; @@ -674,7 +661,7 @@ namespace canvas::tools virtual uno::Sequence<double> SAL_CALL convertFromIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor, const uno::Reference< rendering::XColorSpace >& targetColorSpace ) override { - if( comphelper::getFromUnoTunnel<StandardNoAlphaColorSpace>(targetColorSpace) ) + if( dynamic_cast<StandardNoAlphaColorSpace*>(targetColorSpace.get()) ) { const sal_Int8* pIn( deviceColor.getConstArray() ); const std::size_t nLen( deviceColor.getLength() ); @@ -705,7 +692,7 @@ namespace canvas::tools virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertToIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor, const uno::Reference< rendering::XIntegerBitmapColorSpace >& targetColorSpace ) override { - if( comphelper::getFromUnoTunnel<StandardNoAlphaColorSpace>(targetColorSpace) ) + if( dynamic_cast<StandardNoAlphaColorSpace*>(targetColorSpace.get()) ) { // it's us, so simply pass-through the data return deviceColor; @@ -853,17 +840,6 @@ namespace canvas::tools pBitCounts[1] = pBitCounts[2] = 8; } - - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) - override - { - return comphelper::getSomethingImpl(aIdentifier, this); - } - - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); - } }; } diff --git a/canvas/source/tools/parametricpolypolygon.cxx b/canvas/source/tools/parametricpolypolygon.cxx index 00b6c4da2850..acad3b58b7d6 100644 --- a/canvas/source/tools/parametricpolypolygon.cxx +++ b/canvas/source/tools/parametricpolypolygon.cxx @@ -22,7 +22,6 @@ #include <basegfx/point/b2dpoint.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/range/b2drectangle.hxx> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <com/sun/star/rendering/XGraphicDevice.hpp> @@ -195,16 +194,6 @@ namespace canvas return { "com.sun.star.rendering.ParametricPolyPolygon" }; } - sal_Int64 ParametricPolyPolygon::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) - { - return comphelper::getSomethingImpl(aIdentifier, this); - } - - css::uno::Sequence<sal_Int8> const & ParametricPolyPolygon::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); - } - ParametricPolyPolygon::~ParametricPolyPolygon() { } diff --git a/canvas/source/vcl/cachedbitmap.cxx b/canvas/source/vcl/cachedbitmap.cxx index 2364c073e1fa..60b5f7986c55 100644 --- a/canvas/source/vcl/cachedbitmap.cxx +++ b/canvas/source/vcl/cachedbitmap.cxx @@ -23,7 +23,6 @@ #include <com/sun/star/rendering/RepaintResult.hpp> #include <utility> #include <comphelper/diagnose_ex.hxx> -#include <comphelper/servicehelper.hxx> #include "cachedbitmap.hxx" #include "repainttarget.hxx" @@ -71,7 +70,7 @@ namespace vclcanvas if( rNewState.Clip != rOldState.Clip ) return rendering::RepaintResult::FAILED; - RepaintTarget* pTarget = comphelper::getFromUnoTunnel< RepaintTarget >(rTargetCanvas); + RepaintTarget* pTarget = dynamic_cast< RepaintTarget* >(rTargetCanvas.get()); ENSURE_OR_THROW( pTarget, "CachedBitmap::redraw(): cannot cast target to RepaintTarget" ); diff --git a/canvas/source/vcl/canvas.cxx b/canvas/source/vcl/canvas.cxx index 2f6b513f35a0..7e38276e06d3 100644 --- a/canvas/source/vcl/canvas.cxx +++ b/canvas/source/vcl/canvas.cxx @@ -96,10 +96,6 @@ namespace vclcanvas return "com.sun.star.rendering.Canvas.VCL"; } - sal_Int64 Canvas::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return RepaintTarget::getSomething(aIdentifier); - } - bool Canvas::repaint( const GraphicObjectSharedPtr& rGrf, const rendering::ViewState& viewState, const rendering::RenderState& renderState, diff --git a/canvas/source/vcl/canvas.hxx b/canvas/source/vcl/canvas.hxx index c01b8ccfcca4..be7d7858e3ad 100644 --- a/canvas/source/vcl/canvas.hxx +++ b/canvas/source/vcl/canvas.hxx @@ -22,7 +22,6 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/lang/XServiceName.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/util/XUpdatable.hpp> #include <com/sun/star/rendering/XBitmapCanvas.hpp> #include <com/sun/star/rendering/XIntegerBitmap.hpp> @@ -49,8 +48,7 @@ namespace vclcanvas css::lang::XMultiServiceFactory, css::util::XUpdatable, css::beans::XPropertySet, - css::lang::XServiceName, - css::lang::XUnoTunnel> GraphicDeviceBase_Base; + css::lang::XServiceName > GraphicDeviceBase_Base; typedef ::canvas::GraphicDeviceBase< ::canvas::BaseMutexHelper< GraphicDeviceBase_Base >, DeviceHelper, tools::LocalGuard, @@ -98,9 +96,6 @@ namespace vclcanvas // XServiceName virtual OUString SAL_CALL getServiceName( ) override; - // XUnoTunnel - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - // RepaintTarget virtual bool repaint( const GraphicObjectSharedPtr& rGrf, const css::rendering::ViewState& viewState, diff --git a/canvas/source/vcl/canvasbitmap.cxx b/canvas/source/vcl/canvasbitmap.cxx index 5a913836ebe7..9ae37c2c495a 100644 --- a/canvas/source/vcl/canvasbitmap.cxx +++ b/canvas/source/vcl/canvasbitmap.cxx @@ -19,7 +19,6 @@ #include <sal/config.h> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include "canvasbitmap.hxx" @@ -85,11 +84,6 @@ namespace vclcanvas return { "com.sun.star.rendering.CanvasBitmap" }; } - sal_Int64 CanvasBitmap::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl( - aIdentifier, this, comphelper::FallbackToGetSomethingOf<RepaintTarget>{}); - } - BitmapEx CanvasBitmap::getBitmap() const { SolarMutexGuard aGuard; diff --git a/canvas/source/vcl/canvasbitmap.hxx b/canvas/source/vcl/canvasbitmap.hxx index 4e64c8b2b6c6..1a95ce8c632c 100644 --- a/canvas/source/vcl/canvasbitmap.hxx +++ b/canvas/source/vcl/canvasbitmap.hxx @@ -22,7 +22,6 @@ #include <cppuhelper/compbase.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/rendering/XBitmapCanvas.hpp> #include <com/sun/star/rendering/XIntegerBitmap.hpp> #include <com/sun/star/beans/XFastPropertySet.hpp> @@ -45,8 +44,7 @@ namespace vclcanvas typedef ::cppu::WeakComponentImplHelper< css::rendering::XBitmapCanvas, css::rendering::XIntegerBitmap, css::lang::XServiceInfo, - css::beans::XFastPropertySet, - css::lang::XUnoTunnel> CanvasBitmapBase_Base; + css::beans::XFastPropertySet > CanvasBitmapBase_Base; typedef ::canvas::IntegerBitmapBase< canvas::BitmapCanvasBase2< ::canvas::BaseMutexHelper< CanvasBitmapBase_Base >, @@ -84,9 +82,6 @@ namespace vclcanvas virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; - // XUnoTunnel - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - // RepaintTarget interface virtual bool repaint( const GraphicObjectSharedPtr& rGrf, const css::rendering::ViewState& viewState, diff --git a/canvas/source/vcl/canvascustomsprite.cxx b/canvas/source/vcl/canvascustomsprite.cxx index 58112d1955a3..02e9b47fb233 100644 --- a/canvas/source/vcl/canvascustomsprite.cxx +++ b/canvas/source/vcl/canvascustomsprite.cxx @@ -116,10 +116,6 @@ namespace vclcanvas return { "com.sun.star.rendering.CanvasCustomSprite" }; } - sal_Int64 CanvasCustomSprite::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return RepaintTarget::getSomething(aIdentifier); - } - // Sprite void CanvasCustomSprite::redraw( OutputDevice& rOutDev, bool bBufferedUpdate ) const diff --git a/canvas/source/vcl/canvascustomsprite.hxx b/canvas/source/vcl/canvascustomsprite.hxx index 6fca0800f0c1..1a7d3ccfb69e 100644 --- a/canvas/source/vcl/canvascustomsprite.hxx +++ b/canvas/source/vcl/canvascustomsprite.hxx @@ -23,7 +23,6 @@ #include <comphelper/uno3.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/rendering/XBitmapCanvas.hpp> #include <com/sun/star/rendering/XCustomSprite.hpp> #include <com/sun/star/rendering/XIntegerBitmap.hpp> @@ -44,8 +43,7 @@ namespace vclcanvas typedef ::cppu::WeakComponentImplHelper< css::rendering::XCustomSprite, css::rendering::XBitmapCanvas, css::rendering::XIntegerBitmap, - css::lang::XServiceInfo, - css::lang::XUnoTunnel> CanvasCustomSpriteBase_Base; + css::lang::XServiceInfo > CanvasCustomSpriteBase_Base; /** Mixin Sprite Have to mixin the Sprite interface before deriving from @@ -98,9 +96,6 @@ namespace vclcanvas virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - // XUnoTunnel - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - // Sprite virtual void redraw( OutputDevice& rOutDev, bool bBufferedUpdate ) const override; diff --git a/canvas/source/vcl/canvasfont.cxx b/canvas/source/vcl/canvasfont.cxx index 0f342de0785a..e7fab0492549 100644 --- a/canvas/source/vcl/canvasfont.cxx +++ b/canvas/source/vcl/canvasfont.cxx @@ -22,7 +22,6 @@ #include <basegfx/numeric/ftools.hxx> #include <canvas/canvastools.hxx> #include <com/sun/star/rendering/PanoseProportion.hpp> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <i18nlangtag/languagetag.hxx> #include <rtl/math.hxx> @@ -169,15 +168,6 @@ namespace vclcanvas return { "com.sun.star.rendering.CanvasFont" }; } - sal_Int64 CanvasFont::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl(aIdentifier, this); - } - - css::uno::Sequence<sal_Int8> const & CanvasFont::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); - } - vcl::Font const & CanvasFont::getVCLFont() const { return *maFont; diff --git a/canvas/source/vcl/canvasfont.hxx b/canvas/source/vcl/canvasfont.hxx index a4fd9fb0bc3e..fdfa870f5ed3 100644 --- a/canvas/source/vcl/canvasfont.hxx +++ b/canvas/source/vcl/canvasfont.hxx @@ -23,7 +23,6 @@ #include <cppuhelper/basemutex.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/geometry/Matrix2D.hpp> #include <com/sun/star/rendering/FontRequest.hpp> #include <com/sun/star/rendering/XCanvasFont.hpp> @@ -41,8 +40,7 @@ namespace vclcanvas { typedef ::cppu::WeakComponentImplHelper< css::rendering::XCanvasFont, - css::lang::XServiceInfo, - css::lang::XUnoTunnel > CanvasFont_Base; + css::lang::XServiceInfo > CanvasFont_Base; class CanvasFont : public ::cppu::BaseMutex, public CanvasFont_Base @@ -75,9 +73,6 @@ namespace vclcanvas virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - vcl::Font const & getVCLFont() const; private: diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx index 9ad9716dde1d..cbbd18a376d9 100644 --- a/canvas/source/vcl/canvashelper.cxx +++ b/canvas/source/vcl/canvashelper.cxx @@ -34,7 +34,6 @@ #include <com/sun/star/rendering/PathJoinType.hpp> #include <com/sun/star/rendering/TextDirection.hpp> #include <comphelper/sequence.hxx> -#include <comphelper/servicehelper.hxx> #include <rtl/math.hxx> #include <comphelper/diagnose_ex.hxx> #include <tools/poly.hxx> @@ -613,7 +612,7 @@ namespace vclcanvas ENSURE_ARG_OR_THROW( xLayoutedText.is(), "layout is NULL"); - TextLayout* pTextLayout = comphelper::getFromUnoTunnel< TextLayout >( xLayoutedText ); + TextLayout* pTextLayout = dynamic_cast< TextLayout* >( xLayoutedText.get() ); if( pTextLayout ) { @@ -1112,7 +1111,7 @@ namespace vclcanvas setupOutDevState( viewState, renderState, TEXT_COLOR ); - CanvasFont* pFont = comphelper::getFromUnoTunnel< CanvasFont >( xFont ); + CanvasFont* pFont = dynamic_cast< CanvasFont* >( xFont.get() ); ENSURE_ARG_OR_THROW( pFont, "Font not compatible with this canvas" ); diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx index 02f9f733bdd3..211592685204 100644 --- a/canvas/source/vcl/canvashelper_texturefill.cxx +++ b/canvas/source/vcl/canvashelper_texturefill.cxx @@ -35,7 +35,6 @@ #include <com/sun/star/rendering/TexturingMode.hpp> #include <rtl/math.hxx> #include <comphelper/diagnose_ex.hxx> -#include <comphelper/servicehelper.hxx> #include <tools/poly.hxx> #include <vcl/bitmapex.hxx> #include <vcl/canvastools.hxx> @@ -638,7 +637,7 @@ namespace vclcanvas // try to cast XParametricPolyPolygon2D reference to // our implementation class. ::canvas::ParametricPolyPolygon* pGradient = - comphelper::getFromUnoTunnel< ::canvas::ParametricPolyPolygon >( textures[0].Gradient ); + dynamic_cast< ::canvas::ParametricPolyPolygon* >( textures[0].Gradient.get() ); if( pGradient && pGradient->getValues().maColors.hasElements() ) { diff --git a/canvas/source/vcl/impltools.cxx b/canvas/source/vcl/impltools.cxx index 04209f94ac47..5539a92d1734 100644 --- a/canvas/source/vcl/impltools.cxx +++ b/canvas/source/vcl/impltools.cxx @@ -28,7 +28,6 @@ #include <basegfx/tuple/b2dtuple.hxx> #include <rtl/math.hxx> #include <comphelper/diagnose_ex.hxx> -#include <comphelper/servicehelper.hxx> #include <sal/log.hxx> #include <vcl/bitmapex.hxx> #include <vcl/canvastools.hxx> @@ -51,7 +50,7 @@ namespace vclcanvas::tools { // TODO(F3): CanvasCustomSprite should also be tunnelled // through (also implements XIntegerBitmap interface) - CanvasBitmap* pBitmapImpl = comphelper::getFromUnoTunnel< CanvasBitmap >( xBitmap ); + CanvasBitmap* pBitmapImpl = dynamic_cast< CanvasBitmap* >( xBitmap.get() ); if( pBitmapImpl ) { diff --git a/canvas/source/vcl/repainttarget.hxx b/canvas/source/vcl/repainttarget.hxx index 3ef832fb3426..b8bac4ab9210 100644 --- a/canvas/source/vcl/repainttarget.hxx +++ b/canvas/source/vcl/repainttarget.hxx @@ -19,10 +19,6 @@ #pragma once -#include <com/sun/star/uno/Sequence.hxx> -#include <comphelper/servicehelper.hxx> -#include <sal/types.h> - #include "cachedbitmap.hxx" class Point; @@ -38,7 +34,7 @@ namespace vclcanvas This interface must be implemented on all canvas implementations that hand out XCachedPrimitives */ - class RepaintTarget + class SAL_LOPLUGIN_ANNOTATE("crosscast") RepaintTarget { public: virtual ~RepaintTarget() {} @@ -50,15 +46,6 @@ namespace vclcanvas const ::Point& rPt, const ::Size& rSz, const GraphicAttr& rAttr ) const = 0; - - sal_Int64 getSomething(css::uno::Sequence<sal_Int8> const & id) { - return comphelper::getSomethingImpl(id, this); - } - - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); - } }; } diff --git a/canvas/source/vcl/spritecanvas.cxx b/canvas/source/vcl/spritecanvas.cxx index b7984e70ddce..f67783681417 100644 --- a/canvas/source/vcl/spritecanvas.cxx +++ b/canvas/source/vcl/spritecanvas.cxx @@ -161,10 +161,6 @@ namespace vclcanvas return cppu::supportsService(this, sServiceName); } - sal_Int64 SpriteCanvas::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return RepaintTarget::getSomething(aIdentifier); - } - bool SpriteCanvas::repaint( const GraphicObjectSharedPtr& rGrf, const rendering::ViewState& viewState, const rendering::RenderState& renderState, diff --git a/canvas/source/vcl/spritecanvas.hxx b/canvas/source/vcl/spritecanvas.hxx index 335d8dcce3e3..8f7c76880f51 100644 --- a/canvas/source/vcl/spritecanvas.hxx +++ b/canvas/source/vcl/spritecanvas.hxx @@ -25,7 +25,6 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XServiceName.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/awt/XWindowListener.hpp> #include <com/sun/star/util/XUpdatable.hpp> #include <com/sun/star/rendering/XSpriteCanvas.hpp> @@ -58,8 +57,7 @@ namespace vclcanvas css::util::XUpdatable, css::beans::XPropertySet, css::lang::XServiceName, - css::lang::XServiceInfo, - css::lang::XUnoTunnel > WindowGraphicDeviceBase_Base; + css::lang::XServiceInfo > WindowGraphicDeviceBase_Base; typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::DisambiguationHelper< WindowGraphicDeviceBase_Base >, SpriteDeviceHelper, tools::LocalGuard, @@ -140,9 +138,6 @@ namespace vclcanvas virtual OUString SAL_CALL getImplementationName() override; virtual sal_Bool SAL_CALL supportsService(const OUString&) override; - // XUnoTunnel - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - // RepaintTarget virtual bool repaint( const GraphicObjectSharedPtr& rGrf, const css::rendering::ViewState& viewState, diff --git a/canvas/source/vcl/textlayout.cxx b/canvas/source/vcl/textlayout.cxx index 6131cce0e380..689720e4570a 100644 --- a/canvas/source/vcl/textlayout.cxx +++ b/canvas/source/vcl/textlayout.cxx @@ -29,7 +29,6 @@ #include <com/sun/star/rendering/TextDirection.hpp> #include <com/sun/star/rendering/ViewState.hpp> #include <comphelper/sequence.hxx> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <utility> #include <vcl/kernarray.hxx> @@ -421,15 +420,6 @@ namespace vclcanvas { return { "com.sun.star.rendering.TextLayout" }; } - - sal_Int64 TextLayout::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl(aIdentifier, this); - } - - css::uno::Sequence<sal_Int8> const & TextLayout::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); - } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/canvas/source/vcl/textlayout.hxx b/canvas/source/vcl/textlayout.hxx index 53f3f73033ac..be8603d812f1 100644 --- a/canvas/source/vcl/textlayout.hxx +++ b/canvas/source/vcl/textlayout.hxx @@ -23,7 +23,6 @@ #include <cppuhelper/basemutex.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/rendering/StringContext.hpp> #include <com/sun/star/rendering/XTextLayout.hpp> @@ -35,8 +34,7 @@ namespace vclcanvas { typedef ::cppu::WeakComponentImplHelper< css::rendering::XTextLayout, - css::lang::XServiceInfo, - css::lang::XUnoTunnel > TextLayout_Base; + css::lang::XServiceInfo > TextLayout_Base; class TextLayout : public ::cppu::BaseMutex, public TextLayout_Base @@ -80,9 +78,6 @@ namespace vclcanvas virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - void draw( OutputDevice& rOutDev, const Point& rOutpos, const css::rendering::ViewState& viewState, diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index 2ba57aa45d33..1a59bb161ec3 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -377,7 +377,7 @@ void SAL_CALL ChartController::attachFrame( uno::Reference<ui::XSidebar> xSidebar = getSidebarFromModel(getChartModel()); if (xSidebar.is()) { - auto pSidebar = comphelper::getFromUnoTunnel<sfx2::sidebar::SidebarController>(xSidebar); + auto pSidebar = dynamic_cast<sfx2::sidebar::SidebarController*>(xSidebar.get()); assert(pSidebar); pSidebar->registerSidebarForFrame(this); pSidebar->updateModel(getChartModel()); @@ -761,7 +761,7 @@ void SAL_CALL ChartController::dispose() if (getModel().is()) { uno::Reference<ui::XSidebar> xSidebar = getSidebarFromModel(getChartModel()); - if (sfx2::sidebar::SidebarController* pSidebar = comphelper::getFromUnoTunnel<sfx2::sidebar::SidebarController>(xSidebar)) + if (sfx2::sidebar::SidebarController* pSidebar = dynamic_cast<sfx2::sidebar::SidebarController*>(xSidebar.get())) { pSidebar->unregisterSidebarForFrame(this); } diff --git a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx index 4d0208fbc450..081322b09408 100644 --- a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx +++ b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx @@ -23,7 +23,6 @@ #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> #include <cppuhelper/exc_hlp.hxx> #include <comphelper/namedvaluecollection.hxx> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <vcl/weldutils.hxx> @@ -62,7 +61,7 @@ Reference<css::ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement ( Reference<css::frame::XController> xController (aArguments.getOrDefault("Controller", Reference<css::frame::XController>())); weld::Widget* pParent(nullptr); - if (weld::TransportAsXWindow* pTunnel = comphelper::getFromUnoTunnel<weld::TransportAsXWindow>(xParentWindow)) + if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(xParentWindow.get())) pParent = pTunnel->getWidget(); if (!pParent) diff --git a/chart2/source/controller/sidebar/ChartLinePanel.cxx b/chart2/source/controller/sidebar/ChartLinePanel.cxx index bc905c9d9900..d9da9a2985ef 100644 --- a/chart2/source/controller/sidebar/ChartLinePanel.cxx +++ b/chart2/source/controller/sidebar/ChartLinePanel.cxx @@ -25,7 +25,6 @@ #include <com/sun/star/chart2/XDiagram.hpp> #include <comphelper/lok.hxx> -#include <comphelper/servicehelper.hxx> #include <sfx2/viewsh.hxx> #include <LibreOfficeKit/LibreOfficeKitEnums.h> @@ -36,7 +35,7 @@ namespace { SvxLineStyleToolBoxControl* getLineStyleToolBoxControl(const ToolbarUnoDispatcher& rToolBoxColor) { css::uno::Reference<css::frame::XToolbarController> xController = rToolBoxColor.GetControllerForCommand(".uno:XLineStyle"); - SvxLineStyleToolBoxControl* pToolBoxLineStyleControl = comphelper::getFromUnoTunnel<SvxLineStyleToolBoxControl>(xController); + SvxLineStyleToolBoxControl* pToolBoxLineStyleControl = dynamic_cast<SvxLineStyleToolBoxControl*>(xController.get()); return pToolBoxLineStyleControl; } diff --git a/embeddedobj/source/commonembedding/miscobj.cxx b/embeddedobj/source/commonembedding/miscobj.cxx index a0cce3c6f34b..ecd149b8bb17 100644 --- a/embeddedobj/source/commonembedding/miscobj.cxx +++ b/embeddedobj/source/commonembedding/miscobj.cxx @@ -25,13 +25,11 @@ #include <com/sun/star/embed/XInplaceClient.hpp> #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/lang/NoSupportException.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/beans/NamedValue.hpp> #include <com/sun/star/ucb/SimpleFileAccess.hpp> #include <com/sun/star/io/TempFile.hpp> #include <comphelper/multicontainer2.hxx> -#include <comphelper/servicehelper.hxx> #include <comphelper/storagehelper.hxx> #include <cppuhelper/queryinterface.hxx> @@ -764,7 +762,6 @@ uno::Sequence<uno::Type> SAL_CALL OCommonEmbeddedObject::getTypes() cppu::UnoType<lang::XServiceInfo>::get(), cppu::UnoType<lang::XInitialization>::get(), cppu::UnoType<lang::XTypeProvider>::get(), - cppu::UnoType<lang::XUnoTunnel>::get(), }; return aTypes; } @@ -774,10 +771,6 @@ uno::Sequence<sal_Int8> SAL_CALL OCommonEmbeddedObject::getImplementationId() return uno::Sequence<sal_Int8>(); } -sal_Int64 OCommonEmbeddedObject::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl(aIdentifier, static_cast<EmbeddedUpdate *>(this)); -} - void SAL_CALL OCommonEmbeddedObject::initialize(const uno::Sequence<uno::Any>& rArguments) { if (!rArguments.hasElements()) diff --git a/embeddedobj/source/inc/commonembobj.hxx b/embeddedobj/source/inc/commonembobj.hxx index 330dbe7ad829..8f0a685c22c3 100644 --- a/embeddedobj/source/inc/commonembobj.hxx +++ b/embeddedobj/source/inc/commonembobj.hxx @@ -35,12 +35,11 @@ #include <com/sun/star/io/XTempFile.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XInitialization.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <cppuhelper/weak.hxx> +#include <embeddedobj/embeddedupdate.hxx> #include <rtl/ref.hxx> #include <map> #include <memory> -#include <svtools/embeddedupdate.hxx> #include <svtools/filechangedchecker.hxx> namespace com::sun::star { @@ -88,7 +87,6 @@ class OCommonEmbeddedObject : public css::embed::XEmbeddedObject , public css::lang::XServiceInfo , public css::lang::XInitialization , public css::lang::XTypeProvider - , public css::lang::XUnoTunnel , public ::cppu::OWeakObject { protected: @@ -436,9 +434,6 @@ public: // XTypeProvider css::uno::Sequence<css::uno::Type> SAL_CALL getTypes() override; css::uno::Sequence<sal_Int8> SAL_CALL getImplementationId() override; - - // XUnoTunnel - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/propctrlr/browserline.cxx b/extensions/source/propctrlr/browserline.cxx index c77d211314a0..53a58966e25d 100644 --- a/extensions/source/propctrlr/browserline.cxx +++ b/extensions/source/propctrlr/browserline.cxx @@ -26,7 +26,6 @@ #include <comphelper/processfactory.hxx> #include <comphelper/propertyvalue.hxx> -#include <comphelper/servicehelper.hxx> #include <comphelper/string.hxx> #include <tools/debug.hxx> #include <comphelper/diagnose_ex.hxx> @@ -111,7 +110,7 @@ namespace pcr { m_xControl = rxControl; auto xWindow = m_xControl->getControlWindow(); - if (weld::TransportAsXWindow* pTunnel = comphelper::getFromUnoTunnel<weld::TransportAsXWindow>(xWindow)) + if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(xWindow.get())) m_pControlWindow = pTunnel->getWidget(); else m_pControlWindow = nullptr; diff --git a/extensions/source/propctrlr/commoncontrol.hxx b/extensions/source/propctrlr/commoncontrol.hxx index eb92980eaff2..746f2f56f600 100644 --- a/extensions/source/propctrlr/commoncontrol.hxx +++ b/extensions/source/propctrlr/commoncontrol.hxx @@ -107,13 +107,13 @@ namespace pcr @param TControlWindow a class which is derived from weld::Widget */ - template < class TControlWindow, class... TControlInterface > + template < class TControlInterface, class TControlWindow > class CommonBehaviourControl :public ::cppu::BaseMutex - ,public ::cppu::WeakComponentImplHelper< TControlInterface... > + ,public ::cppu::WeakComponentImplHelper< TControlInterface > ,public CommonBehaviourControlHelper { protected: - typedef ::cppu::WeakComponentImplHelper< TControlInterface... > ComponentBaseClass; + typedef ::cppu::WeakComponentImplHelper< TControlInterface > ComponentBaseClass; inline CommonBehaviourControl(sal_Int16 nControlType, std::unique_ptr<weld::Builder> xBuilder, @@ -179,8 +179,8 @@ namespace pcr }; //= CommonBehaviourControl - implementation - template< class TControlWindow, class... TControlInterface > - inline CommonBehaviourControl< TControlWindow, TControlInterface... >::CommonBehaviourControl(sal_Int16 nControlType, + template< class TControlInterface, class TControlWindow > + inline CommonBehaviourControl< TControlInterface, TControlWindow >::CommonBehaviourControl(sal_Int16 nControlType, std::unique_ptr<weld::Builder> xBuilder, std::unique_ptr<TControlWindow> xWidget, bool bReadOnly) @@ -196,8 +196,8 @@ namespace pcr } } - template< class TControlWindow, class... TControlInterface > - inline void CommonBehaviourControl< TControlWindow, TControlInterface... >::impl_checkDisposed_throw() + template< class TControlInterface, class TControlWindow > + inline void CommonBehaviourControl< TControlInterface, TControlWindow >::impl_checkDisposed_throw() { if ( ComponentBaseClass::rBHelper.bDisposed ) throw css::lang::DisposedException( OUString(), *this ); diff --git a/extensions/source/propctrlr/eformshelper.cxx b/extensions/source/propctrlr/eformshelper.cxx index c53b8eacc909..40aceed5dfe7 100644 --- a/extensions/source/propctrlr/eformshelper.cxx +++ b/extensions/source/propctrlr/eformshelper.cxx @@ -32,7 +32,6 @@ #include <com/sun/star/xsd/DataTypeClass.hpp> #include <com/sun/star/form/binding/XListEntrySink.hpp> #include <comphelper/diagnose_ex.hxx> -#include <comphelper/servicehelper.hxx> #include <algorithm> #include <o3tl/functional.hxx> @@ -244,7 +243,7 @@ namespace pcr ::comphelper::OInterfaceIteratorHelper3 aListenerIterator(m_aPropertyListeners); while ( aListenerIterator.hasMoreElements() ) { - PropertyEventTranslation* pTranslator = comphelper::getFromUnoTunnel< PropertyEventTranslation >( aListenerIterator.next() ); + PropertyEventTranslation* pTranslator = dynamic_cast< PropertyEventTranslation* >( aListenerIterator.next().get() ); OSL_ENSURE( pTranslator, "EFormsHelper::impl_toggleBindingPropertyListening_throw: invalid listener element in my container!" ); if ( !pTranslator ) continue; diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index a4e76388a413..dd4f1302fc31 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -77,7 +77,6 @@ #include <com/sun/star/text/WritingMode2.hpp> #include <comphelper/extract.hxx> -#include <comphelper/servicehelper.hxx> #include <comphelper/types.hxx> #include <connectivity/dbconversion.hxx> #include <connectivity/dbexception.hxx> @@ -1709,7 +1708,7 @@ namespace pcr catch( const UnknownPropertyException& ) {} if ( xControl.is() ) { - OFormattedNumericControl* pControl = comphelper::getFromUnoTunnel< OFormattedNumericControl >( xControl ); + OFormattedNumericControl* pControl = dynamic_cast< OFormattedNumericControl* >( xControl.get() ); DBG_ASSERT( pControl, "FormComponentPropertyHandler::actuatingPropertyChanged: invalid control!" ); if (pControl) { @@ -1755,7 +1754,7 @@ namespace pcr catch( const UnknownPropertyException& ) {} if ( xControl.is() ) { - OFormattedNumericControl* pControl = comphelper::getFromUnoTunnel< OFormattedNumericControl >( xControl ); + OFormattedNumericControl* pControl = dynamic_cast< OFormattedNumericControl* >( xControl.get() ); DBG_ASSERT( pControl, "FormComponentPropertyHandler::actuatingPropertyChanged: invalid control!" ); if ( pControl ) pControl->SetFormatDescription( aNewDesc ); diff --git a/extensions/source/propctrlr/handlerhelper.cxx b/extensions/source/propctrlr/handlerhelper.cxx index dfa83ff0c6e8..77743c622ad7 100644 --- a/extensions/source/propctrlr/handlerhelper.cxx +++ b/extensions/source/propctrlr/handlerhelper.cxx @@ -30,7 +30,6 @@ #include <com/sun/star/inspection/XStringListControl.hpp> #include <com/sun/star/inspection/XNumericControl.hpp> #include <comphelper/diagnose_ex.hxx> -#include <comphelper/servicehelper.hxx> #include <vcl/svapp.hxx> #include <vcl/weld.hxx> #include <vcl/weldutils.hxx> @@ -292,10 +291,8 @@ namespace pcr std::unique_ptr<weld::Builder> PropertyHandlerHelper::makeBuilder(const OUString& rUIFile, const Reference<XComponentContext>& rContext) { Reference<XWindow> xWindow(rContext->getValueByName("BuilderParent"), UNO_QUERY_THROW); - weld::TransportAsXWindow* pTunnel - = comphelper::getFromUnoTunnel<weld::TransportAsXWindow>(xWindow); - assert(pTunnel && "must exist"); - return Application::CreateBuilder(pTunnel->getWidget(), rUIFile); + weld::TransportAsXWindow& rTunnel = dynamic_cast<weld::TransportAsXWindow&>(*xWindow); + return Application::CreateBuilder(rTunnel.getWidget(), rUIFile); } void PropertyHandlerHelper::setBuilderParent(const css::uno::Reference<css::uno::XComponentContext>& rContext, weld::Widget* pParent) diff --git a/extensions/source/propctrlr/propcontroller.cxx b/extensions/source/propctrlr/propcontroller.cxx index 92556e1c05ad..b0516fd90903 100644 --- a/extensions/source/propctrlr/propcontroller.cxx +++ b/extensions/source/propctrlr/propcontroller.cxx @@ -38,7 +38,6 @@ #include <com/sun/star/util/VetoException.hpp> #include <tools/debug.hxx> #include <comphelper/diagnose_ex.hxx> -#include <comphelper/servicehelper.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <vcl/svapp.hxx> #include <vcl/weld.hxx> @@ -339,7 +338,7 @@ namespace pcr OUString sUIFile("modules/spropctrlr/ui/formproperties.ui"); std::unique_ptr<weld::Builder> xBuilder; - if (weld::TransportAsXWindow* pTunnel = comphelper::getFromUnoTunnel<weld::TransportAsXWindow>(xContainerWindow)) + if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(xContainerWindow.get())) { xBuilder = Application::CreateBuilder(pTunnel->getWidget(), sUIFile); } @@ -1108,7 +1107,7 @@ namespace pcr // for ui-testing try and distinguish different instances of the controls auto xWindow = _rDescriptor.Control->getControlWindow(); - if (weld::TransportAsXWindow* pTunnel = comphelper::getFromUnoTunnel<weld::TransportAsXWindow>(xWindow)) + if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(xWindow.get())) { weld::Widget* m_pControlWindow = pTunnel->getWidget(); if (m_pControlWindow) diff --git a/extensions/source/propctrlr/propeventtranslation.cxx b/extensions/source/propctrlr/propeventtranslation.cxx index ce8e794f2211..736c1e06fca2 100644 --- a/extensions/source/propctrlr/propeventtranslation.cxx +++ b/extensions/source/propctrlr/propeventtranslation.cxx @@ -20,7 +20,6 @@ #include "propeventtranslation.hxx" #include <com/sun/star/lang/DisposedException.hpp> -#include <comphelper/servicehelper.hxx> namespace pcr @@ -49,18 +48,6 @@ namespace pcr } - sal_Int64 PropertyEventTranslation::getSomething( - css::uno::Sequence<sal_Int8> const & aIdentifier) - { - return comphelper::getSomethingImpl(aIdentifier, this); - } - - css::uno::Sequence<sal_Int8> const & PropertyEventTranslation::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); - } - - void SAL_CALL PropertyEventTranslation::propertyChange( const PropertyChangeEvent& evt ) { if ( !m_xDelegator.is() ) diff --git a/extensions/source/propctrlr/propeventtranslation.hxx b/extensions/source/propctrlr/propeventtranslation.hxx index 92e143dfbbc2..43155b8c67f9 100644 --- a/extensions/source/propctrlr/propeventtranslation.hxx +++ b/extensions/source/propctrlr/propeventtranslation.hxx @@ -20,7 +20,6 @@ #pragma once #include <com/sun/star/beans/XPropertyChangeListener.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <cppuhelper/implbase.hxx> @@ -30,7 +29,7 @@ namespace pcr //= PropertyEventTranslation - typedef ::cppu::WeakImplHelper < css::beans::XPropertyChangeListener, css::lang::XUnoTunnel + typedef ::cppu::WeakImplHelper < css::beans::XPropertyChangeListener > PropertyEventTranslation_Base; class PropertyEventTranslation : public PropertyEventTranslation_Base @@ -53,9 +52,6 @@ namespace pcr const css::uno::Reference< css::beans::XPropertyChangeListener >& getDelegator() const { return m_xDelegator; } - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - protected: // XPropertyChangeListener virtual void SAL_CALL propertyChange( const css::beans::PropertyChangeEvent& evt ) override; diff --git a/extensions/source/propctrlr/standardcontrol.hxx b/extensions/source/propctrlr/standardcontrol.hxx index df8924be806e..fcd194886a1a 100644 --- a/extensions/source/propctrlr/standardcontrol.hxx +++ b/extensions/source/propctrlr/standardcontrol.hxx @@ -33,7 +33,7 @@ namespace pcr { //= OTimeControl - typedef CommonBehaviourControl<weld::FormattedSpinButton, css::inspection::XPropertyControl> OTimeControl_Base; + typedef CommonBehaviourControl<css::inspection::XPropertyControl, weld::FormattedSpinButton> OTimeControl_Base; class OTimeControl : public OTimeControl_Base { std::unique_ptr<weld::TimeFormatter> m_xFormatter; @@ -61,7 +61,7 @@ namespace pcr }; //= ODateControl - typedef CommonBehaviourControl<weld::Container, css::inspection::XPropertyControl> ODateControl_Base; + typedef CommonBehaviourControl<css::inspection::XPropertyControl, weld::Container> ODateControl_Base; class ODateControl : public ODateControl_Base { std::unique_ptr<weld::Entry> m_xEntry; @@ -97,7 +97,7 @@ namespace pcr }; //= OEditControl - typedef CommonBehaviourControl<weld::Entry, css::inspection::XPropertyControl> OEditControl_Base; + typedef CommonBehaviourControl<css::inspection::XPropertyControl, weld::Entry> OEditControl_Base; class OEditControl final : public OEditControl_Base { bool m_bIsPassword : 1; @@ -123,7 +123,7 @@ namespace pcr }; //= ODateTimeControl - typedef CommonBehaviourControl<weld::Container, css::inspection::XPropertyControl> ODateTimeControl_Base; + typedef CommonBehaviourControl<css::inspection::XPropertyControl, weld::Container> ODateTimeControl_Base; class ODateTimeControl : public ODateTimeControl_Base { private: @@ -162,7 +162,7 @@ namespace pcr }; //= OHyperlinkControl - typedef CommonBehaviourControl<weld::Container, css::inspection::XHyperlinkControl> OHyperlinkControl_Base; + typedef CommonBehaviourControl<css::inspection::XHyperlinkControl, weld::Container> OHyperlinkControl_Base; class OHyperlinkControl final : public OHyperlinkControl_Base { private: @@ -203,7 +203,7 @@ namespace pcr }; //= ONumericControl - typedef CommonBehaviourControl<weld::MetricSpinButton, css::inspection::XNumericControl> ONumericControl_Base; + typedef CommonBehaviourControl<css::inspection::XNumericControl, weld::MetricSpinButton> ONumericControl_Base; class ONumericControl : public ONumericControl_Base { private: @@ -255,7 +255,7 @@ namespace pcr }; //= OColorControl - typedef CommonBehaviourControl<ColorListBox, css::inspection::XPropertyControl> OColorControl_Base; + typedef CommonBehaviourControl<css::inspection::XPropertyControl, ColorListBox> OColorControl_Base; class OColorControl : public OColorControl_Base { public: @@ -281,7 +281,7 @@ namespace pcr }; //= OListboxControl - typedef CommonBehaviourControl<weld::ComboBox, css::inspection::XStringListControl> OListboxControl_Base; + typedef CommonBehaviourControl<css::inspection::XStringListControl, weld::ComboBox> OListboxControl_Base; class OListboxControl : public OListboxControl_Base { public: @@ -311,7 +311,7 @@ namespace pcr }; //= OComboboxControl - typedef CommonBehaviourControl< weld::ComboBox, css::inspection::XStringListControl > OComboboxControl_Base; + typedef CommonBehaviourControl< css::inspection::XStringListControl, weld::ComboBox > OComboboxControl_Base; class OComboboxControl final : public OComboboxControl_Base { public: @@ -351,7 +351,7 @@ namespace pcr }; //= OMultilineEditControl - typedef CommonBehaviourControl<weld::Container, css::inspection::XPropertyControl> OMultilineEditControl_Base; + typedef CommonBehaviourControl<css::inspection::XPropertyControl, weld::Container> OMultilineEditControl_Base; class OMultilineEditControl : public OMultilineEditControl_Base { private: diff --git a/extensions/source/propctrlr/usercontrol.cxx b/extensions/source/propctrlr/usercontrol.cxx index 854abfa72037..8cccb48e84b5 100644 --- a/extensions/source/propctrlr/usercontrol.cxx +++ b/extensions/source/propctrlr/usercontrol.cxx @@ -20,7 +20,6 @@ #include "usercontrol.hxx" #include <com/sun/star/inspection/PropertyControlType.hpp> -#include <comphelper/servicehelper.hxx> #include <svl/numuno.hxx> #include <vcl/GraphicObject.hxx> #include <vcl/event.hxx> @@ -200,17 +199,6 @@ namespace pcr return ::cppu::UnoType<double>::get(); } - sal_Int64 OFormattedNumericControl::getSomething( - css::uno::Sequence<sal_Int8> const & aIdentifier) - { - return comphelper::getSomethingImpl(aIdentifier, this); - } - - css::uno::Sequence<sal_Int8> const & OFormattedNumericControl::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); - } - void OFormattedNumericControl::SetFormatDescription(const FormatDescription& rDesc) { bool bFallback = true; diff --git a/extensions/source/propctrlr/usercontrol.hxx b/extensions/source/propctrlr/usercontrol.hxx index bb7a622d7669..86b53e7f122e 100644 --- a/extensions/source/propctrlr/usercontrol.hxx +++ b/extensions/source/propctrlr/usercontrol.hxx @@ -20,7 +20,6 @@ #pragma once #include "commoncontrol.hxx" -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <svtools/inettbc.hxx> #include <svl/zforlist.hxx> @@ -29,7 +28,7 @@ class SvNumberFormatsSupplierObj; namespace pcr { //= OFormatSampleControl - typedef CommonBehaviourControl<weld::Container, css::inspection::XPropertyControl> OFormatSampleControl_Base; + typedef CommonBehaviourControl<css::inspection::XPropertyControl, weld::Container> OFormatSampleControl_Base; class OFormatSampleControl : public OFormatSampleControl_Base { private: @@ -85,7 +84,7 @@ namespace pcr }; //= OFormattedNumericControl - typedef CommonBehaviourControl<weld::FormattedSpinButton, css::inspection::XPropertyControl, css::lang::XUnoTunnel> OFormattedNumericControl_Base; + typedef CommonBehaviourControl<css::inspection::XPropertyControl, weld::FormattedSpinButton> OFormattedNumericControl_Base; class OFormattedNumericControl : public OFormattedNumericControl_Base { public: @@ -96,9 +95,6 @@ namespace pcr virtual void SAL_CALL setValue( const css::uno::Any& _value ) override; virtual css::uno::Type SAL_CALL getValueType() override; - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - void SetFormatDescription( const FormatDescription& rDesc ); // make some FormattedField methods available @@ -119,7 +115,7 @@ namespace pcr }; //= OFileUrlControl - typedef CommonBehaviourControl<SvtURLBox, css::inspection::XPropertyControl> OFileUrlControl_Base; + typedef CommonBehaviourControl<css::inspection::XPropertyControl, SvtURLBox> OFileUrlControl_Base; class OFileUrlControl : public OFileUrlControl_Base { private: diff --git a/forms/source/inc/InterfaceContainer.hxx b/forms/source/inc/InterfaceContainer.hxx index b42229ddc16c..66135a02e48e 100644 --- a/forms/source/inc/InterfaceContainer.hxx +++ b/forms/source/inc/InterfaceContainer.hxx @@ -22,7 +22,6 @@ #include <comphelper/uno3.hxx> #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/lang/EventObject.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/container/XEnumerationAccess.hpp> #include <com/sun/star/io/XPersistObject.hpp> #include <com/sun/star/beans/XPropertyChangeListener.hpp> @@ -38,7 +37,7 @@ #include <comphelper/interfacecontainer3.hxx> #include <cppuhelper/component.hxx> #include <cppuhelper/implbase1.hxx> -#include <cppuhelper/implbase9.hxx> +#include <cppuhelper/implbase8.hxx> #include <unordered_map> namespace com::sun::star::uno { class XComponentContext; } @@ -73,7 +72,7 @@ typedef std::unordered_multimap< OUString, css::uno::Reference<css::uno::XInterf // OInterfaceContainer // implements a container for form components -typedef ::cppu::ImplHelper9 < css::container::XNameContainer +typedef ::cppu::ImplHelper8 < css::container::XNameContainer , css::container::XIndexContainer , css::container::XContainer , css::container::XEnumerationAccess @@ -81,7 +80,6 @@ typedef ::cppu::ImplHelper9 < css::container::XNameContainer , css::beans::XPropertyChangeListener , css::io::XPersistObject , css::util::XCloneable - , css::lang::XUnoTunnel > OInterfaceContainer_BASE; class OInterfaceContainer : public OInterfaceContainer_BASE @@ -175,9 +173,6 @@ public: virtual void SAL_CALL addScriptListener( const css::uno::Reference< css::script::XScriptListener >& xListener ) override; virtual void SAL_CALL removeScriptListener( const css::uno::Reference< css::script::XScriptListener >& Listener ) override; - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - protected: // helper virtual void SAL_CALL disposing(); diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx index e7d7b43672c2..f7278117899c 100644 --- a/forms/source/misc/InterfaceContainer.cxx +++ b/forms/source/misc/InterfaceContainer.cxx @@ -41,7 +41,6 @@ #include <comphelper/eventattachermgr.hxx> #include <comphelper/property.hxx> #include <comphelper/sequence.hxx> -#include <comphelper/servicehelper.hxx> #include <comphelper/types.hxx> #include <cppuhelper/exc_hlp.hxx> #include <o3tl/safeint.hxx> @@ -835,7 +834,7 @@ void OInterfaceContainer::implInsert(sal_Int32 _nIndex, const Reference< XProper if ( bHandleVbaEvents ) { Reference< XEventAttacherManager > xMgr ( pElementMetaData->xInterface, UNO_QUERY ); - OInterfaceContainer* pIfcMgr = xMgr.is() ? comphelper::getFromUnoTunnel<OInterfaceContainer>(xMgr) : nullptr; + OInterfaceContainer* pIfcMgr = xMgr.is() ? dynamic_cast<OInterfaceContainer*>(xMgr.get()) : nullptr; if (pIfcMgr) { sal_Int32 nLen = pIfcMgr->getCount(); @@ -1237,16 +1236,6 @@ void SAL_CALL OInterfaceContainer::removeScriptListener( const Reference< XScrip } -sal_Int64 OInterfaceContainer::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl(aIdentifier, this); -} - -css::uno::Sequence<sal_Int8> const & OInterfaceContainer::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); -} - - //= OFormComponents diff --git a/framework/inc/uielement/addonstoolbarwrapper.hxx b/framework/inc/uielement/addonstoolbarwrapper.hxx index 1d189662feee..68cfc0ff31d0 100644 --- a/framework/inc/uielement/addonstoolbarwrapper.hxx +++ b/framework/inc/uielement/addonstoolbarwrapper.hxx @@ -22,15 +22,12 @@ #include <helper/uielementwrapperbase.hxx> #include <com/sun/star/lang/XComponent.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/uno/XComponentContext.hpp> -#include <cppuhelper/implbase.hxx> namespace framework { -class AddonsToolBarWrapper final : - public cppu::ImplInheritanceHelper<UIElementWrapperBase, css::lang::XUnoTunnel> +class AddonsToolBarWrapper final : public UIElementWrapperBase { public: AddonsToolBarWrapper( const css::uno::Reference< css::uno::XComponentContext >& xContext ); @@ -48,9 +45,6 @@ class AddonsToolBarWrapper final : // cf. ToolbarLayoutManager void populateImages(); - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - private: css::uno::Reference< css::uno::XComponentContext > m_xContext; css::uno::Reference< css::lang::XComponent > m_xToolBarManager; diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx index 9ec6bdbfe52b..cf444b5ab31d 100644 --- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx +++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx @@ -34,7 +34,6 @@ #include <com/sun/star/ui/XUIFunctionListener.hpp> #include <comphelper/propertyvalue.hxx> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/queryinterface.hxx> #include <o3tl/string_view.hxx> #include <unotools/cmdoptions.hxx> @@ -669,7 +668,7 @@ bool ToolbarLayoutManager::showToolbar( std::u16string_view rResourceURL ) // Addons appear to need to be populated at start, but we don't // want to populate them with (scaled) images until later. AddonsToolBarWrapper *pAddOns; - pAddOns = comphelper::getFromUnoTunnel<AddonsToolBarWrapper>( aUIElement.m_xUIElement); + pAddOns = dynamic_cast<AddonsToolBarWrapper *>( aUIElement.m_xUIElement.get()); if (pAddOns) pAddOns->populateImages(); diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx index d58eaa9334c7..048b677c9daa 100644 --- a/framework/source/services/desktop.cxx +++ b/framework/source/services/desktop.cxx @@ -50,7 +50,6 @@ #include <comphelper/numberedcollection.hxx> #include <comphelper/sequence.hxx> #include <comphelper/lok.hxx> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <utility> #include <vcl/svapp.hxx> @@ -336,15 +335,6 @@ void Desktop::shutdown() xSfxTerminator->notifyTermination(aEvent); } -sal_Int64 Desktop::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl(aIdentifier, this); -} - -css::uno::Sequence<sal_Int8> const & Desktop::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); -} - namespace { class QuickstartSuppressor diff --git a/framework/source/services/sessionlistener.cxx b/framework/source/services/sessionlistener.cxx index 01c8218b087d..188b082fe94c 100644 --- a/framework/source/services/sessionlistener.cxx +++ b/framework/source/services/sessionlistener.cxx @@ -23,7 +23,6 @@ #include <framework/desktop.hxx> #include <comphelper/diagnose_ex.hxx> -#include <comphelper/servicehelper.hxx> #include <com/sun/star/beans/NamedValue.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/frame/theAutoRecovery.hpp> @@ -343,7 +342,7 @@ void SAL_CALL SessionListener::approveInteraction( sal_Bool bInteractionGranted css::uno::Reference< css::frame::XDesktop2 > xDesktop = css::frame::Desktop::create( m_xContext ); // honestly: how many implementations of XDesktop will we ever have? // so casting this directly to the implementation - Desktop* pDesktop(comphelper::getFromUnoTunnel<Desktop>(xDesktop)); + Desktop* pDesktop(dynamic_cast<Desktop*>(xDesktop.get())); if(pDesktop) { SAL_INFO("fwk.session", " XDesktop is a framework::Desktop -- good."); diff --git a/framework/source/uielement/addonstoolbarwrapper.cxx b/framework/source/uielement/addonstoolbarwrapper.cxx index 6a8984ab654c..6547d1c6bcde 100644 --- a/framework/source/uielement/addonstoolbarwrapper.cxx +++ b/framework/source/uielement/addonstoolbarwrapper.cxx @@ -23,7 +23,6 @@ #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/ui/UIElementType.hpp> -#include <comphelper/servicehelper.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <vcl/svapp.hxx> @@ -41,7 +40,7 @@ namespace framework { AddonsToolBarWrapper::AddonsToolBarWrapper( const Reference< XComponentContext >& xContext ) : - ImplInheritanceHelper( UIElementType::TOOLBAR ), + UIElementWrapperBase( UIElementType::TOOLBAR ), m_xContext( xContext ), m_bCreatedImages( false ) { @@ -167,15 +166,6 @@ void AddonsToolBarWrapper::populateImages() } } -sal_Int64 AddonsToolBarWrapper::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl(aIdentifier, this); -} - -css::uno::Sequence<sal_Int8> const & AddonsToolBarWrapper::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); -} - } // namespace framework /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/uielement/toolbarwrapper.cxx b/framework/source/uielement/toolbarwrapper.cxx index 33bf896b6f5a..8f3937ef094f 100644 --- a/framework/source/uielement/toolbarwrapper.cxx +++ b/framework/source/uielement/toolbarwrapper.cxx @@ -24,7 +24,6 @@ #include <com/sun/star/ui/UIElementType.hpp> #include <com/sun/star/lang/DisposedException.hpp> -#include <comphelper/servicehelper.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <vcl/svapp.hxx> @@ -154,7 +153,7 @@ void SAL_CALL ToolBarWrapper::initialize( const Sequence< Any >& aArguments ) m_xToolBarManager = pToolBarManager; pToolBar->WillUsePopupMode( bPopupMode ); } - else if (weld::TransportAsXWindow* pTunnel = comphelper::getFromUnoTunnel<weld::TransportAsXWindow>(xParentWindow)) + else if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(xParentWindow.get())) { m_xBuilder = Application::CreateBuilder(pTunnel->getWidget(), "svt/ui/managedtoolbar.ui"); m_xTopLevel = m_xBuilder->weld_container("toolbarcontainer"); diff --git a/i18npool/inc/calendar_gregorian.hxx b/i18npool/inc/calendar_gregorian.hxx index 1f29d63f9f02..1ee7cabaab1e 100644 --- a/i18npool/inc/calendar_gregorian.hxx +++ b/i18npool/inc/calendar_gregorian.hxx @@ -21,9 +21,7 @@ #include "calendarImpl.hxx" #include <com/sun/star/i18n/CalendarFieldIndex.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> -#include <cppuhelper/implbase.hxx> #include <unicode/calendar.h> #include <rtl/ref.hxx> @@ -46,7 +44,7 @@ struct Era { const sal_Int16 FIELD_INDEX_COUNT = css::i18n::CalendarFieldIndex::FIELD_COUNT2; -class Calendar_gregorian : public cppu::ImplInheritanceHelper<CalendarImpl, css::lang::XUnoTunnel> +class Calendar_gregorian : public CalendarImpl { public: @@ -100,9 +98,6 @@ public: virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; virtual css::uno::Sequence < OUString > SAL_CALL getSupportedServiceNames() override; - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - protected: const Era *eraArray; std::unique_ptr<icu::Calendar> body; diff --git a/i18npool/source/calendar/calendarImpl.cxx b/i18npool/source/calendar/calendarImpl.cxx index 60391473f944..4e364696cf20 100644 --- a/i18npool/source/calendar/calendarImpl.cxx +++ b/i18npool/source/calendar/calendarImpl.cxx @@ -21,7 +21,6 @@ #include <calendar_gregorian.hxx> #include <localedata.hxx> #include <comphelper/processfactory.hxx> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <com/sun/star/uno/XComponentContext.hpp> @@ -91,7 +90,7 @@ CalendarImpl::loadCalendarTZ( const OUString& uniqueID, const css::lang::Locale& /* XXX NOTE: currently (2019-06-19) calendar implementations derive * from Calendar_gregorian, even Hijri and Jewish. If that should * change in future this should be adapted. */ - Calendar_gregorian* pCal = comphelper::getFromUnoTunnel<Calendar_gregorian>(xCalendar); + Calendar_gregorian* pCal = dynamic_cast<Calendar_gregorian*>(xCalendar.get()); bTimeZone = (pCal && pCal->setTimeZone(rTimeZone)); } diff --git a/i18npool/source/calendar/calendar_gregorian.cxx b/i18npool/source/calendar/calendar_gregorian.cxx index 9e9b248a5b28..e586470a0c31 100644 --- a/i18npool/source/calendar/calendar_gregorian.cxx +++ b/i18npool/source/calendar/calendar_gregorian.cxx @@ -26,7 +26,6 @@ #include <com/sun/star/i18n/CalendarDisplayIndex.hpp> #include <com/sun/star/i18n/NativeNumberMode.hpp> #include <com/sun/star/i18n/reservedWords.hpp> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <o3tl/sprintf.hxx> #include <rtl/math.hxx> @@ -1078,15 +1077,6 @@ Calendar_gregorian::getSupportedServiceNames() return aRet; } -sal_Int64 Calendar_gregorian::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl(aIdentifier, this); -} - -css::uno::Sequence<sal_Int8> const & Calendar_gregorian::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); -} - } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/basegfx/utils/unopolypolygon.hxx b/include/basegfx/utils/unopolypolygon.hxx index 4392f798c6ce..48788b074ede 100644 --- a/include/basegfx/utils/unopolypolygon.hxx +++ b/include/basegfx/utils/unopolypolygon.hxx @@ -22,7 +22,6 @@ #include <comphelper/compbase.hxx> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/rendering/FillRule.hpp> #include <com/sun/star/rendering/XLinePolyPolygon2D.hpp> #include <com/sun/star/rendering/XBezierPolyPolygon2D.hpp> @@ -35,8 +34,7 @@ namespace basegfx::unotools typedef comphelper::WeakComponentImplHelper< css::rendering::XLinePolyPolygon2D, css::rendering::XBezierPolyPolygon2D, - css::lang::XServiceInfo, - css::lang::XUnoTunnel > UnoPolyPolygonBase; + css::lang::XServiceInfo > UnoPolyPolygonBase; class BASEGFX_DLLPUBLIC UnoPolyPolygon : public UnoPolyPolygonBase @@ -70,10 +68,6 @@ namespace basegfx::unotools SAL_DLLPRIVATE virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; SAL_DLLPRIVATE virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - SAL_DLLPRIVATE sal_Int64 SAL_CALL getSomething( - css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static SAL_DLLPRIVATE css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - SAL_DLLPRIVATE B2DPolyPolygon getPolyPolygon() const; protected: diff --git a/include/comphelper/servicehelper.hxx b/include/comphelper/servicehelper.hxx index 286108bd2568..c225494ccf1b 100644 --- a/include/comphelper/servicehelper.hxx +++ b/include/comphelper/servicehelper.hxx @@ -82,16 +82,6 @@ namespace comphelper { && memcmp(T::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0; } - template<typename T> struct MixinToGetSomethingOf { - static bool get(css::uno::Sequence<sal_Int8> const & id, T * p, sal_Int64 * result) { - if (!isUnoTunnelId<T>(id)) { - return false; - } - *result = getSomething_cast(p); - return true; - } - }; - template <class Base> struct FallbackToGetSomethingOf { static sal_Int64 get(const css::uno::Sequence<sal_Int8>& rId, Base* p) @@ -105,85 +95,12 @@ namespace comphelper { static sal_Int64 get(const css::uno::Sequence<sal_Int8>&, void*) { return 0; } }; - // There are five cases how to implement T::getSomething: - // (1) Delegate to Base: - // Either, if Base has only getUnoTunnelId but no getSomething: - // return getSomethingImpl<Base>(aIdentifier, this); - // Or, if Base has getSomething: - // return Base::getSomething(aIdentifier) - // (2) Check against T::getUnoTunnelId, else return 0: - // return getSomethingImpl(aIdentifier, this); - // (3) Check against T::getUnoTunnelId, else delegate to Base: - // return getSomethingImpl(aIdentifier, this, FallbackToGetSomethingOf<Base>{}); - // (4) Check against T::getUnoTunnelId, else check against each Mixins::getUnoTunnelId, else - // delegate to Base: - // return getSomethingImpl( - // aIdentifier, this, MixinToGetSomethingOf<Mixin1>{}, ..., - // MixinToGetSomethingOf<MixinN>{}, FallbackToGetSomethingOf<Base>{}); - // (5) Check against each Mixins::getUnoTunnelId, else delegate to Base: - // return getSomethingImpl_skipDerived( - // aIdentifier, this, MixinToGetSomethingOf<Mixin1>{}, ..., - // MixinToGetSomethingOf<MixinN>{}, FallbackToGetSomethingOf<Base>{}); - template <class T, class Base = void> sal_Int64 getSomethingImpl(const css::uno::Sequence<sal_Int8>& rId, T* pThis, FallbackToGetSomethingOf<Base> = {}) { - sal_Int64 res; - if (MixinToGetSomethingOf<T>::get(rId, pThis, &res)) { - return res; - } - - return FallbackToGetSomethingOf<Base>::get(rId, pThis); - } - -#if defined _MSC_VER && _MSC_VER < 1930 && !defined __clang__ - // Without this additional overload, at least VS 2019 16.11.21 has sometimes issues deducing the - // Base template argument in calls to the "full" getSomethingImpl overload with zero arguments - // substituted for the variadic Mixins parameter: - template <class T, class Mixin, class Base> - sal_Int64 getSomethingImpl(const css::uno::Sequence<sal_Int8>& rId, T* pThis, - MixinToGetSomethingOf<Mixin>, - FallbackToGetSomethingOf<Base>) - { - sal_Int64 res; - if (MixinToGetSomethingOf<T>::get(rId, pThis, &res) - || MixinToGetSomethingOf<Mixin>::get(rId, pThis, &res)) - { - return res; - } - - return FallbackToGetSomethingOf<Base>::get(rId, pThis); - } -#endif - - template <class T, class Mixin, class... Mixins, class Base> - sal_Int64 getSomethingImpl(const css::uno::Sequence<sal_Int8>& rId, T* pThis, - MixinToGetSomethingOf<Mixin>, MixinToGetSomethingOf<Mixins>..., - FallbackToGetSomethingOf<Base>) - { - sal_Int64 res; - if (((MixinToGetSomethingOf<T>::get(rId, pThis, &res) - || MixinToGetSomethingOf<Mixin>::get(rId, pThis, &res)) || ... - || MixinToGetSomethingOf<Mixins>::get(rId, pThis, &res))) - { - return res; - } - - return FallbackToGetSomethingOf<Base>::get(rId, pThis); - } - - template <class T, class Mixin, class... Mixins, class Base> - sal_Int64 getSomethingImpl_skipDerived(const css::uno::Sequence<sal_Int8>& rId, T* pThis, - MixinToGetSomethingOf<Mixin>, MixinToGetSomethingOf<Mixins>..., - FallbackToGetSomethingOf<Base>) - { - sal_Int64 res; - if ((MixinToGetSomethingOf<Mixin>::get(rId, pThis, &res) || ... - || MixinToGetSomethingOf<Mixins>::get(rId, pThis, &res))) - { - return res; - } + if (isUnoTunnelId<T>(rId)) + return getSomething_cast(pThis); return FallbackToGetSomethingOf<Base>::get(rId, pThis); } diff --git a/include/svtools/embeddedupdate.hxx b/include/embeddedobj/embeddedupdate.hxx index 95d49d35764a..63e7bf4464c8 100644 --- a/include/svtools/embeddedupdate.hxx +++ b/include/embeddedobj/embeddedupdate.hxx @@ -9,9 +9,7 @@ #pragma once -#include <com/sun/star/uno/Sequence.hxx> -#include <sal/types.h> -#include <svtools/svtdllapi.h> +#include <embeddedobj/embobjdllapi.h> namespace com { @@ -26,7 +24,7 @@ namespace embed @since LibreOffice 7.4 */ -class SVT_DLLPUBLIC EmbeddedUpdate +class EMBOBJ_DLLPUBLIC SAL_LOPLUGIN_ANNOTATE("crosscast") EmbeddedUpdate { /** By "Refresh all" is used to perform an OLE update and a link update. In the case of a link update, the class OCommonEmbeddedObject is @@ -42,8 +40,6 @@ public: EmbeddedUpdate() = default; virtual ~EmbeddedUpdate() = default; - static css::uno::Sequence<sal_Int8> const& getUnoTunnelId(); - private: EmbeddedUpdate(const EmbeddedUpdate&) = delete; EmbeddedUpdate& operator=(const EmbeddedUpdate&) = delete; diff --git a/include/framework/desktop.hxx b/include/framework/desktop.hxx index deeb9c20233b..3d525eb54938 100644 --- a/include/framework/desktop.hxx +++ b/include/framework/desktop.hxx @@ -36,7 +36,6 @@ #include <com/sun/star/frame/XFramesSupplier.hpp> #include <com/sun/star/frame/XFrames.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/frame/XTasksSupplier.hpp> #include <com/sun/star/container/XEnumerationAccess.hpp> @@ -95,8 +94,7 @@ typedef cppu::WeakComponentImplHelper< css::frame::XTasksSupplier , css::frame::XDispatchResultListener , // => XEventListener css::task::XInteractionHandler , - css::frame::XUntitledNumbers, - css::lang::XUnoTunnel > Desktop_BASE; + css::frame::XUntitledNumbers > Desktop_BASE; class FWK_DLLPUBLIC Desktop final : private cppu::BaseMutex, public Desktop_BASE, @@ -289,9 +287,6 @@ class FWK_DLLPUBLIC Desktop final : private cppu::BaseMutex, void shutdown(); - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - private: // OPropertySetHelper virtual sal_Bool SAL_CALL convertFastPropertyValue ( css::uno::Any& aConvertedValue , diff --git a/include/oox/mathml/imexport.hxx b/include/oox/mathml/imexport.hxx index 5a0ac1313f18..a93216fb1199 100644 --- a/include/oox/mathml/imexport.hxx +++ b/include/oox/mathml/imexport.hxx @@ -9,14 +9,12 @@ #ifndef INCLUDED_OOX_MATHML_IMEXPORT_HXX #define INCLUDED_OOX_MATHML_IMEXPORT_HXX -#include <com/sun/star/uno/Sequence.hxx> #include <oox/core/filterbase.hxx> #include <oox/dllapi.h> #include <oox/export/utils.hxx> #include <rtl/ref.hxx> #include <rtl/strbuf.hxx> #include <rtl/textenc.h> -#include <sal/types.h> #include <sax/fshelper.hxx> #include <tools/gen.hxx> @@ -45,9 +43,6 @@ public: virtual void writeFormulaRtf( OStringBuffer& rBuffer, rtl_TextEncoding nEncoding ) = 0; enum eFormulaAlign { INLINE, CENTER, GROUPEDCENTER, LEFT, RIGHT }; - sal_Int64 getSomething(css::uno::Sequence<sal_Int8> const & id); - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - protected: FormulaImExportBase(); diff --git a/include/sfx2/digitalsignatures.hxx b/include/sfx2/digitalsignatures.hxx index 5e1891e250ed..b46cdd52e9d9 100644 --- a/include/sfx2/digitalsignatures.hxx +++ b/include/sfx2/digitalsignatures.hxx @@ -12,17 +12,14 @@ #include <com/sun/star/embed/XStorage.hpp> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/io/XStream.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/security/XCertificate.hpp> -#include <cppuhelper/implbase.hxx> #include <sal/types.h> -#include <sfx2/dllapi.h> namespace sfx2 { /// Extension of css::security::XDocumentDigitalSignatures for internal purposes. -class SFX2_DLLPUBLIC DigitalSignatures : public cppu::WeakImplHelper<css::lang::XUnoTunnel> +class SAL_NO_VTABLE SAL_DLLPUBLIC_RTTI SAL_LOPLUGIN_ANNOTATE("crosscast") DigitalSignatures { public: /// Same as signDocumentWithCertificate(), but passes the xModel as well. @@ -33,12 +30,8 @@ public: const css::uno::Reference<css::io::XStream>& xStream) = 0; - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const& aIdentifier) override; - static css::uno::Sequence<sal_Int8> const& getUnoTunnelId(); - protected: - DigitalSignatures(); - ~DigitalSignatures() override; + ~DigitalSignatures() noexcept = default; }; } diff --git a/include/sfx2/sidebar/SidebarController.hxx b/include/sfx2/sidebar/SidebarController.hxx index be0a12b3a671..208af98b2fc2 100644 --- a/include/sfx2/sidebar/SidebarController.hxx +++ b/include/sfx2/sidebar/SidebarController.hxx @@ -33,7 +33,6 @@ #include <com/sun/star/beans/XPropertyChangeListener.hpp> #include <com/sun/star/frame/XStatusListener.hpp> #include <com/sun/star/frame/XFrameActionListener.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/ui/XContextChangeEventListener.hpp> #include <com/sun/star/ui/XSidebar.hpp> @@ -49,8 +48,7 @@ typedef comphelper::WeakComponentImplHelper < css::beans::XPropertyChangeListener, css::ui::XSidebar, css::frame::XStatusListener, - css::frame::XFrameActionListener, - css::lang::XUnoTunnel + css::frame::XFrameActionListener > SidebarControllerInterfaceBase; class SfxSplitWindow; @@ -177,9 +175,6 @@ public: static SidebarController* GetSidebarControllerForView(const SfxViewShell* pViewShell); - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - private: SidebarController(SidebarDockingWindow* pParentWindow, const SfxViewFrame* pViewFrame); diff --git a/include/svx/linectrl.hxx b/include/svx/linectrl.hxx index 983242b776d2..e2cd9e6c8852 100644 --- a/include/svx/linectrl.hxx +++ b/include/svx/linectrl.hxx @@ -19,8 +19,6 @@ #ifndef INCLUDED_SVX_LINECTRL_HXX #define INCLUDED_SVX_LINECTRL_HXX -#include <com/sun/star/lang/XUnoTunnel.hpp> -#include <cppuhelper/implbase.hxx> #include <sfx2/tbxctrl.hxx> #include <svtools/popupwindowcontroller.hxx> #include <svx/svxdllapi.h> @@ -37,8 +35,7 @@ typedef std::function<bool(const OUString&, const css::uno::Any&)> LineStyleSele typedef std::function<void(bool)> LineStyleIsNoneFunction; // SvxLineStyleController: -class SVXCORE_DLLPUBLIC SvxLineStyleToolBoxControl final : - public cppu::ImplInheritanceHelper<svt::PopupWindowController, css::lang::XUnoTunnel> +class SVXCORE_DLLPUBLIC SvxLineStyleToolBoxControl final : public svt::PopupWindowController { private: std::unique_ptr<svx::ToolboxButtonLineStyleUpdater> m_xBtnUpdater; @@ -56,9 +53,6 @@ public: virtual OUString SAL_CALL getImplementationName() override; virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - virtual void SAL_CALL execute(sal_Int16 nKeyModifier) override; virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent& rEvent) override; diff --git a/include/toolkit/awt/vclxaccessiblecomponent.hxx b/include/toolkit/awt/vclxaccessiblecomponent.hxx index dd25c76c2c2d..7c299edf6d65 100644 --- a/include/toolkit/awt/vclxaccessiblecomponent.hxx +++ b/include/toolkit/awt/vclxaccessiblecomponent.hxx @@ -22,8 +22,7 @@ #include <toolkit/dllapi.h> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> -#include <cppuhelper/implbase2.hxx> +#include <cppuhelper/implbase1.hxx> #include <comphelper/accimplaccess.hxx> #include <comphelper/accessiblecomponenthelper.hxx> @@ -43,8 +42,8 @@ class AccessibleRelationSetHelper; -typedef ::cppu::ImplHelper2< - css::lang::XServiceInfo, css::lang::XUnoTunnel > VCLXAccessibleComponent_BASE; +typedef ::cppu::ImplHelper1< + css::lang::XServiceInfo > VCLXAccessibleComponent_BASE; class TOOLKIT_DLLPUBLIC VCLXAccessibleComponent :public comphelper::OAccessibleExtendedComponentHelper @@ -90,9 +89,6 @@ public: virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - // css::accessibility::XAccessibleContext sal_Int64 SAL_CALL getAccessibleChildCount( ) override; css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override; diff --git a/include/vbahelper/vbashaperange.hxx b/include/vbahelper/vbashaperange.hxx index a814de1afba1..dfcca6c82549 100644 --- a/include/vbahelper/vbashaperange.hxx +++ b/include/vbahelper/vbashaperange.hxx @@ -21,7 +21,6 @@ #include <exception> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/uno/RuntimeException.hpp> @@ -50,7 +49,7 @@ namespace ooo::vba { namespace msforms { class XShape; } } -typedef CollTestImplHelper< ov::msforms::XShapeRange, css::lang::XUnoTunnel > ScVbaShapeRange_BASE; +typedef CollTestImplHelper< ov::msforms::XShapeRange > ScVbaShapeRange_BASE; class VBAHELPER_DLLPUBLIC ScVbaShapeRange final : public ScVbaShapeRange_BASE { @@ -97,10 +96,6 @@ public: //XEnumerationAccess virtual css::uno::Type SAL_CALL getElementType() override; virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override; - - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - // ScVbaCollectionBaseImpl virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ) override; }; diff --git a/include/vbahelper/vbashapes.hxx b/include/vbahelper/vbashapes.hxx index fabacae0732c..7131d8118031 100644 --- a/include/vbahelper/vbashapes.hxx +++ b/include/vbahelper/vbashapes.hxx @@ -23,7 +23,6 @@ #include <string_view> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/uno/RuntimeException.hpp> @@ -51,7 +50,7 @@ namespace ooo::vba { namespace msforms { class XShapeRange; } } -typedef CollTestImplHelper< ov::msforms::XShapes, css::lang::XUnoTunnel > ScVbaShapes_BASE; +typedef CollTestImplHelper< ov::msforms::XShapes > ScVbaShapes_BASE; class VBAHELPER_DLLPUBLIC ScVbaShapes final : public ScVbaShapes_BASE { @@ -86,9 +85,6 @@ public: virtual css::uno::Type SAL_CALL getElementType() override; virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override; - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - virtual void SAL_CALL SelectAll() override; //helper::calc virtual css::uno::Any SAL_CALL AddLine( sal_Int32 StartX, sal_Int32 StartY, sal_Int32 endX, sal_Int32 endY ) override; diff --git a/include/vcl/weldutils.hxx b/include/vcl/weldutils.hxx index 24f1a1cc1ef7..8a4c128515a0 100644 --- a/include/vcl/weldutils.hxx +++ b/include/vcl/weldutils.hxx @@ -14,11 +14,9 @@ #include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/frame/XStatusListener.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/uno/Reference.hxx> #include <comphelper/interfacecontainer4.hxx> #include <comphelper/compbase.hxx> -#include <comphelper/servicehelper.hxx> #include <tools/time.hxx> #include <vcl/dllapi.h> #include <vcl/formatter.hxx> @@ -35,8 +33,7 @@ class Window; namespace weld { -typedef comphelper::WeakComponentImplHelper<css::awt::XWindow, css::lang::XUnoTunnel> - TransportAsXWindow_Base; +typedef comphelper::WeakComponentImplHelper<css::awt::XWindow> TransportAsXWindow_Base; class VCL_DLLPUBLIC TransportAsXWindow : public TransportAsXWindow_Base { @@ -171,13 +168,6 @@ public: std::unique_lock g(m_aMutex); m_aPaintListeners.removeInterface(g, rListener); } - - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const& aIdentifier) override - { - return comphelper::getSomethingImpl(aIdentifier, this); - } - - static css::uno::Sequence<sal_Int8> const& getUnoTunnelId(); }; // don't export to avoid duplicate WeakImplHelper definitions with MSVC diff --git a/include/xmloff/settingsstore.hxx b/include/xmloff/settingsstore.hxx index 8f83a8a0e20a..339e71bbd1a7 100644 --- a/include/xmloff/settingsstore.hxx +++ b/include/xmloff/settingsstore.hxx @@ -12,10 +12,7 @@ #ifndef INCLUDED_XMLOFF_SETTINGSSTORE_HXX #define INCLUDED_XMLOFF_SETTINGSSTORE_HXX -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/uno/Sequence.hxx> -#include <cppuhelper/implbase.hxx> -#include <xmloff/dllapi.h> namespace com::sun::star::beans { struct PropertyValue; } namespace com::sun::star::embed { class XStorage; } @@ -23,9 +20,7 @@ namespace com::sun::star::uno { template <typename > class Reference; } // Scans list of properties for certain URL properties that could refer // to internal objects, and initializes from these. -class XMLOFF_DLLPUBLIC DocumentSettingsSerializer: - public cppu::WeakImplHelper<css::lang::XUnoTunnel> -{ +class SAL_DLLPUBLIC_RTTI SAL_LOPLUGIN_ANNOTATE("crosscast") DocumentSettingsSerializer { public: // Import objects and update properties (eliding URLs) virtual css::uno::Sequence<css::beans::PropertyValue> @@ -39,11 +34,8 @@ public: const css::uno::Reference< css::embed::XStorage > &xStorage, const css::uno::Sequence<css::beans::PropertyValue>& aConfigProps ) = 0; - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - protected: - ~DocumentSettingsSerializer() override; + ~DocumentSettingsSerializer() {} }; #endif // INCLUDED_XMLOFF_SETTINGSSTORE_HXX diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index 14c7b92556b1..26873175268d 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -176,7 +176,7 @@ public: virtual void SAL_CALL setDocumentLocator(const css::uno::Reference< css::xml::sax::XLocator > & xLocator) override; }; -class XMLOFF_DLLPUBLIC SvXMLImport : public cppu::WeakImplHelper< +class XMLOFF_DLLPUBLIC SAL_LOPLUGIN_ANNOTATE("crosscast") SvXMLImport : public cppu::WeakImplHelper< css::xml::sax::XFastDocumentHandler, css::lang::XServiceInfo, css::lang::XInitialization, diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx index 2300b7343268..581f356f215e 100644 --- a/linguistic/source/gciterator.cxx +++ b/linguistic/source/gciterator.cxx @@ -50,7 +50,6 @@ #include <i18nlangtag/languagetag.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/propertysequence.hxx> -#include <comphelper/servicehelper.hxx> #include <tools/debug.hxx> #include <comphelper/diagnose_ex.hxx> @@ -1168,16 +1167,6 @@ uno::Sequence< OUString > GrammarCheckingIterator::GetServiceList( } -sal_Int64 GrammarCheckingIterator::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl(aIdentifier, this); -} - -css::uno::Sequence<sal_Int8> const & GrammarCheckingIterator::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); -} - - extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* linguistic_GrammarCheckingIterator_get_implementation( css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&) diff --git a/linguistic/source/gciterator.hxx b/linguistic/source/gciterator.hxx index 55e2527e6e9b..c4cc076b3c9b 100644 --- a/linguistic/source/gciterator.hxx +++ b/linguistic/source/gciterator.hxx @@ -24,7 +24,6 @@ #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XEventListener.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/linguistic2/XProofreadingIterator.hpp> #include <com/sun/star/linguistic2/XLinguServiceEventListener.hpp> #include <com/sun/star/linguistic2/XLinguServiceEventBroadcaster.hpp> @@ -79,8 +78,7 @@ class GrammarCheckingIterator: css::linguistic2::XLinguServiceEventListener, css::linguistic2::XLinguServiceEventBroadcaster, css::lang::XComponent, - css::lang::XServiceInfo, - css::lang::XUnoTunnel + css::lang::XServiceInfo >, public LinguDispatcher { @@ -181,9 +179,6 @@ public: // LinguDispatcher virtual void SetServiceList( const css::lang::Locale &rLocale, const css::uno::Sequence< OUString > &rSvcImplNames ) override; virtual css::uno::Sequence< OUString > GetServiceList( const css::lang::Locale &rLocale ) const override; - - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); }; diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index 7ef56cb10fb8..f38ee262099c 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -38,7 +38,6 @@ #include <comphelper/interfacecontainer2.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/sequence.hxx> -#include <comphelper/servicehelper.hxx> #include <i18nlangtag/lang.h> #include <i18nlangtag/languagetag.hxx> #include <cppuhelper/factory.hxx> @@ -891,7 +890,7 @@ void LngSvcMgr::GetGrammarCheckerDsp_Impl( bool bSetSvcList ) if (xGCI.is()) { - mxGrammarDsp = comphelper::getFromUnoTunnel< GrammarCheckingIterator >(xGCI); + mxGrammarDsp = dynamic_cast< GrammarCheckingIterator * >(xGCI.get()); SAL_WARN_IF( mxGrammarDsp == nullptr, "linguistic", "failed to get implementation" ); if (bSetSvcList && mxGrammarDsp.is()) SetCfgServiceLists( *mxGrammarDsp ); diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 7cd02f77f91f..c7d4567dd0c2 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -57,7 +57,6 @@ #include <comphelper/propertysequence.hxx> #include <comphelper/propertyvalue.hxx> #include <comphelper/sequence.hxx> -#include <comphelper/servicehelper.hxx> #include <comphelper/diagnose_ex.hxx> #include <tools/gen.hxx> #include <tools/globname.hxx> @@ -1157,7 +1156,7 @@ Reference< XShape > const & Shape::createAndInsert( { uno::Reference<uno::XInterface> const xMathModel(xObj->getComponent()); oox::FormulaImExportBase *const pMagic( - comphelper::getFromUnoTunnel<oox::FormulaImExportBase>(xMathModel)); + dynamic_cast<oox::FormulaImExportBase*>(xMathModel.get())); assert(pMagic); pMagic->readFormulaOoxml(*pMathXml); } diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index ce3787069adb..137c69fe7c33 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -71,7 +71,6 @@ #include <tools/globname.hxx> #include <comphelper/classids.hxx> #include <comphelper/propertysequence.hxx> -#include <comphelper/servicehelper.hxx> #include <comphelper/storagehelper.hxx> #include <sot/exchange.hxx> #include <utility> @@ -2474,7 +2473,7 @@ void ShapeExport::WriteMathShape(Reference<XShape> const& xShape) mpFS->startElementNS(XML_a14, XML_m); oox::FormulaImExportBase *const pMagic( - comphelper::getFromUnoTunnel<oox::FormulaImExportBase>(xMathModel)); + dynamic_cast<oox::FormulaImExportBase*>(xMathModel.get())); assert(pMagic); pMagic->writeFormulaOoxml(GetFS(), GetFB()->getVersion(), GetDocumentType(), FormulaImExportBase::eFormulaAlign::INLINE); diff --git a/oox/source/mathml/imexport.cxx b/oox/source/mathml/imexport.cxx index ad0389051b42..2b5990679bea 100644 --- a/oox/source/mathml/imexport.cxx +++ b/oox/source/mathml/imexport.cxx @@ -13,7 +13,6 @@ #include <oox/core/contexthandler.hxx> #include <oox/token/namespaces.hxx> -#include <comphelper/servicehelper.hxx> #include <drawingml/textparagraph.hxx> @@ -22,15 +21,6 @@ using namespace ::com::sun::star; namespace oox { -sal_Int64 FormulaImExportBase::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl(aIdentifier, this); -} - -css::uno::Sequence<sal_Int8> const & FormulaImExportBase::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); -} - FormulaImExportBase::FormulaImExportBase() { } diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx index 3f919548d47d..eb3da46309f8 100644 --- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx @@ -28,7 +28,6 @@ #include <com/sun/star/reflection/ProxyFactory.hpp> #include <comphelper/sequenceashashmap.hxx> #include <comphelper/namedvaluecollection.hxx> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <utility> #include <xmloff/attrlist.hxx> @@ -340,7 +339,7 @@ void SAL_CALL ImportDocumentHandler::initialize( const uno::Sequence< uno::Any > if (!m_xDocumentHandler.is() || !m_xModel.is()) throw uno::Exception("no delegatee and no model", nullptr); - m_xDelegatee.set(new SvXMLLegacyToFastDocHandler(comphelper::getFromUnoTunnel<SvXMLImport>(m_xDocumentHandler))); + m_xDelegatee.set(new SvXMLLegacyToFastDocHandler(dynamic_cast<SvXMLImport*>(m_xDocumentHandler.get()))); m_xDatabaseDataProvider.set(m_xModel->getDataProvider(),uno::UNO_QUERY); if ( !m_xDatabaseDataProvider.is() ) diff --git a/sc/source/ui/sidebar/ScPanelFactory.cxx b/sc/source/ui/sidebar/ScPanelFactory.cxx index f9534fec548e..bbcff315c289 100644 --- a/sc/source/ui/sidebar/ScPanelFactory.cxx +++ b/sc/source/ui/sidebar/ScPanelFactory.cxx @@ -29,7 +29,6 @@ #include <vcl/weldutils.hxx> #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> #include <comphelper/namedvaluecollection.hxx> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/exc_hlp.hxx> #include <cppuhelper/supportsservice.hxx> @@ -61,7 +60,7 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement ( SfxBindings* pBindings = reinterpret_cast<SfxBindings*>(nBindingsValue); weld::Widget* pParent(nullptr); - if (weld::TransportAsXWindow* pTunnel = comphelper::getFromUnoTunnel<weld::TransportAsXWindow>(xParentWindow)) + if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(xParentWindow.get())) pParent = pTunnel->getWidget(); if (!pParent) diff --git a/sc/source/ui/vba/vbapagebreaks.cxx b/sc/source/ui/vba/vbapagebreaks.cxx index ea89c79819d3..b9a0235c34f3 100644 --- a/sc/source/ui/vba/vbapagebreaks.cxx +++ b/sc/source/ui/vba/vbapagebreaks.cxx @@ -22,11 +22,9 @@ #include <cppuhelper/implbase.hxx> #include <ooo/vba/excel/XWorksheet.hpp> #include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/sheet/XSheetPageBreak.hpp> #include <com/sun/star/table/XColumnRowRange.hpp> #include <com/sun/star/uno/XComponentContext.hpp> -#include <comphelper/servicehelper.hxx> #include <utility> using namespace ::com::sun::star; @@ -34,8 +32,7 @@ using namespace ::ooo::vba; namespace { -class RangePageBreaks : - public ::cppu::WeakImplHelper<container::XIndexAccess, css::lang::XUnoTunnel > +class RangePageBreaks : public ::cppu::WeakImplHelper<container::XIndexAccess > { private: uno::Reference< XHelperInterface > mxParent; @@ -106,15 +103,6 @@ public: { return true; } - - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override { - return comphelper::getSomethingImpl(aIdentifier, this); - } - - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); - } }; } @@ -233,8 +221,7 @@ ScVbaHPageBreaks::ScVbaHPageBreaks( const uno::Reference< XHelperInterface >& xP uno::Any SAL_CALL ScVbaHPageBreaks::Add( const uno::Any& Before) { - RangePageBreaks* pPageBreaks - = comphelper::getFromUnoTunnel< RangePageBreaks >( m_xIndexAccess ); + RangePageBreaks* pPageBreaks = dynamic_cast< RangePageBreaks* >( m_xIndexAccess.get() ); if( pPageBreaks ) { return pPageBreaks->Add( Before ); @@ -291,8 +278,7 @@ ScVbaVPageBreaks::~ScVbaVPageBreaks() uno::Any SAL_CALL ScVbaVPageBreaks::Add( const uno::Any& Before ) { - RangePageBreaks* pPageBreaks - = comphelper::getFromUnoTunnel< RangePageBreaks >( m_xIndexAccess ); + RangePageBreaks* pPageBreaks = dynamic_cast< RangePageBreaks* >( m_xIndexAccess.get() ); if( pPageBreaks ) { return pPageBreaks->Add( Before ); diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk index 2b907d35bbff..1a3a87174098 100644 --- a/sd/Library_sd.mk +++ b/sd/Library_sd.mk @@ -97,7 +97,6 @@ $(eval $(call gb_Library_use_libraries,sd,\ ucbhelper \ utl \ vcl \ - xo \ $(if $(ENABLE_NSS),xmlsecurity) \ )) diff --git a/sd/inc/Annotation.hxx b/sd/inc/Annotation.hxx index b23cd2503bb3..707f2cdc8e78 100644 --- a/sd/inc/Annotation.hxx +++ b/sd/inc/Annotation.hxx @@ -23,7 +23,6 @@ #include <sal/types.h> #include <memory> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/office/XAnnotation.hpp> #include <cppuhelper/basemutex.hxx> #include <cppuhelper/compbase.hxx> @@ -75,8 +74,7 @@ struct SD_DLLPUBLIC CustomAnnotationMarker }; class Annotation final : private ::cppu::BaseMutex, - public ::cppu::WeakComponentImplHelper< - css::office::XAnnotation, css::lang::XUnoTunnel>, + public ::cppu::WeakComponentImplHelper<css::office::XAnnotation>, public ::cppu::PropertySetMixin<css::office::XAnnotation> { public: @@ -92,8 +90,8 @@ public: // XInterface: virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const & type) override; - virtual void SAL_CALL acquire() noexcept override { WeakComponentImplHelper::acquire(); } - virtual void SAL_CALL release() noexcept override { WeakComponentImplHelper::release(); } + virtual void SAL_CALL acquire() noexcept override { ::cppu::WeakComponentImplHelper<css::office::XAnnotation>::acquire(); } + virtual void SAL_CALL release() noexcept override { ::cppu::WeakComponentImplHelper<css::office::XAnnotation>::release(); } // css::beans::XPropertySet: virtual css::uno::Reference<css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() override; @@ -118,9 +116,6 @@ public: virtual void SAL_CALL setDateTime(const css::util::DateTime & the_value) override; virtual css::uno::Reference<css::text::XText> SAL_CALL getTextRange() override; - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - void createChangeUndo(); void createCustomAnnotationMarker() diff --git a/sd/inc/textapi.hxx b/sd/inc/textapi.hxx index be7396358468..70110349053a 100644 --- a/sd/inc/textapi.hxx +++ b/sd/inc/textapi.hxx @@ -43,8 +43,7 @@ public: void SetText( OutlinerParaObject const & rText ); OUString GetText() const; - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); + static TextApiObject* getImplementation( const css::uno::Reference< css::text::XText >& ); private: std::unique_ptr<TextAPIEditSource> mpSource; diff --git a/sd/source/core/annotations/Annotation.cxx b/sd/source/core/annotations/Annotation.cxx index 1cd608c69e00..991412f063d5 100644 --- a/sd/source/core/annotations/Annotation.cxx +++ b/sd/source/core/annotations/Annotation.cxx @@ -26,7 +26,6 @@ #include <comphelper/processfactory.hxx> #include <comphelper/lok.hxx> -#include <comphelper/servicehelper.hxx> #include <unotools/datetime.hxx> @@ -119,7 +118,7 @@ void createAnnotation(uno::Reference<office::XAnnotation>& xAnnotation, SdPage* sal_uInt32 Annotation::m_nLastId = 1; Annotation::Annotation( const uno::Reference<uno::XComponentContext>& context, SdPage* pPage ) -: WeakComponentImplHelper(m_aMutex) +: ::cppu::WeakComponentImplHelper<office::XAnnotation>(m_aMutex) , ::cppu::PropertySetMixin<office::XAnnotation>(context, IMPLEMENTS_PROPERTY_SET, uno::Sequence<OUString>()) , m_nId( m_nLastId++ ) , mpPage( pPage ) @@ -142,7 +141,7 @@ void SAL_CALL Annotation::disposing() uno::Any Annotation::queryInterface(css::uno::Type const & type) { - return WeakComponentImplHelper::queryInterface(type); + return ::cppu::WeakComponentImplHelper<office::XAnnotation>::queryInterface(type); } // com.sun.star.beans.XPropertySet: @@ -302,18 +301,9 @@ uno::Reference<text::XText> SAL_CALL Annotation::getTextRange() return m_TextRange; } -sal_Int64 Annotation::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl(aIdentifier, this); -} - -css::uno::Sequence<sal_Int8> const & Annotation::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); -} - std::unique_ptr<SdrUndoAction> CreateUndoInsertOrRemoveAnnotation( const uno::Reference<office::XAnnotation>& xAnnotation, bool bInsert ) { - Annotation* pAnnotation = comphelper::getFromUnoTunnel< Annotation >( xAnnotation ); + Annotation* pAnnotation = dynamic_cast< Annotation* >( xAnnotation.get() ); if( pAnnotation ) { return std::make_unique< UndoInsertOrRemoveAnnotation >( *pAnnotation, bInsert ); @@ -326,14 +316,14 @@ std::unique_ptr<SdrUndoAction> CreateUndoInsertOrRemoveAnnotation( const uno::Re void CreateChangeUndo(const uno::Reference<office::XAnnotation>& xAnnotation) { - Annotation* pAnnotation = comphelper::getFromUnoTunnel<Annotation>(xAnnotation); + Annotation* pAnnotation = dynamic_cast<Annotation*>(xAnnotation.get()); if (pAnnotation) pAnnotation->createChangeUndo(); } sal_uInt32 getAnnotationId(const uno::Reference<office::XAnnotation>& xAnnotation) { - Annotation* pAnnotation = comphelper::getFromUnoTunnel<Annotation>(xAnnotation); + Annotation* pAnnotation = dynamic_cast<Annotation*>(xAnnotation.get()); sal_uInt32 nId = 0; if (pAnnotation) nId = pAnnotation->GetId(); @@ -342,7 +332,7 @@ sal_uInt32 getAnnotationId(const uno::Reference<office::XAnnotation>& xAnnotatio const SdPage* getAnnotationPage(const uno::Reference<office::XAnnotation>& xAnnotation) { - Annotation* pAnnotation = comphelper::getFromUnoTunnel<Annotation>(xAnnotation); + Annotation* pAnnotation = dynamic_cast<Annotation*>(xAnnotation.get()); if (pAnnotation) return pAnnotation->GetPage(); return nullptr; diff --git a/sd/source/core/text/textapi.cxx b/sd/source/core/text/textapi.cxx index d855b3cb3ebe..8c342f1fda63 100644 --- a/sd/source/core/text/textapi.cxx +++ b/sd/source/core/text/textapi.cxx @@ -23,7 +23,6 @@ #include <textapi.hxx> #include <drawdoc.hxx> -#include <comphelper/servicehelper.hxx> #include <editeng/eeitem.hxx> #include <editeng/editeng.hxx> #include <editeng/outlobj.hxx> @@ -180,14 +179,14 @@ OUString TextApiObject::GetText() const return mpSource->GetText(); } -sal_Int64 TextApiObject::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl( - aIdentifier, this, comphelper::FallbackToGetSomethingOf<SvxUnoText>{}); -} +TextApiObject* TextApiObject::getImplementation( const css::uno::Reference< css::text::XText >& xText ) +{ + TextApiObject* pImpl = dynamic_cast< TextApiObject* >( xText.get() ); + + if( !pImpl ) + pImpl = dynamic_cast< TextApiObject* >( comphelper::getFromUnoTunnel<SvxUnoTextBase>( xText ) ); -css::uno::Sequence<sal_Int8> const & TextApiObject::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); + return pImpl; } TextAPIEditSource::TextAPIEditSource(const TextAPIEditSource& rSource) diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx index f79f91a8d7c0..7afe26ee54b0 100644 --- a/sd/source/ui/annotations/annotationtag.cxx +++ b/sd/source/ui/annotations/annotationtag.cxx @@ -28,7 +28,6 @@ #include <vcl/settings.hxx> #include <vcl/weldutils.hxx> -#include <comphelper/servicehelper.hxx> #include <svx/sdr/overlay/overlayanimatedbitmapex.hxx> #include <svx/sdr/overlay/overlaybitmapex.hxx> #include <svx/sdr/overlay/overlaypolypolygon.hxx> @@ -226,7 +225,7 @@ void AnnotationHdl::CreateB2dIAObject() { std::unique_ptr<sdr::overlay::OverlayObject> pOverlayObject; - auto* pAnnotation = comphelper::getFromUnoTunnel<sd::Annotation>(mxAnnotation); + auto* pAnnotation = dynamic_cast<sd::Annotation*>(mxAnnotation.get()); if (pAnnotation && pAnnotation->hasCustomAnnotationMarker()) { diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx index cc392994cb56..6c1210575915 100644 --- a/sd/source/ui/annotations/annotationwindow.cxx +++ b/sd/source/ui/annotations/annotationwindow.cxx @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <comphelper/servicehelper.hxx> #include <editeng/eeitem.hxx> #include <editeng/udlnitem.hxx> #include <editeng/langitem.hxx> @@ -488,7 +487,7 @@ TextApiObject* getTextApiObject( const Reference< XAnnotation >& xAnnotation ) if( xAnnotation.is() ) { Reference< XText > xText( xAnnotation->getTextRange() ); - return comphelper::getFromUnoTunnel<TextApiObject>( xText ); + return TextApiObject::getImplementation( xText ); } return nullptr; } diff --git a/sd/source/ui/sidebar/PanelFactory.cxx b/sd/source/ui/sidebar/PanelFactory.cxx index a8e5add252c5..c7ca8c25c4c8 100644 --- a/sd/source/ui/sidebar/PanelFactory.cxx +++ b/sd/source/ui/sidebar/PanelFactory.cxx @@ -67,7 +67,7 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement ( // Throw exceptions when the arguments are not as expected. weld::Widget* pParent(nullptr); - if (weld::TransportAsXWindow* pTunnel = comphelper::getFromUnoTunnel<weld::TransportAsXWindow>(xParentWindow)) + if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(xParentWindow.get())) pParent = pTunnel->getWidget(); if (!pParent) diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx index b4b4baf74ce8..331f90b53a50 100644 --- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx +++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx @@ -69,10 +69,9 @@ namespace sd { namespace { - class DocumentSettings : public ImplInheritanceHelper< - DocumentSettingsSerializer, XPropertySet, XMultiPropertySet, - XServiceInfo >, - public comphelper::PropertySetHelper + class DocumentSettings : public WeakImplHelper< XPropertySet, XMultiPropertySet, XServiceInfo >, + public comphelper::PropertySetHelper, + public DocumentSettingsSerializer { public: explicit DocumentSettings( SdXImpressDocument* pModel ); @@ -1337,17 +1336,17 @@ DocumentSettings::_getPropertyValues( // XInterface Any SAL_CALL DocumentSettings::queryInterface( const Type& aType ) { - return ImplInheritanceHelper::queryInterface( aType ); + return WeakImplHelper< XPropertySet, XMultiPropertySet, XServiceInfo >::queryInterface( aType ); } void SAL_CALL DocumentSettings::acquire( ) noexcept { - ImplInheritanceHelper::acquire(); + WeakImplHelper< XPropertySet, XMultiPropertySet, XServiceInfo >::acquire(); } void SAL_CALL DocumentSettings::release( ) noexcept { - ImplInheritanceHelper::release(); + WeakImplHelper< XPropertySet, XMultiPropertySet, XServiceInfo >::release(); } // XPropertySet diff --git a/sdext/source/pdfimport/sax/emitcontext.cxx b/sdext/source/pdfimport/sax/emitcontext.cxx index 59f110191bfd..a923488d688d 100644 --- a/sdext/source/pdfimport/sax/emitcontext.cxx +++ b/sdext/source/pdfimport/sax/emitcontext.cxx @@ -25,7 +25,6 @@ #include <rtl/strbuf.hxx> #include <osl/diagnose.h> #include <com/sun/star/xml/sax/SAXException.hpp> -#include <comphelper/servicehelper.hxx> #include <xmloff/xmlimp.hxx> #if OSL_DEBUG_LEVEL > 0 @@ -43,7 +42,7 @@ SaxEmitter::SaxEmitter( const uno::Reference< xml::sax::XDocumentHandler >& xDoc m_xDocHdl( xDocHdl ) { OSL_PRECOND(m_xDocHdl.is(), "SaxEmitter(): invalid doc handler"); - if (SvXMLImport *pFastHandler = comphelper::getFromUnoTunnel<SvXMLImport>(m_xDocHdl)) + if (SvXMLImport *pFastHandler = dynamic_cast<SvXMLImport*>(m_xDocHdl.get())) m_xDocHdl.set( new SvXMLLegacyToFastDocHandler( pFastHandler ) ); try { diff --git a/sdext/source/presenter/PresenterAccessibility.cxx b/sdext/source/presenter/PresenterAccessibility.cxx index 7040da4a3c51..4f2fa33f3866 100644 --- a/sdext/source/presenter/PresenterAccessibility.cxx +++ b/sdext/source/presenter/PresenterAccessibility.cxx @@ -38,7 +38,6 @@ #include <com/sun/star/drawing/framework/XPane.hpp> #include <com/sun/star/drawing/framework/XView.hpp> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/compbase.hxx> #include <cppuhelper/implbase.hxx> #include <o3tl/safeint.hxx> @@ -514,7 +513,7 @@ void PresenterAccessible::UpdateAccessibilityHierarchy() if (pNotesPane) xNotesView = pNotesPane->mxView; rtl::Reference<PresenterNotesView> pNotesView ( - comphelper::getFromUnoTunnel<PresenterNotesView>(xNotesView)); + dynamic_cast<PresenterNotesView*>(xNotesView.get())); UpdateAccessibilityHierarchy( pPreviewPane ? pPreviewPane->mxContentWindow : Reference<awt::XWindow>(), diff --git a/sdext/source/presenter/PresenterNotesView.cxx b/sdext/source/presenter/PresenterNotesView.cxx index 7bfc1bfa2c06..457be1f612b7 100644 --- a/sdext/source/presenter/PresenterNotesView.cxx +++ b/sdext/source/presenter/PresenterNotesView.cxx @@ -37,7 +37,6 @@ #include <com/sun/star/rendering/CompositeOperation.hpp> #include <com/sun/star/rendering/XSpriteCanvas.hpp> #include <com/sun/star/text/XTextRange.hpp> -#include <comphelper/servicehelper.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -377,16 +376,6 @@ void SAL_CALL PresenterNotesView::keyPressed (const awt::KeyEvent& rEvent) void SAL_CALL PresenterNotesView::keyReleased (const awt::KeyEvent&) {} -sal_Int64 PresenterNotesView::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl( - aIdentifier, this, comphelper::FallbackToGetSomethingOf<CachablePresenterView>{}); -} - -css::uno::Sequence<sal_Int8> const & PresenterNotesView::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); -} - void PresenterNotesView::Layout() { diff --git a/sdext/source/presenter/PresenterNotesView.hxx b/sdext/source/presenter/PresenterNotesView.hxx index 05368a7151c6..1af3f241f004 100644 --- a/sdext/source/presenter/PresenterNotesView.hxx +++ b/sdext/source/presenter/PresenterNotesView.hxx @@ -31,7 +31,6 @@ #include <com/sun/star/drawing/framework/XView.hpp> #include <com/sun/star/drawing/framework/XResourceId.hpp> #include <com/sun/star/frame/XController.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <rtl/ref.hxx> #include <memory> @@ -46,8 +45,7 @@ typedef cppu::WeakComponentImplHelper< css::awt::XPaintListener, css::drawing::framework::XView, css::drawing::XDrawView, - css::awt::XKeyListener, - css::lang::XUnoTunnel + css::awt::XKeyListener > PresenterNotesViewInterfaceBase; /** A drawing framework view of the notes of a slide. At the moment this is @@ -119,9 +117,6 @@ public: virtual void SAL_CALL keyPressed (const css::awt::KeyEvent& rEvent) override; virtual void SAL_CALL keyReleased (const css::awt::KeyEvent& rEvent) override; - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - private: css::uno::Reference<css::drawing::framework::XResourceId> mxViewId; ::rtl::Reference<PresenterController> mpPresenterController; diff --git a/sdext/source/presenter/PresenterProtocolHandler.cxx b/sdext/source/presenter/PresenterProtocolHandler.cxx index bda104ce37d8..a32a73b6180e 100644 --- a/sdext/source/presenter/PresenterProtocolHandler.cxx +++ b/sdext/source/presenter/PresenterProtocolHandler.cxx @@ -24,7 +24,6 @@ #include "PresenterPaneContainer.hxx" #include "PresenterViewFactory.hxx" #include "PresenterWindowManager.hxx" -#include <comphelper/servicehelper.hxx> #include <cppuhelper/compbase.hxx> #include <cppuhelper/supportsservice.hxx> #include <algorithm> @@ -793,7 +792,7 @@ NotesFontSizeCommand::NotesFontSizeCommand( if (!pDescriptor) return nullptr; - return comphelper::getFromUnoTunnel<PresenterNotesView>(pDescriptor->mxView); + return dynamic_cast<PresenterNotesView*>(pDescriptor->mxView.get()); } void NotesFontSizeCommand::Execute() diff --git a/sdext/source/presenter/PresenterSlideShowView.cxx b/sdext/source/presenter/PresenterSlideShowView.cxx index be4cc6a65d20..132eaf35f85e 100644 --- a/sdext/source/presenter/PresenterSlideShowView.cxx +++ b/sdext/source/presenter/PresenterSlideShowView.cxx @@ -279,10 +279,6 @@ css::uno::Reference<css::drawing::XDrawPage> SAL_CALL PresenterSlideShowView::ge return mxCurrentSlide; } -sal_Int64 PresenterSlideShowView::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return CachablePresenterView::getSomething(aIdentifier); -} - //----- CachablePresenterView ------------------------------------------------- void PresenterSlideShowView::ReleaseView() diff --git a/sdext/source/presenter/PresenterSlideShowView.hxx b/sdext/source/presenter/PresenterSlideShowView.hxx index 7f93e4b0e6e2..e4466522eddf 100644 --- a/sdext/source/presenter/PresenterSlideShowView.hxx +++ b/sdext/source/presenter/PresenterSlideShowView.hxx @@ -32,7 +32,6 @@ #include <com/sun/star/drawing/framework/XResourceId.hpp> #include <com/sun/star/drawing/framework/XView.hpp> #include <com/sun/star/frame/XController.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/presentation/XSlideShowController.hpp> #include <com/sun/star/rendering/XPolyPolygon2D.hpp> #include <com/sun/star/uno/XComponentContext.hpp> @@ -48,8 +47,7 @@ typedef cppu::WeakComponentImplHelper< css::awt::XMouseMotionListener, css::awt::XWindowListener, css::drawing::framework::XView, - css::drawing::XDrawView, - css::lang::XUnoTunnel + css::drawing::XDrawView > PresenterSlideShowViewInterfaceBase; /** Life view in a secondary window of a full screen slide show. @@ -168,10 +166,6 @@ public: virtual css::uno::Reference<css::drawing::XDrawPage> SAL_CALL getCurrentPage() override; - // XUnoTunnel - - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - // CachablePresenterView virtual void ActivatePresenterView() override; diff --git a/sdext/source/presenter/PresenterSlideSorter.cxx b/sdext/source/presenter/PresenterSlideSorter.cxx index 1b3fb0a1d753..ef33a4dde634 100644 --- a/sdext/source/presenter/PresenterSlideSorter.cxx +++ b/sdext/source/presenter/PresenterSlideSorter.cxx @@ -612,11 +612,6 @@ Reference<drawing::XDrawPage> SAL_CALL PresenterSlideSorter::getCurrentPage() } -sal_Int64 PresenterSlideSorter::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return CachablePresenterView::getSomething(aIdentifier); -} - - void PresenterSlideSorter::UpdateLayout() { if ( ! mxWindow.is()) diff --git a/sdext/source/presenter/PresenterSlideSorter.hxx b/sdext/source/presenter/PresenterSlideSorter.hxx index 7f1f3ac845d8..807bc439929e 100644 --- a/sdext/source/presenter/PresenterSlideSorter.hxx +++ b/sdext/source/presenter/PresenterSlideSorter.hxx @@ -35,7 +35,6 @@ #include <com/sun/star/drawing/framework/XResourceId.hpp> #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/geometry/RealRectangle2D.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/rendering/XPolyPolygon2D.hpp> namespace sdext::presenter { @@ -51,8 +50,7 @@ typedef cppu::WeakComponentImplHelper< css::drawing::XSlidePreviewCacheListener, css::awt::XMouseListener, css::awt::XMouseMotionListener, - css::drawing::XDrawView, - css::lang::XUnoTunnel + css::drawing::XDrawView > PresenterSlideSorterInterfaceBase; /** A simple slide sorter for the presenter screen. It uses a preview cache @@ -131,10 +129,6 @@ public: virtual css::uno::Reference<css::drawing::XDrawPage> SAL_CALL getCurrentPage() override; - // XUnoTunnel - - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - private: css::uno::Reference<css::uno::XComponentContext> mxComponentContext; css::uno::Reference<css::drawing::framework::XResourceId> mxViewId; diff --git a/sdext/source/presenter/PresenterToolBar.cxx b/sdext/source/presenter/PresenterToolBar.cxx index b095975680e4..867459423d8e 100644 --- a/sdext/source/presenter/PresenterToolBar.cxx +++ b/sdext/source/presenter/PresenterToolBar.cxx @@ -575,11 +575,6 @@ Reference<drawing::XDrawPage> SAL_CALL PresenterToolBar::getCurrentPage() } -sal_Int64 PresenterToolBar::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return CachablePresenterView::getSomething(aIdentifier); -} - - void PresenterToolBar::CreateControls ( const OUString& rsConfigurationPath) { diff --git a/sdext/source/presenter/PresenterToolBar.hxx b/sdext/source/presenter/PresenterToolBar.hxx index 50937ea8d3bd..1b789955689c 100644 --- a/sdext/source/presenter/PresenterToolBar.hxx +++ b/sdext/source/presenter/PresenterToolBar.hxx @@ -34,7 +34,6 @@ #include <com/sun/star/drawing/framework/XView.hpp> #include <com/sun/star/drawing/framework/XResourceId.hpp> #include <com/sun/star/frame/XController.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <functional> @@ -45,8 +44,7 @@ typedef cppu::WeakComponentImplHelper< css::awt::XPaintListener, css::awt::XMouseListener, css::awt::XMouseMotionListener, - css::drawing::XDrawView, - css::lang::XUnoTunnel + css::drawing::XDrawView > PresenterToolBarInterfaceBase; typedef cppu::WeakComponentImplHelper< @@ -136,10 +134,6 @@ public: virtual css::uno::Reference<css::drawing::XDrawPage> SAL_CALL getCurrentPage() override; - // XUnoTunnel - - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - class Context; private: diff --git a/sdext/source/presenter/PresenterViewFactory.cxx b/sdext/source/presenter/PresenterViewFactory.cxx index 2768edf763ab..06eff32f7d3f 100644 --- a/sdext/source/presenter/PresenterViewFactory.cxx +++ b/sdext/source/presenter/PresenterViewFactory.cxx @@ -26,7 +26,6 @@ #include "PresenterSlideSorter.hxx" #include "PresenterToolBar.hxx" #include <com/sun/star/drawing/framework/XControllerManager.hpp> -#include <comphelper/servicehelper.hxx> #include <utility> using namespace ::com::sun::star; @@ -216,7 +215,7 @@ void SAL_CALL PresenterViewFactory::releaseResource (const Reference<XResource>& pDescriptor->SetActivationState(false); // Dispose only views that we can not put into the cache. - CachablePresenterView* pView = comphelper::getFromUnoTunnel<CachablePresenterView>(rxView); + CachablePresenterView* pView = dynamic_cast<CachablePresenterView*>(rxView.get()); if (pView == nullptr || mpResourceCache == nullptr) { try @@ -272,7 +271,7 @@ Reference<XResource> PresenterViewFactory::GetViewFromCache( if (iView->second.second == rxAnchorPane) { CachablePresenterView* pView - = comphelper::getFromUnoTunnel<CachablePresenterView>(iView->second.first); + = dynamic_cast<CachablePresenterView*>(iView->second.first.get()); if (pView != nullptr) pView->ActivatePresenterView(); return iView->second.first; @@ -323,7 +322,7 @@ Reference<XResource> PresenterViewFactory::CreateView( } // Activate it. - CachablePresenterView* pView = comphelper::getFromUnoTunnel<CachablePresenterView>(xView); + CachablePresenterView* pView = dynamic_cast<CachablePresenterView*>(xView.get()); if (pView != nullptr) pView->ActivatePresenterView(); } @@ -481,15 +480,6 @@ void PresenterViewFactory::ThrowIfDisposed() const //===== CachablePresenterView ================================================= -sal_Int64 CachablePresenterView::getSomething(css::uno::Sequence<sal_Int8> const & id) { - return comphelper::getSomethingImpl(id, this); -} - -css::uno::Sequence<sal_Int8> const & CachablePresenterView::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); -} - CachablePresenterView::CachablePresenterView() : mbIsPresenterViewActive(true) { diff --git a/sdext/source/presenter/PresenterViewFactory.hxx b/sdext/source/presenter/PresenterViewFactory.hxx index 32429c790cff..7f3468d4e57a 100644 --- a/sdext/source/presenter/PresenterViewFactory.hxx +++ b/sdext/source/presenter/PresenterViewFactory.hxx @@ -39,7 +39,7 @@ typedef ::cppu::WeakComponentImplHelper < /** Base class for presenter views that allows the view factory to store them in a cache and reuse deactivated views. */ -class CachablePresenterView +class SAL_LOPLUGIN_ANNOTATE("crosscast") CachablePresenterView { public: virtual void ActivatePresenterView(); @@ -55,9 +55,6 @@ public: */ virtual void ReleaseView(); - sal_Int64 getSomething(css::uno::Sequence<sal_Int8> const & id); - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - protected: bool mbIsPresenterViewActive; diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk index 0c1f654d4a1e..7b1dee935ff3 100644 --- a/sfx2/Library_sfx.mk +++ b/sfx2/Library_sfx.mk @@ -213,7 +213,6 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\ sfx2/source/doc/QuerySaveDocument \ sfx2/source/doc/SfxDocumentMetaData \ sfx2/source/doc/autoredactdialog \ - sfx2/source/doc/digitalsignatures \ sfx2/source/doc/docfac \ sfx2/source/doc/docfile \ sfx2/source/doc/docfilt \ diff --git a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx index 736343310bd5..de0950a7edaf 100644 --- a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx +++ b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx @@ -14,7 +14,6 @@ #include <com/sun/star/view/XSelectionSupplier.hpp> -#include <comphelper/servicehelper.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/objsh.hxx> #include <sfx2/viewfrm.hxx> @@ -88,7 +87,7 @@ void DevelopmentToolDockingWindow::dispose() { // Stop and remove the listener auto* pSelectionChangeHandler - = comphelper::getFromUnoTunnel<SelectionChangeHandler>(mxSelectionListener); + = dynamic_cast<SelectionChangeHandler*>(mxSelectionListener.get()); if (pSelectionChangeHandler) pSelectionChangeHandler->stopListening(); diff --git a/sfx2/source/devtools/SelectionChangeHandler.hxx b/sfx2/source/devtools/SelectionChangeHandler.hxx index f919a2fe1400..57224e056a52 100644 --- a/sfx2/source/devtools/SelectionChangeHandler.hxx +++ b/sfx2/source/devtools/SelectionChangeHandler.hxx @@ -13,15 +13,12 @@ #include <sfx2/devtools/DevelopmentToolDockingWindow.hxx> #include <com/sun/star/frame/XController.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/view/XSelectionSupplier.hpp> #include <comphelper/compbase.hxx> -#include <comphelper/servicehelper.hxx> #include <utility> -typedef comphelper::WeakComponentImplHelper<css::view::XSelectionChangeListener, - css::lang::XUnoTunnel> +typedef comphelper::WeakComponentImplHelper<css::view::XSelectionChangeListener> SelectionChangeHandlerInterfaceBase; /** Selection change handler to listen to document selection changes. @@ -70,17 +67,6 @@ public: virtual void SAL_CALL disposing(const css::lang::EventObject& /*rEvent*/) override {} using comphelper::WeakComponentImplHelperBase::disposing; - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const& aIdentifier) override - { - return comphelper::getSomethingImpl(aIdentifier, this); - } - - static css::uno::Sequence<sal_Int8> const& getUnoTunnelId() - { - static comphelper::UnoIdInit const id; - return id.getSeq(); - } - private: SelectionChangeHandler(const SelectionChangeHandler&) = delete; SelectionChangeHandler& operator=(const SelectionChangeHandler&) = delete; diff --git a/sfx2/source/doc/digitalsignatures.cxx b/sfx2/source/doc/digitalsignatures.cxx deleted file mode 100644 index 73f50cde19aa..000000000000 --- a/sfx2/source/doc/digitalsignatures.cxx +++ /dev/null @@ -1,30 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#include <sal/config.h> - -#include <comphelper/servicehelper.hxx> -#include <sfx2/digitalsignatures.hxx> - -sal_Int64 sfx2::DigitalSignatures::getSomething(css::uno::Sequence<sal_Int8> const& aIdentifier) -{ - return comphelper::getSomethingImpl(aIdentifier, this); -} - -css::uno::Sequence<sal_Int8> const& sfx2::DigitalSignatures::getUnoTunnelId() -{ - static comphelper::UnoIdInit const id; - return id.getSeq(); -} - -sfx2::DigitalSignatures::DigitalSignatures() = default; - -sfx2::DigitalSignatures::~DigitalSignatures() = default; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index fdebd24107a6..c81b79e8ec4e 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -78,7 +78,6 @@ #include <comphelper/propertyvalue.hxx> #include <comphelper/interaction.hxx> #include <comphelper/sequence.hxx> -#include <comphelper/servicehelper.hxx> #include <comphelper/simplefileaccessinteraction.hxx> #include <comphelper/string.hxx> #include <framework/interaction.hxx> @@ -4009,7 +4008,7 @@ bool SfxMedium::SignDocumentContentUsingCertificate( uno::Reference< security::XDocumentDigitalSignatures > xSigner( security::DocumentDigitalSignatures::createWithVersionAndValidSignature( comphelper::getProcessComponentContext(), aODFVersion, bHasValidDocumentSignature ) ); - auto xModelSigner = comphelper::getFromUnoTunnel<sfx2::DigitalSignatures>(xSigner); + auto xModelSigner = dynamic_cast<sfx2::DigitalSignatures*>(xSigner.get()); if (!xModelSigner) { return bChanges; diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 550b1e8cc5d7..a35bb1f7488c 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -41,7 +41,6 @@ #include <vcl/svapp.hxx> #include <splitwin.hxx> #include <comphelper/diagnose_ex.hxx> -#include <comphelper/servicehelper.hxx> #include <tools/json_writer.hxx> #include <tools/link.hxx> #include <toolkit/helper/vclunohelper.hxx> @@ -187,10 +186,10 @@ SidebarController* SidebarController::GetSidebarControllerForFrame ( ::comphelper::getProcessComponentContext(), xController, [] (uno::Reference<uno::XInterface> const& xRef) - { return nullptr != comphelper::getFromUnoTunnel<SidebarController>(xRef); } + { return nullptr != dynamic_cast<SidebarController*>(xRef.get()); } )); - return comphelper::getFromUnoTunnel<SidebarController>(xListener); + return dynamic_cast<SidebarController*>(xListener.get()); } void SidebarController::registerSidebarForFrame(const css::uno::Reference<css::frame::XController>& xController) @@ -1647,16 +1646,7 @@ sfx2::sidebar::SidebarController* SidebarController::GetSidebarControllerForView if (!xSidebar.is()) return nullptr; - return comphelper::getFromUnoTunnel<sfx2::sidebar::SidebarController>(xSidebar); -} - -sal_Int64 SidebarController::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl(aIdentifier, this); -} - -css::uno::Sequence<sal_Int8> const & SidebarController::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); + return dynamic_cast<sfx2::sidebar::SidebarController*>(xSidebar.get()); } } // end of namespace sfx2::sidebar diff --git a/starmath/source/SmPanelFactory.cxx b/starmath/source/SmPanelFactory.cxx index 682e13295092..df35dcadffbc 100644 --- a/starmath/source/SmPanelFactory.cxx +++ b/starmath/source/SmPanelFactory.cxx @@ -26,7 +26,6 @@ #include <cppuhelper/exc_hlp.hxx> #include <cppuhelper/supportsservice.hxx> #include <comphelper/namedvaluecollection.hxx> -#include <comphelper/servicehelper.hxx> #include <sfx2/sidebar/SidebarPanelBase.hxx> #include <vcl/weldutils.hxx> @@ -70,7 +69,7 @@ css::uno::Reference<css::ui::XUIElement> SAL_CALL SmPanelFactory::createUIElemen SfxBindings* pBindings = reinterpret_cast<SfxBindings*>(nBindingsValue); weld::Widget* pParent(nullptr); - if (auto pTunnel = comphelper::getFromUnoTunnel<weld::TransportAsXWindow>(xParentWindow)) + if (auto pTunnel = dynamic_cast<weld::TransportAsXWindow*>(xParentWindow.get())) pParent = pTunnel->getWidget(); if (!pParent) diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx index a4b14671b63d..b7a92567fe25 100644 --- a/starmath/source/unomodel.cxx +++ b/starmath/source/unomodel.cxx @@ -361,7 +361,6 @@ const uno::Sequence< sal_Int8 > & SmModel::getUnoTunnelId() sal_Int64 SAL_CALL SmModel::getSomething( const uno::Sequence< sal_Int8 >& rId ) { return comphelper::getSomethingImpl(rId, this, - comphelper::MixinToGetSomethingOf<FormulaImExportBase>{}, comphelper::FallbackToGetSomethingOf<SfxBaseModel>{}); } diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk index 94c34808d3df..ec2405d65636 100644 --- a/svtools/Library_svt.mk +++ b/svtools/Library_svt.mk @@ -125,7 +125,6 @@ $(eval $(call gb_Library_add_exception_objects,svt,\ svtools/source/misc/cliplistener \ svtools/source/misc/dialogclosedlistener \ svtools/source/misc/ehdl \ - svtools/source/misc/embeddedupdate \ svtools/source/misc/embedhlp \ svtools/source/misc/embedtransfer \ svtools/source/misc/filechangedchecker \ diff --git a/svtools/source/misc/embeddedupdate.cxx b/svtools/source/misc/embeddedupdate.cxx deleted file mode 100644 index e763ef08e7fd..000000000000 --- a/svtools/source/misc/embeddedupdate.cxx +++ /dev/null @@ -1,22 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#include <sal/config.h> - -#include <comphelper/servicehelper.hxx> -#include <sal/types.h> -#include <svtools/embeddedupdate.hxx> - -css::uno::Sequence<sal_Int8> const& css::embed::EmbeddedUpdate::getUnoTunnelId() -{ - static comphelper::UnoIdInit const id; - return id.getSeq(); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx index 17808b2892a3..d784b20a4a39 100644 --- a/svtools/source/misc/embedhlp.cxx +++ b/svtools/source/misc/embedhlp.cxx @@ -19,7 +19,6 @@ #include <libxml/xmlwriter.h> -#include <svtools/embeddedupdate.hxx> #include <svtools/embedhlp.hxx> #include <vcl/graphicfilter.hxx> #include <vcl/gdimtf.hxx> @@ -31,7 +30,6 @@ #include <sal/log.hxx> #include <comphelper/fileformat.h> #include <comphelper/embeddedobjectcontainer.hxx> -#include <comphelper/servicehelper.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <unotools/ucbstreamhelper.hxx> #include <unotools/streamwrap.hxx> @@ -54,6 +52,7 @@ #include <com/sun/star/embed/XLinkageSupport.hpp> #include <com/sun/star/chart2/XDefaultSizeTransmitter.hpp> #include <com/sun/star/qa/XDumper.hpp> +#include <embeddedobj/embeddedupdate.hxx> #include <cppuhelper/implbase.hxx> #include <vcl/svapp.hxx> #include <comphelper/diagnose_ex.hxx> @@ -934,7 +933,7 @@ void EmbeddedObjectRef::UpdateReplacement( bool bUpdateOle ) void EmbeddedObjectRef::UpdateOleObject( bool bUpdateOle ) { - embed::EmbeddedUpdate* pObj = comphelper::getFromUnoTunnel<embed::EmbeddedUpdate> (GetObject()); + embed::EmbeddedUpdate* pObj = dynamic_cast<embed::EmbeddedUpdate*> (GetObject().get()); if( pObj ) pObj->SetOleState( bUpdateOle ); } diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx index 734fbe285623..8fe4eb37c621 100644 --- a/svtools/source/uno/toolboxcontroller.cxx +++ b/svtools/source/uno/toolboxcontroller.cxx @@ -34,7 +34,6 @@ #include <vcl/weldutils.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/propertyvalue.hxx> -#include <comphelper/servicehelper.hxx> const int TOOLBARCONTROLLER_PROPHANDLE_SUPPORTSVISIBLE = 1; constexpr OUStringLiteral TOOLBARCONTROLLER_PROPNAME_SUPPORTSVISIBLE = u"SupportsVisible"; @@ -223,7 +222,7 @@ void SAL_CALL ToolboxController::initialize( const Sequence< Any >& aArguments ) if ( !m_aCommandURL.isEmpty() ) m_aListenerMap.emplace( m_aCommandURL, Reference< XDispatch >() ); - if (weld::TransportAsXWindow* pTunnel = comphelper::getFromUnoTunnel<weld::TransportAsXWindow>(getParent())) + if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(getParent().get())) { m_pToolbar = dynamic_cast<weld::Toolbar*>(pTunnel->getWidget()); assert(m_pToolbar && "must be a toolbar"); diff --git a/svx/source/sidebar/PanelFactory.cxx b/svx/source/sidebar/PanelFactory.cxx index 468dd998a32a..f55575d1ab97 100644 --- a/svx/source/sidebar/PanelFactory.cxx +++ b/svx/source/sidebar/PanelFactory.cxx @@ -42,7 +42,6 @@ #include <vcl/weldutils.hxx> #include <comphelper/namedvaluecollection.hxx> #include <comphelper/compbase.hxx> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/ui/XSidebar.hpp> @@ -103,7 +102,7 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement ( SfxBindings* pBindings = reinterpret_cast<SfxBindings*>(nBindingsValue); weld::Widget* pParent(nullptr); - if (weld::TransportAsXWindow* pTunnel = comphelper::getFromUnoTunnel<weld::TransportAsXWindow>(xParentWindow)) + if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(xParentWindow.get())) pParent = pTunnel->getWidget(); if (!pParent) diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx index 67135a4de0e2..4edf0d5c5ef9 100644 --- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx +++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx @@ -18,7 +18,6 @@ */ #include <memory> -#include <comphelper/servicehelper.hxx> #include <svx/sidebar/LinePropertyPanelBase.hxx> #include <sfx2/weldutils.hxx> #include <svx/linectrl.hxx> @@ -59,7 +58,7 @@ namespace SvxLineStyleToolBoxControl* getLineStyleToolBoxControl(const ToolbarUnoDispatcher& rToolBoxColor) { css::uno::Reference<css::frame::XToolbarController> xController = rToolBoxColor.GetControllerForCommand(".uno:XLineStyle"); - SvxLineStyleToolBoxControl* pToolBoxLineStyleControl = comphelper::getFromUnoTunnel<SvxLineStyleToolBoxControl>(xController); + SvxLineStyleToolBoxControl* pToolBoxLineStyleControl = dynamic_cast<SvxLineStyleToolBoxControl*>(xController.get()); return pToolBoxLineStyleControl; } } diff --git a/svx/source/tbxctrls/linectrl.cxx b/svx/source/tbxctrls/linectrl.cxx index 71996d49f894..9fcaeb22b919 100644 --- a/svx/source/tbxctrls/linectrl.cxx +++ b/svx/source/tbxctrls/linectrl.cxx @@ -48,7 +48,6 @@ #include <comphelper/lok.hxx> #include <comphelper/propertyvalue.hxx> -#include <comphelper/servicehelper.hxx> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; @@ -61,7 +60,7 @@ using namespace ::com::sun::star; #define MAX_LINES 12 SvxLineStyleToolBoxControl::SvxLineStyleToolBoxControl( const css::uno::Reference<css::uno::XComponentContext>& rContext ) - : ImplInheritanceHelper( rContext, nullptr, OUString() ) + : svt::PopupWindowController( rContext, nullptr, OUString() ) { addStatusListener(".uno:LineDash"); } @@ -218,16 +217,6 @@ css::uno::Sequence<OUString> SvxLineStyleToolBoxControl::getSupportedServiceName return { "com.sun.star.frame.ToolbarController" }; } -sal_Int64 SvxLineStyleToolBoxControl::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) -{ - return comphelper::getSomethingImpl(aIdentifier, this); -} - -css::uno::Sequence<sal_Int8> const & SvxLineStyleToolBoxControl::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); -} - extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_svx_LineStyleToolBoxControl_get_implementation( css::uno::XComponentContext* rContext, diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 03dd2aafce71..7b6f8126afe1 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -45,7 +45,6 @@ #include <comphelper/string.hxx> #include <comphelper/flagguard.hxx> #include <comphelper/sequence.hxx> -#include <comphelper/servicehelper.hxx> #include <oox/token/namespaces.hxx> #include <oox/token/tokens.hxx> #include <oox/export/utils.hxx> @@ -6017,7 +6016,7 @@ void DocxAttributeOutput::WritePostponedMath(const SwOLENode* pPostponedMath, sa SAL_WARN("sw.ww8", "Broken math object"); return; } - if( oox::FormulaImExportBase* formulaexport = comphelper::getFromUnoTunnel< oox::FormulaImExportBase >( xInterface)) + if( oox::FormulaImExportBase* formulaexport = dynamic_cast< oox::FormulaImExportBase* >( xInterface.get())) formulaexport->writeFormulaOoxml( m_pSerializer, GetExport().GetFilter().getVersion(), oox::drawingml::DOCUMENT_DOCX, nAlign); else diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 262d67ff4c1e..75a2b5b08f56 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -24,7 +24,6 @@ #include "writerwordglue.hxx" #include "ww8par.hxx" #include <fmtcntnt.hxx> -#include <comphelper/servicehelper.hxx> #include <rtl/tencinfo.h> #include <sal/log.hxx> #include <sot/exchange.hxx> @@ -4189,7 +4188,7 @@ bool RtfAttributeOutput::FlyFrameOLEMath(const SwFlyFrameFormat* pFlyFrameFormat uno::Reference<util::XCloseable> xClosable = xObj->getComponent(); if (!xClosable.is()) return false; - auto pBase = comphelper::getFromUnoTunnel<oox::FormulaImExportBase>(xClosable); + auto pBase = dynamic_cast<oox::FormulaImExportBase*>(xClosable.get()); SAL_WARN_IF(!pBase, "sw.rtf", "Math OLE object cannot write out RTF"); if (pBase) { diff --git a/sw/source/uibase/docvw/SidebarWinAcc.cxx b/sw/source/uibase/docvw/SidebarWinAcc.cxx index 740c3f175ec3..f489bc140b6b 100644 --- a/sw/source/uibase/docvw/SidebarWinAcc.cxx +++ b/sw/source/uibase/docvw/SidebarWinAcc.cxx @@ -22,7 +22,6 @@ #include <viewsh.hxx> #include <accmap.hxx> -#include <comphelper/servicehelper.hxx> #include <toolkit/awt/vclxaccessiblecomponent.hxx> #include <com/sun/star/accessibility/AccessibleRole.hpp> @@ -39,7 +38,7 @@ class SidebarWinAccessibleContext : public VCLXAccessibleComponent explicit SidebarWinAccessibleContext( sw::annotation::SwAnnotationWin& rSidebarWin, SwViewShell& rViewShell, const SwFrame* pAnchorFrame ) - : VCLXAccessibleComponent( comphelper::getFromUnoTunnel<VCLXWindow>(rSidebarWin.CreateAccessible()) ) + : VCLXAccessibleComponent( dynamic_cast<VCLXWindow*>(rSidebarWin.CreateAccessible().get()) ) , mrViewShell( rViewShell ) , mpAnchorFrame( pAnchorFrame ) { diff --git a/sw/source/uibase/sidebar/SwPanelFactory.cxx b/sw/source/uibase/sidebar/SwPanelFactory.cxx index 3f307bbf7cdf..5dcd0f389216 100644 --- a/sw/source/uibase/sidebar/SwPanelFactory.cxx +++ b/sw/source/uibase/sidebar/SwPanelFactory.cxx @@ -37,7 +37,6 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <comphelper/namedvaluecollection.hxx> #include <comphelper/compbase.hxx> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> @@ -91,7 +90,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement ( SfxBindings* pBindings = reinterpret_cast<SfxBindings*>(nBindingsValue); weld::Widget* pParent(nullptr); - if (weld::TransportAsXWindow* pTunnel = comphelper::getFromUnoTunnel<weld::TransportAsXWindow>(xParentWindow)) + if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(xParentWindow.get())) pParent = pTunnel->getWidget(); if (!pParent) diff --git a/toolkit/inc/awt/vclxwindows.hxx b/toolkit/inc/awt/vclxwindows.hxx index 983bcff726b4..ce96248494ea 100644 --- a/toolkit/inc/awt/vclxwindows.hxx +++ b/toolkit/inc/awt/vclxwindows.hxx @@ -121,9 +121,6 @@ public: VCLXDialog(); virtual ~VCLXDialog() override; - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - // css::awt::XDialog2 virtual void SAL_CALL endDialog( ::sal_Int32 Result ) override; virtual void SAL_CALL setHelpId( const OUString& Id ) override; @@ -154,9 +151,6 @@ public: VCLXTabPage(); virtual ~VCLXTabPage() override; - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - // css::awt::XView void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) override; @@ -180,9 +174,6 @@ public: VCLXMultiPage(); virtual ~VCLXMultiPage() override; - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - // css::lang::XComponent void SAL_CALL dispose( ) override; diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx b/toolkit/source/awt/vclxaccessiblecomponent.cxx index 6d0798bda590..7fbb1ea1ccd6 100644 --- a/toolkit/source/awt/vclxaccessiblecomponent.cxx +++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx @@ -22,7 +22,6 @@ #include <com/sun/star/accessibility/AccessibleEventId.hpp> #include <com/sun/star/accessibility/AccessibleRelationType.hpp> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <i18nlangtag/languagetag.hxx> #include <toolkit/awt/vclxaccessiblecomponent.hxx> @@ -106,15 +105,6 @@ uno::Sequence< OUString > VCLXAccessibleComponent::getSupportedServiceNames() return aNames; } -sal_Int64 VCLXAccessibleComponent::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl(aIdentifier, this); -} - -css::uno::Sequence<sal_Int8> const & VCLXAccessibleComponent::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); -} - IMPL_LINK( VCLXAccessibleComponent, WindowEventListener, VclWindowEvent&, rEvent, void ) { /* Ignore VclEventId::WindowEndPopupMode, because the UNO accessibility wrapper @@ -179,7 +169,7 @@ void VCLXAccessibleComponent::ProcessWindowChildEvent( const VclWindowEvent& rVc uno::Reference<XAccessibleContext> xChildContext = xAcc->getAccessibleContext(); if (xChildContext.is()) { - VCLXAccessibleComponent* pChildComponent = comphelper::getFromUnoTunnel<VCLXAccessibleComponent>(xChildContext); + VCLXAccessibleComponent* pChildComponent = dynamic_cast<VCLXAccessibleComponent*>(xChildContext.get()); if (pChildComponent) { css::uno::Any aNewStateValue; @@ -200,7 +190,7 @@ void VCLXAccessibleComponent::ProcessWindowChildEvent( const VclWindowEvent& rVc uno::Reference<XAccessibleContext> xChildContext = xAcc->getAccessibleContext(); if (xChildContext.is()) { - VCLXAccessibleComponent* pChildComponent = comphelper::getFromUnoTunnel<VCLXAccessibleComponent>(xChildContext); + VCLXAccessibleComponent* pChildComponent = dynamic_cast<VCLXAccessibleComponent*>(xChildContext.get()); if (pChildComponent) { css::uno::Any aOldStateValue; diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index fd86d5e371b9..7a3e3e7cfbcb 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -139,7 +139,6 @@ #include <comphelper/interfacecontainer3.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/profilezone.hxx> -#include <comphelper/servicehelper.hxx> #include <helper/msgbox.hxx> #include <helper/scrollabledialog.hxx> @@ -1546,7 +1545,7 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( rtl::Reference<VCLXWindow>* ppNewCom // which creates a component object. css::uno::Reference< css::awt::XWindowPeer > xWinPeer = pNewWindow->GetComponentInterface( false ); if ( xWinPeer.is() ) - *ppNewComp = comphelper::getFromUnoTunnel< VCLXDialog >( xWinPeer ); + *ppNewComp = dynamic_cast< VCLXDialog* >( xWinPeer.get() ); else *ppNewComp = new VCLXDialog; } diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 7cf80879148a..8fc6dc0277db 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -34,7 +34,6 @@ #include <com/sun/star/awt/TextAlign.hpp> #include <comphelper/namedvaluecollection.hxx> #include <comphelper/processfactory.hxx> -#include <comphelper/servicehelper.hxx> #include <sal/log.hxx> #include <awt/vclxwindows.hxx> @@ -2224,16 +2223,6 @@ VCLXDialog::~VCLXDialog() SAL_INFO("toolkit", __FUNCTION__); } -sal_Int64 VCLXDialog::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl( - aIdentifier, this, comphelper::FallbackToGetSomethingOf<VCLXWindow>{}); -} - -css::uno::Sequence<sal_Int8> const & VCLXDialog::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); -} - void SAL_CALL VCLXDialog::endDialog( ::sal_Int32 i_result ) { SolarMutexGuard aGuard; @@ -2409,17 +2398,6 @@ void VCLXMultiPage::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds ) VCLXMultiPage::~VCLXMultiPage() { } - -sal_Int64 VCLXMultiPage::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl( - aIdentifier, this, comphelper::FallbackToGetSomethingOf<VCLXWindow>{}); -} - -css::uno::Sequence<sal_Int8> const & VCLXMultiPage::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); -} - void SAL_CALL VCLXMultiPage::dispose() { SolarMutexGuard aGuard; @@ -2672,16 +2650,6 @@ VCLXTabPage::~VCLXTabPage() { } -sal_Int64 VCLXTabPage::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl( - aIdentifier, this, comphelper::FallbackToGetSomethingOf<VCLXWindow>{}); -} - -css::uno::Sequence<sal_Int8> const & VCLXTabPage::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); -} - // css::awt::XView void SAL_CALL VCLXTabPage::draw( sal_Int32 nX, sal_Int32 nY ) { diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index ba0054714c0c..67ee3bcc6719 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -36,7 +36,6 @@ #include <cppuhelper/weak.hxx> #include <tools/debug.hxx> #include <comphelper/sequence.hxx> -#include <comphelper/servicehelper.hxx> #include <vcl/outdev.hxx> #include <vcl/image.hxx> @@ -788,11 +787,11 @@ void UnoMultiPageControl::bindPage( const uno::Reference< awt::XControl >& _rxCo uno::Reference< awt::XSimpleTabController > xTabCntrl( getPeer(), uno::UNO_QUERY ); uno::Reference< beans::XPropertySet > xProps( _rxControl->getModel(), uno::UNO_QUERY ); - VCLXTabPage* pXPage = comphelper::getFromUnoTunnel< VCLXTabPage >( xPage ); + VCLXTabPage* pXPage = dynamic_cast< VCLXTabPage* >( xPage.get() ); TabPage* pPage = pXPage ? pXPage->getTabPage() : nullptr; if ( xTabCntrl.is() && pPage ) { - VCLXMultiPage* pXTab = comphelper::getFromUnoTunnel< VCLXMultiPage >( xTabCntrl ); + VCLXMultiPage* pXTab = dynamic_cast< VCLXMultiPage* >( xTabCntrl.get() ); if ( pXTab ) { OUString sTitle; diff --git a/toolkit/source/controls/tree/treedatamodel.cxx b/toolkit/source/controls/tree/treedatamodel.cxx index bf09ff269564..090a6738f517 100644 --- a/toolkit/source/controls/tree/treedatamodel.cxx +++ b/toolkit/source/controls/tree/treedatamodel.cxx @@ -22,9 +22,7 @@ #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/uno/XComponentContext.hpp> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/implbase2.hxx> -#include <cppuhelper/implbase3.hxx> #include <cppuhelper/supportsservice.hxx> #include <o3tl/safeint.hxx> #include <rtl/ref.hxx> @@ -79,8 +77,7 @@ private: Reference< XTreeNode > mxRootNode; }; -class MutableTreeNode: - public ::cppu::WeakAggImplHelper3< XMutableTreeNode, XServiceInfo, css::lang::XUnoTunnel > +class MutableTreeNode: public ::cppu::WeakAggImplHelper2< XMutableTreeNode, XServiceInfo > { friend class MutableTreeDataModel; @@ -121,9 +118,6 @@ public: virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - private: TreeNodeVector maChildren; Any maDisplayValue; @@ -183,13 +177,12 @@ void SAL_CALL MutableTreeDataModel::setRoot( const Reference< XMutableTreeNode > if( mxRootNode.is() ) { - rtl::Reference< MutableTreeNode > xOldImpl( comphelper::getFromUnoTunnel< MutableTreeNode >( mxRootNode ) ); + rtl::Reference< MutableTreeNode > xOldImpl( dynamic_cast< MutableTreeNode* >( mxRootNode.get() ) ); if( xOldImpl.is() ) xOldImpl->mbIsInserted = false; } - rtl::Reference< MutableTreeNode > xImpl( - comphelper::getFromUnoTunnel< MutableTreeNode >( xNode ) ); + rtl::Reference< MutableTreeNode > xImpl( dynamic_cast< MutableTreeNode* >( xNode.get() ) ); if( !xImpl.is() || xImpl->mbIsInserted ) throw IllegalArgumentException(); @@ -309,8 +302,7 @@ void SAL_CALL MutableTreeNode::setDataValue( const Any& _datavalue ) void SAL_CALL MutableTreeNode::appendChild( const Reference< XMutableTreeNode >& xChildNode ) { std::unique_lock aGuard( maMutex ); - rtl::Reference< MutableTreeNode > xImpl( - comphelper::getFromUnoTunnel< MutableTreeNode >( xChildNode ) ); + rtl::Reference< MutableTreeNode > xImpl( dynamic_cast< MutableTreeNode* >( xChildNode.get() ) ); if( !xImpl.is() || xImpl->mbIsInserted || (this == xImpl.get()) ) throw IllegalArgumentException(); @@ -329,8 +321,7 @@ void SAL_CALL MutableTreeNode::insertChildByIndex( sal_Int32 nChildIndex, const if( (nChildIndex < 0) || (o3tl::make_unsigned(nChildIndex) > maChildren.size()) ) throw IndexOutOfBoundsException(); - rtl::Reference< MutableTreeNode > xImpl( - comphelper::getFromUnoTunnel< MutableTreeNode >( xChildNode ) ); + rtl::Reference< MutableTreeNode > xImpl( dynamic_cast< MutableTreeNode* >( xChildNode.get() ) ); if( !xImpl.is() || xImpl->mbIsInserted || (this == xImpl.get()) ) throw IllegalArgumentException(); @@ -460,8 +451,7 @@ sal_Int32 SAL_CALL MutableTreeNode::getIndex( const Reference< XTreeNode >& xNod { std::scoped_lock aGuard( maMutex ); - rtl::Reference< MutableTreeNode > xImpl( - comphelper::getFromUnoTunnel< MutableTreeNode >( xNode ) ); + rtl::Reference< MutableTreeNode > xImpl( dynamic_cast< MutableTreeNode* >( xNode.get() ) ); if( xImpl.is() ) { sal_Int32 nChildCount = maChildren.size(); @@ -521,15 +511,6 @@ Sequence< OUString > SAL_CALL MutableTreeNode::getSupportedServiceNames( ) return aSeq; } -sal_Int64 MutableTreeNode::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl(aIdentifier, this); -} - -css::uno::Sequence<sal_Int8> const & MutableTreeNode::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); -} - } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx index 2874087e14ef..080847154cb2 100644 --- a/toolkit/source/helper/unowrapper.cxx +++ b/toolkit/source/helper/unowrapper.cxx @@ -26,7 +26,6 @@ #include <awt/vclxtopwindow.hxx> #include <awt/vclxwindows.hxx> -#include <comphelper/servicehelper.hxx> #include <toolkit/dllapi.h> #include <vcl/menu.hxx> @@ -180,7 +179,7 @@ void UnoWrapper::SetWindowInterface( vcl::Window* pWindow, const css::uno::Refer css::uno::Reference< css::awt::XWindowPeer> xPeer = pWindow->GetWindowPeer(); if( xPeer.is() ) { - bool bSameInstance( pVCLXWindow == comphelper::getFromUnoTunnel< VCLXWindow >( xPeer )); + bool bSameInstance( pVCLXWindow == dynamic_cast< VCLXWindow* >( xPeer.get() )); SAL_WARN_IF( !bSameInstance, "toolkit.helper", "UnoWrapper::SetWindowInterface: there is already a WindowPeer/ComponentInterface for this VCL window" ); if ( bSameInstance ) return; diff --git a/ucb/source/ucp/ext/ucpext_content.cxx b/ucb/source/ucp/ext/ucpext_content.cxx index 6747c397f952..a1d2df55a092 100644 --- a/ucb/source/ucp/ext/ucpext_content.cxx +++ b/ucb/source/ucp/ext/ucpext_content.cxx @@ -37,7 +37,6 @@ #include <ucbhelper/cancelcommandexecution.hxx> #include <ucbhelper/content.hxx> #include <comphelper/diagnose_ex.hxx> -#include <comphelper/servicehelper.hxx> #include <rtl/ustrbuf.hxx> #include <rtl/uri.hxx> #include <sal/macros.h> @@ -436,16 +435,6 @@ namespace ucb::ucp::ext } - sal_Int64 Content::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl(aIdentifier, this); - } - - css::uno::Sequence<sal_Int8> const & Content::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); - } - - Reference< XRow > Content::getPropertyValues( const Sequence< Property >& i_rProperties, const Reference< XCommandEnvironment >& i_rEnv ) { ::osl::Guard< ::osl::Mutex > aGuard( m_aMutex ); diff --git a/ucb/source/ucp/ext/ucpext_content.hxx b/ucb/source/ucp/ext/ucpext_content.hxx index 58157c37e769..99df646f73c4 100644 --- a/ucb/source/ucp/ext/ucpext_content.hxx +++ b/ucb/source/ucp/ext/ucpext_content.hxx @@ -21,9 +21,7 @@ #include <com/sun/star/sdbc/XRow.hpp> #include <com/sun/star/beans/PropertyValue.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> -#include <cppuhelper/implbase.hxx> #include <ucbhelper/contenthelper.hxx> #include <optional> @@ -47,8 +45,7 @@ namespace ucb::ucp::ext //= ContentProvider - typedef cppu::ImplInheritanceHelper<::ucbhelper::ContentImplHelper, css::lang::XUnoTunnel> - Content_Base; + typedef ::ucbhelper::ContentImplHelper Content_Base; class Content : public Content_Base { public: @@ -85,9 +82,6 @@ namespace ucb::ucp::ext */ OUString getPhysicalURL() const; - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - protected: virtual ~Content() override; diff --git a/ucb/source/ucp/ext/ucpext_datasupplier.cxx b/ucb/source/ucp/ext/ucpext_datasupplier.cxx index e0490075d7c9..b718ef076c34 100644 --- a/ucb/source/ucp/ext/ucpext_datasupplier.cxx +++ b/ucb/source/ucp/ext/ucpext_datasupplier.cxx @@ -30,7 +30,6 @@ #include <ucbhelper/content.hxx> #include <ucbhelper/propertyvalueset.hxx> #include <comphelper/diagnose_ex.hxx> -#include <comphelper/servicehelper.hxx> #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> @@ -205,7 +204,7 @@ namespace ucb::ucp::ext try { Reference< XContent > xContent( m_xContent->getProvider()->queryContent( xId ) ); - pContent.set( comphelper::getFromUnoTunnel< Content >( xContent ) ); + pContent.set( dynamic_cast< Content* >( xContent.get() ) ); OSL_ENSURE( pContent.is() || !xContent.is(), "DataSupplier::queryContent: invalid content implementation!" ); m_aResults[ i_nIndex ].pContent = pContent; return pContent; diff --git a/vbahelper/source/vbahelper/vbashaperange.cxx b/vbahelper/source/vbahelper/vbashaperange.cxx index 53d9d4268401..4dd837259bf7 100644 --- a/vbahelper/source/vbahelper/vbashaperange.cxx +++ b/vbahelper/source/vbahelper/vbashaperange.cxx @@ -24,7 +24,6 @@ #include <ooo/vba/office/MsoShapeType.hpp> #include <utility> -#include <comphelper/servicehelper.hxx> #include <vbahelper/vbashaperange.hxx> #include <vbahelper/vbashape.hxx> using namespace ::ooo::vba; @@ -45,7 +44,7 @@ public: } virtual uno::Any SAL_CALL nextElement( ) override { - ScVbaShapeRange* pCollectionImpl = comphelper::getFromUnoTunnel< ScVbaShapeRange >(m_xParent); + ScVbaShapeRange* pCollectionImpl = dynamic_cast< ScVbaShapeRange* >(m_xParent.get()); if ( pCollectionImpl && hasMoreElements() ) return pCollectionImpl->createCollectionObject( m_xIndexAccess->getByIndex( nIndex++ ) ); throw container::NoSuchElementException(); @@ -392,15 +391,6 @@ ScVbaShapeRange::createEnumeration() return new VbShapeRangeEnumHelper( this, m_xIndexAccess ); } -sal_Int64 ScVbaShapeRange::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl(aIdentifier, this); -} - -css::uno::Sequence<sal_Int8> const & ScVbaShapeRange::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); -} - uno::Any ScVbaShapeRange:: createCollectionObject( const css::uno::Any& aSource ) { diff --git a/vbahelper/source/vbahelper/vbashapes.cxx b/vbahelper/source/vbahelper/vbashapes.cxx index a61fbddfb350..02630a75c520 100644 --- a/vbahelper/source/vbahelper/vbashapes.cxx +++ b/vbahelper/source/vbahelper/vbashapes.cxx @@ -39,7 +39,6 @@ #include <com/sun/star/drawing/XShapes.hpp> #include <utility> -#include <comphelper/servicehelper.hxx> #include <vbahelper/vbahelper.hxx> #include <vbahelper/vbashape.hxx> #include <vbahelper/vbashapes.hxx> @@ -64,7 +63,7 @@ public: } virtual uno::Any SAL_CALL nextElement( ) override { - ScVbaShapes* pShapes = comphelper::getFromUnoTunnel< ScVbaShapes >(m_xParent); + ScVbaShapes* pShapes = dynamic_cast< ScVbaShapes* >(m_xParent.get()); if ( pShapes && hasMoreElements() ) return pShapes->createCollectionObject( m_xIndexAccess->getByIndex( nIndex++ ) ); throw container::NoSuchElementException(); @@ -102,15 +101,6 @@ ScVbaShapes::createEnumeration() return new VbShapeEnumHelper( this, m_xIndexAccess ); } -sal_Int64 ScVbaShapes::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl(aIdentifier, this); -} - -css::uno::Sequence<sal_Int8> const & ScVbaShapes::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); -} - uno::Any ScVbaShapes::createCollectionObject( const css::uno::Any& aSource ) { diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 0c018b7bb9b4..ca32ff803ebe 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -162,7 +162,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/window/taskpanelist \ vcl/source/window/toolbox2 \ vcl/source/window/toolbox \ - vcl/source/window/weldutils \ vcl/source/window/window2 \ vcl/source/window/window3 \ vcl/source/window/window \ diff --git a/vcl/inc/canvasbitmap.hxx b/vcl/inc/canvasbitmap.hxx index 141d15ef948a..54586a1ad60e 100644 --- a/vcl/inc/canvasbitmap.hxx +++ b/vcl/inc/canvasbitmap.hxx @@ -21,7 +21,6 @@ #define INCLUDED_VCL_INC_CANVASBITMAP_HXX #include <cppuhelper/implbase.hxx> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/rendering/XIntegerReadOnlyBitmap.hpp> #include <com/sun/star/rendering/XIntegerBitmapColorSpace.hpp> #include <com/sun/star/rendering/XBitmapPalette.hpp> @@ -33,8 +32,7 @@ namespace vcl::unotools class VCL_DLLPUBLIC VclCanvasBitmap final : public cppu::WeakImplHelper< css::rendering::XIntegerReadOnlyBitmap, css::rendering::XBitmapPalette, - css::rendering::XIntegerBitmapColorSpace, - css::lang::XUnoTunnel > + css::rendering::XIntegerBitmapColorSpace > { private: BitmapEx m_aBmpEx; @@ -105,10 +103,6 @@ namespace vcl::unotools virtual css::uno::Sequence< ::sal_Int8 > SAL_CALL convertIntegerFromARGB( const css::uno::Sequence< css::rendering::ARGBColor >& rgbColor ) override; virtual css::uno::Sequence< ::sal_Int8 > SAL_CALL convertIntegerFromPARGB( const css::uno::Sequence< css::rendering::ARGBColor >& rgbColor ) override; - sal_Int64 SAL_CALL getSomething( - css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - /** Create API wrapper for given BitmapEx @param rBitmap diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx index 6446122611e5..a597e5be2436 100644 --- a/vcl/inc/unx/gtk/gtkinst.hxx +++ b/vcl/inc/unx/gtk/gtkinst.hxx @@ -33,7 +33,6 @@ #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/awt/XWindow.hpp> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/compbase.hxx> #include <vcl/weld.hxx> #include <vcl/weldutils.hxx> @@ -344,12 +343,6 @@ public: { return m_pWeldWidget; } - - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const& aIdentifier) override - { - return comphelper::getSomethingImpl( - aIdentifier, this, comphelper::FallbackToGetSomethingOf<TransportAsXWindow>{}); - } }; GdkPixbuf* load_icon_by_name(const OUString& rIconName); diff --git a/vcl/source/helper/canvasbitmap.cxx b/vcl/source/helper/canvasbitmap.cxx index ac5a0815638a..3f8507178b4f 100644 --- a/vcl/source/helper/canvasbitmap.cxx +++ b/vcl/source/helper/canvasbitmap.cxx @@ -26,7 +26,6 @@ #include <com/sun/star/rendering/RenderingIntent.hpp> #include <comphelper/diagnose_ex.hxx> -#include <comphelper/servicehelper.hxx> #include <canvasbitmap.hxx> #include <vcl/canvastools.hxx> #include <vcl/BitmapReadAccess.hxx> @@ -949,7 +948,7 @@ sal_Int8 SAL_CALL VclCanvasBitmap::getEndianness( ) uno::Sequence<double> SAL_CALL VclCanvasBitmap::convertFromIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor, const uno::Reference< ::rendering::XColorSpace >& targetColorSpace ) { - if( comphelper::getFromUnoTunnel<VclCanvasBitmap>(targetColorSpace) ) + if( dynamic_cast<VclCanvasBitmap*>(targetColorSpace.get()) ) { SolarMutexGuard aGuard; @@ -1013,7 +1012,7 @@ uno::Sequence<double> SAL_CALL VclCanvasBitmap::convertFromIntegerColorSpace( co uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertToIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor, const uno::Reference< ::rendering::XIntegerBitmapColorSpace >& targetColorSpace ) { - if( comphelper::getFromUnoTunnel<VclCanvasBitmap>(targetColorSpace) ) + if( dynamic_cast<VclCanvasBitmap*>(targetColorSpace.get()) ) { // it's us, so simply pass-through the data return deviceColor; @@ -1345,14 +1344,5 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromPARGB( c return aRes; } -sal_Int64 VclCanvasBitmap::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl(aIdentifier, this); -} - -css::uno::Sequence<sal_Int8> const & VclCanvasBitmap::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/helper/canvastools.cxx b/vcl/source/helper/canvastools.cxx index 11b1588ecf04..595f12a959c8 100644 --- a/vcl/source/helper/canvastools.cxx +++ b/vcl/source/helper/canvastools.cxx @@ -38,7 +38,6 @@ #include <sal/log.hxx> #include <tools/helpers.hxx> #include <comphelper/diagnose_ex.hxx> -#include <comphelper/servicehelper.hxx> #include <vcl/bitmapex.hxx> @@ -175,8 +174,7 @@ namespace vcl::unotools return ::BitmapEx(); // tunnel directly for known implementation - VclCanvasBitmap* pImplBitmap - = comphelper::getFromUnoTunnel<VclCanvasBitmap>(xInputBitmap); + VclCanvasBitmap* pImplBitmap = dynamic_cast<VclCanvasBitmap*>(xInputBitmap.get()); if( pImplBitmap ) return pImplBitmap->getBitmapEx(); diff --git a/vcl/source/window/weldutils.cxx b/vcl/source/window/weldutils.cxx deleted file mode 100644 index 9a36f23b92d5..000000000000 --- a/vcl/source/window/weldutils.cxx +++ /dev/null @@ -1,21 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#include <sal/config.h> - -#include <comphelper/servicehelper.hxx> -#include <vcl/weldutils.hxx> - -css::uno::Sequence<sal_Int8> const& weld::TransportAsXWindow::getUnoTunnelId() -{ - static comphelper::UnoIdInit const id; - return id.getSeq(); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx index 762f1338fe62..4068d57f2fa1 100644 --- a/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx +++ b/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx @@ -34,7 +34,6 @@ #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp> #include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp> #include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp> -#include <comphelper/servicehelper.hxx> #include <osl/diagnose.h> #include <rtl/process.h> #include <sal/log.hxx> @@ -1632,7 +1631,7 @@ GtkWidget* SalGtkPicker::GetParentWidget(const uno::Sequence<uno::Any>& rArgumen if (xParentWindow.is()) { - if (SalGtkXWindow* pGtkXWindow = comphelper::getFromUnoTunnel<SalGtkXWindow>(xParentWindow)) + if (SalGtkXWindow* pGtkXWindow = dynamic_cast<SalGtkXWindow*>(xParentWindow.get())) pParentWidget = pGtkXWindow->getGtkWidget(); else { diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 960aabe11a0b..0525f8118531 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -65,7 +65,6 @@ #include <comphelper/processfactory.hxx> #include <comphelper/propertyvalue.hxx> #include <comphelper/sequence.hxx> -#include <comphelper/servicehelper.hxx> #include <comphelper/string.hxx> #include <cppuhelper/compbase.hxx> #include <cppuhelper/implbase.hxx> @@ -24484,7 +24483,7 @@ weld::MessageDialog* GtkInstance::CreateMessageDialog(weld::Widget* pParent, Vcl weld::Window* GtkInstance::GetFrameWeld(const css::uno::Reference<css::awt::XWindow>& rWindow) { - if (SalGtkXWindow* pGtkXWindow = comphelper::getFromUnoTunnel<SalGtkXWindow>(rWindow)) + if (SalGtkXWindow* pGtkXWindow = dynamic_cast<SalGtkXWindow*>(rWindow.get())) return pGtkXWindow->getFrameWeld(); return SalInstance::GetFrameWeld(rWindow); } diff --git a/winaccessibility/source/service/AccTopWindowListener.cxx b/winaccessibility/source/service/AccTopWindowListener.cxx index 70c2429f71e2..a6b935d55798 100644 --- a/winaccessibility/source/service/AccTopWindowListener.cxx +++ b/winaccessibility/source/service/AccTopWindowListener.cxx @@ -18,7 +18,6 @@ */ -#include <comphelper/servicehelper.hxx> #include <sal/log.hxx> #include <vcl/window.hxx> #include <toolkit/awt/vclxaccessiblecomponent.hxx> @@ -45,8 +44,7 @@ void AccTopWindowListener::HandleWindowOpened( css::accessibility::XAccessible* VclPtr<vcl::Window> window; if (auto pvclwindow = dynamic_cast<VCLXWindow*>(pAccessible)) window = pvclwindow->GetWindow(); - else if (auto pvclxcomponent - = comphelper::getFromUnoTunnel<VCLXAccessibleComponent>(pAccessible)) + else if (auto pvclxcomponent = dynamic_cast<VCLXAccessibleComponent*>(pAccessible)) window = pvclxcomponent->GetWindow(); assert(window); // The SalFrame of window may be destructed at this time diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 626520f9cb6e..600086ca6121 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -82,7 +82,6 @@ #include <com/sun/star/document/XImporter.hpp> #include <com/sun/star/document/XFilter.hpp> #include <comphelper/indexedpropertyvalues.hxx> -#include <comphelper/servicehelper.hxx> #include <editeng/flditem.hxx> #include <editeng/unotext.hxx> #include <o3tl/safeint.hxx> @@ -3026,7 +3025,7 @@ void DomainMapper_Impl::appendStarMath( const Value& val ) xComponentProperties->setPropertyValue(getPropertyName( PROP_BOTTOM_MARGIN ), uno::Any(sal_Int32(0))); Size size( 1000, 1000 ); - if( oox::FormulaImExportBase* formulaimport = comphelper::getFromUnoTunnel< oox::FormulaImExportBase >( xInterface)) + if( oox::FormulaImExportBase* formulaimport = dynamic_cast< oox::FormulaImExportBase* >( xInterface.get())) size = formulaimport->getFormulaSize(); xStarMathProperties->setPropertyValue(getPropertyName( PROP_WIDTH ), uno::Any( sal_Int32(size.Width()))); diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx index 32e0aa403867..2563956bf97a 100644 --- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx +++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx @@ -28,7 +28,6 @@ #include <sal/log.hxx> #include <comphelper/embeddedobjectcontainer.hxx> #include <comphelper/propertyvalue.hxx> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/exc_hlp.hxx> #include <tools/globname.hxx> #include <comphelper/classids.hxx> @@ -2284,7 +2283,7 @@ void OOXMLFastContextHandlerMath::process() return; uno::Reference< uno::XInterface > component(ref->getComponent(), uno::UNO_QUERY_THROW); if( oox::FormulaImExportBase* import - = comphelper::getFromUnoTunnel< oox::FormulaImExportBase >( component)) + = dynamic_cast< oox::FormulaImExportBase* >( component.get())) import->readFormulaOoxml( buffer ); if (!isForwardEvents()) return; diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index c61721ff484e..ac5bbfb042f2 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -26,7 +26,6 @@ #include <filter/msfilter/rtfutil.hxx> #include <comphelper/string.hxx> #include <comphelper/diagnose_ex.hxx> -#include <comphelper/servicehelper.hxx> #include <tools/globname.hxx> #include <tools/datetimeutils.hxx> #include <comphelper/classids.hxx> @@ -2969,7 +2968,7 @@ RTFError RTFDocumentImpl::beforePopState(RTFParserState& rState) uno::Reference<util::XCloseable> xComponent(xObject->getComponent(), uno::UNO_SET_THROW); if (oox::FormulaImExportBase* pImport - = comphelper::getFromUnoTunnel<oox::FormulaImExportBase>(xComponent)) + = dynamic_cast<oox::FormulaImExportBase*>(xComponent.get())) pImport->readFormulaOoxml(m_aMathBuffer); auto pValue = new RTFValue(xObject); diff --git a/writerperfect/source/common/DocumentHandler.cxx b/writerperfect/source/common/DocumentHandler.cxx index 6cf42c168a51..6b5ffe58ad9e 100644 --- a/writerperfect/source/common/DocumentHandler.cxx +++ b/writerperfect/source/common/DocumentHandler.cxx @@ -15,7 +15,6 @@ #include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <com/sun/star/xml/sax/XAttributeList.hpp> -#include <comphelper/servicehelper.hxx> #include <xmloff/attrlist.hxx> #include <xmloff/xmlimp.hxx> @@ -116,7 +115,7 @@ using com::sun::star::xml::sax::XDocumentHandler; DocumentHandler::DocumentHandler(Reference<XDocumentHandler> const& xHandler) : mxHandler(xHandler) { - if (SvXMLImport* pFastHandler = comphelper::getFromUnoTunnel<SvXMLImport>(mxHandler)) + if (SvXMLImport* pFastHandler = dynamic_cast<SvXMLImport*>(mxHandler.get())) mxHandler.set(new SvXMLLegacyToFastDocHandler(pFastHandler)); } diff --git a/xmloff/Library_xo.mk b/xmloff/Library_xo.mk index 4450b0031c26..14401f9eea8f 100644 --- a/xmloff/Library_xo.mk +++ b/xmloff/Library_xo.mk @@ -154,7 +154,6 @@ $(eval $(call gb_Library_add_exception_objects,xo,\ xmloff/source/draw/sdpropls \ xmloff/source/draw/sdxmlexp \ xmloff/source/draw/sdxmlimp \ - xmloff/source/draw/settingsstore \ xmloff/source/draw/shapeexport \ xmloff/source/draw/shapeimport \ xmloff/source/draw/SignatureLineContext \ diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index ac6719868b85..7c336989496b 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -52,7 +52,6 @@ #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> #include <comphelper/diagnose_ex.hxx> -#include <comphelper/servicehelper.hxx> #include <tools/gen.hxx> #include <sax/tools/converter.hxx> #include <xmloff/xmlaustp.hxx> @@ -2474,8 +2473,7 @@ void SdXMLExport::GetConfigurationSettings(uno::Sequence<beans::PropertyValue>& Reference< beans::XPropertySet > xProps( xFac->createInstance("com.sun.star.document.Settings"), UNO_QUERY ); if( xProps.is() ) SvXMLUnitConverter::convertPropertySet( rProps, xProps ); - DocumentSettingsSerializer *pFilter( - comphelper::getFromUnoTunnel<DocumentSettingsSerializer>(xProps)); + DocumentSettingsSerializer *pFilter(dynamic_cast<DocumentSettingsSerializer *>(xProps.get())); if (!pFilter) return; const uno::Reference< embed::XStorage > xStorage(GetTargetStorage()); diff --git a/xmloff/source/draw/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx index dbdb910775b1..6e556ac84a31 100644 --- a/xmloff/source/draw/sdxmlimp.cxx +++ b/xmloff/source/draw/sdxmlimp.cxx @@ -21,7 +21,6 @@ #include <sal/log.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/sequence.hxx> -#include <comphelper/servicehelper.hxx> #include <xmloff/xmlscripti.hxx> #include "sdxmlimp_impl.hxx" @@ -553,7 +552,7 @@ void SdXMLImport::SetConfigurationSettings(const css::uno::Sequence<css::beans:: const uno::Sequence<beans::PropertyValue>* pValues = &aConfigProps; DocumentSettingsSerializer *pFilter; - pFilter = comphelper::getFromUnoTunnel<DocumentSettingsSerializer>(xProps); + pFilter = dynamic_cast<DocumentSettingsSerializer *>(xProps.get()); uno::Sequence<beans::PropertyValue> aFiltered; if( pFilter ) { diff --git a/xmloff/source/draw/settingsstore.cxx b/xmloff/source/draw/settingsstore.cxx deleted file mode 100644 index 0b41473ea211..000000000000 --- a/xmloff/source/draw/settingsstore.cxx +++ /dev/null @@ -1,28 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#include <sal/config.h> - -#include <comphelper/servicehelper.hxx> -#include <xmloff/settingsstore.hxx> - -sal_Int64 DocumentSettingsSerializer::getSomething(css::uno::Sequence<sal_Int8> const& aIdentifier) -{ - return comphelper::getSomethingImpl(aIdentifier, this); -} - -css::uno::Sequence<sal_Int8> const& DocumentSettingsSerializer::getUnoTunnelId() -{ - static comphelper::UnoIdInit const id; - return id.getSeq(); -} - -DocumentSettingsSerializer::~DocumentSettingsSerializer() {} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/xmlsecurity/Library_xsec_xmlsec.mk b/xmlsecurity/Library_xsec_xmlsec.mk index 23997aa2bfae..615c3eba0032 100644 --- a/xmlsecurity/Library_xsec_xmlsec.mk +++ b/xmlsecurity/Library_xsec_xmlsec.mk @@ -64,7 +64,6 @@ $(eval $(call gb_Library_use_externals,xsec_xmlsec,\ $(eval $(call gb_Library_add_exception_objects,xsec_xmlsec,\ xmlsecurity/source/xmlsec/biginteger \ - xmlsecurity/source/xmlsec/certificate \ xmlsecurity/source/xmlsec/certificateextension_certextn \ xmlsecurity/source/xmlsec/errorcallback \ xmlsecurity/source/xmlsec/saxhelper \ diff --git a/xmlsecurity/inc/certificate.hxx b/xmlsecurity/inc/certificate.hxx index 885fcc8bd5ff..8357f50651a1 100644 --- a/xmlsecurity/inc/certificate.hxx +++ b/xmlsecurity/inc/certificate.hxx @@ -11,13 +11,7 @@ #include <sal/types.h> -#include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> -#include <com/sun/star/security/XCertificate.hpp> #include <com/sun/star/uno/Sequence.hxx> -#include <cppuhelper/implbase.hxx> - -#include "xsecxmlsecdllapi.h" namespace svl { @@ -29,10 +23,8 @@ enum class SignatureMethodAlgorithm; namespace xmlsecurity { -/// Base class of css::security::XCertificate implementations, for module-internal purposes. -class XSECXMLSEC_DLLPUBLIC Certificate - : public ::cppu::WeakImplHelper<css::security::XCertificate, css::lang::XUnoTunnel, - css::lang::XServiceInfo> +/// Extension of css::security::XCertificate for module-internal purposes. +class SAL_NO_VTABLE SAL_DLLPUBLIC_RTTI SAL_LOPLUGIN_ANNOTATE("crosscast") Certificate { public: /// Returns the SHA-256 thumbprint. @@ -43,9 +35,6 @@ public: /// Same as getSubjectPublicKeyAlgorithm(), but returns an ID, not a string. virtual svl::crypto::SignatureMethodAlgorithm getSignatureMethodAlgorithm() = 0; - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const& aIdentifier) override; - static css::uno::Sequence<sal_Int8> const& getUnoTunnelId(); - protected: ~Certificate() noexcept = default; }; diff --git a/xmlsecurity/inc/framework/signatureverifierimpl.hxx b/xmlsecurity/inc/framework/signatureverifierimpl.hxx index 29d286d7ee57..15c79643e0aa 100644 --- a/xmlsecurity/inc/framework/signatureverifierimpl.hxx +++ b/xmlsecurity/inc/framework/signatureverifierimpl.hxx @@ -22,7 +22,6 @@ #include <com/sun/star/xml/crypto/sax/XSignatureVerifyResultBroadcaster.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <cppuhelper/implbase.hxx> #include <xmlsecuritydllapi.h> @@ -36,8 +35,7 @@ typedef cppu::ImplInheritanceHelper SignatureEngine, css::xml::crypto::sax::XSignatureVerifyResultBroadcaster, css::lang::XInitialization, - css::lang::XServiceInfo, - css::lang::XUnoTunnel + css::lang::XServiceInfo > SignatureVerifierImpl_Base; class SignatureVerifierImpl final : public SignatureVerifierImpl_Base @@ -76,9 +74,6 @@ public: virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; - sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override; - static css::uno::Sequence<sal_Int8> const & getUnoTunnelId(); - void updateSignature( const css::uno::Reference< css::xml::crypto::XXMLSignature >& xSignature, const css::uno::Reference< css::xml::crypto::XXMLSecurityContext >& xContext ) { m_xXMLSignature = xSignature; m_xXMLSecurityContext = xContext; } }; diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx index d75c93de1a4a..d8518ece0f9b 100644 --- a/xmlsecurity/qa/unit/signing/signing.cxx +++ b/xmlsecurity/qa/unit/signing/signing.cxx @@ -33,7 +33,6 @@ #include <comphelper/processfactory.hxx> #include <comphelper/propertysequence.hxx> -#include <comphelper/servicehelper.hxx> #include <unotools/mediadescriptor.hxx> #include <unotools/tempfile.hxx> #include <unotools/ucbstreamhelper.hxx> @@ -128,7 +127,7 @@ SigningTest::getCertificate(DocumentSignatureManager& rSignatureManager, for (const auto& xCertificate : aCertificates) { - auto pCertificate = comphelper::getFromUnoTunnel<xmlsecurity::Certificate>(xCertificate); + auto pCertificate = dynamic_cast<xmlsecurity::Certificate*>(xCertificate.get()); CPPUNIT_ASSERT(pCertificate); if (pCertificate->getSignatureMethodAlgorithm() == eAlgo && IsValid(xCertificate, xSecurityEnvironment)) diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx index 4ab5851581ee..990fa5dea739 100644 --- a/xmlsecurity/source/component/documentdigitalsignatures.cxx +++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx @@ -52,7 +52,6 @@ #include <comphelper/documentconstants.hxx> #include <comphelper/propertyvalue.hxx> #include <comphelper/sequence.hxx> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/implbase.hxx> #include <comphelper/xmlsechelper.hxx> #include <cppuhelper/supportsservice.hxx> @@ -72,9 +71,9 @@ using namespace css::xml::crypto; namespace { class DocumentDigitalSignatures - : public cppu::ImplInheritanceHelper<sfx2::DigitalSignatures, - css::security::XDocumentDigitalSignatures, - css::lang::XInitialization, css::lang::XServiceInfo> + : public cppu::WeakImplHelper<css::security::XDocumentDigitalSignatures, + css::lang::XInitialization, css::lang::XServiceInfo>, + public sfx2::DigitalSignatures { private: css::uno::Reference<css::uno::XComponentContext> mxCtx; @@ -686,8 +685,8 @@ sal_Bool DocumentDigitalSignatures::isAuthorTrusted( return false; uno::Reference<css::security::XCertificate> xCert = aSignatureManager.getSecurityEnvironment()->createCertificateFromAscii(rAuthor.RawData); - auto pAuthor = comphelper::getFromUnoTunnel<xmlsecurity::Certificate>(xAuthor); - auto pCert = comphelper::getFromUnoTunnel<xmlsecurity::Certificate>(xCert); + auto pAuthor = dynamic_cast<xmlsecurity::Certificate*>(xAuthor.get()); + auto pCert = dynamic_cast<xmlsecurity::Certificate*>(xCert.get()); if (pAuthor && pCert) return pCert->getSHA256Thumbprint() == pAuthor->getSHA256Thumbprint(); diff --git a/xmlsecurity/source/framework/signatureverifierimpl.cxx b/xmlsecurity/source/framework/signatureverifierimpl.cxx index 3489dab31bed..44e9e4c0a46c 100644 --- a/xmlsecurity/source/framework/signatureverifierimpl.cxx +++ b/xmlsecurity/source/framework/signatureverifierimpl.cxx @@ -21,7 +21,6 @@ #include <framework/signatureverifierimpl.hxx> #include <framework/xmlsignaturetemplateimpl.hxx> #include <com/sun/star/xml/crypto/XXMLSignatureTemplate.hpp> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <osl/diagnose.h> #include <rtl/ref.hxx> @@ -128,13 +127,4 @@ css::uno::Sequence< OUString > SAL_CALL SignatureVerifierImpl::getSupportedServi return SignatureVerifierImpl_getSupportedServiceNames(); } -sal_Int64 SignatureVerifierImpl::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { - return comphelper::getSomethingImpl(aIdentifier, this); -} - -css::uno::Sequence<sal_Int8> const & SignatureVerifierImpl::getUnoTunnelId() { - static comphelper::UnoIdInit const id; - return id.getSeq(); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/gpg/CertificateImpl.cxx b/xmlsecurity/source/gpg/CertificateImpl.cxx index ae2c4544e001..a0a08fc807a8 100644 --- a/xmlsecurity/source/gpg/CertificateImpl.cxx +++ b/xmlsecurity/source/gpg/CertificateImpl.cxx @@ -196,8 +196,7 @@ sal_Int32 SAL_CALL CertificateImpl::getCertificateUsage() /* XUnoTunnel */ sal_Int64 SAL_CALL CertificateImpl::getSomething(const Sequence< sal_Int8 >& aIdentifier) { - return comphelper::getSomethingImpl( - aIdentifier, this, comphelper::FallbackToGetSomethingOf<xmlsecurity::Certificate>{}); + return comphelper::getSomethingImpl(aIdentifier, this); } /* XUnoTunnel extension */ diff --git a/xmlsecurity/source/gpg/CertificateImpl.hxx b/xmlsecurity/source/gpg/CertificateImpl.hxx index 1c845f5dc103..b6c50cb2ed5c 100644 --- a/xmlsecurity/source/gpg/CertificateImpl.hxx +++ b/xmlsecurity/source/gpg/CertificateImpl.hxx @@ -14,9 +14,13 @@ #include <sal/types.h> #include <sal/config.h> #include <rtl/ustring.hxx> +#include <cppuhelper/implbase.hxx> #include <com/sun/star/uno/Sequence.hxx> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/security/CertificateKind.hpp> +#include <com/sun/star/security/XCertificate.hpp> #if defined _MSC_VER && defined __clang__ #pragma clang diagnostic push @@ -27,7 +31,10 @@ #pragma clang diagnostic pop #endif -class CertificateImpl : public xmlsecurity::Certificate +class CertificateImpl : public cppu::WeakImplHelper< css::security::XCertificate, + css::lang::XUnoTunnel, + css::lang::XServiceInfo >, + public xmlsecurity::Certificate { private: GpgME::Key m_pKey; diff --git a/xmlsecurity/source/helper/documentsignaturemanager.cxx b/xmlsecurity/source/helper/documentsignaturemanager.cxx index 5c6c9efea726..cd08aadacc13 100644 --- a/xmlsecurity/source/helper/documentsignaturemanager.cxx +++ b/xmlsecurity/source/helper/documentsignaturemanager.cxx @@ -37,7 +37,6 @@ #include <com/sun/star/frame/XModel.hpp> #include <comphelper/base64.hxx> -#include <comphelper/servicehelper.hxx> #include <comphelper/storagehelper.hxx> #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> @@ -332,7 +331,7 @@ bool DocumentSignatureManager::add( comphelper::Base64::encode(aStrBuffer, xCert->getEncoded()); OUString aKeyId; - if (auto pCertificate = comphelper::getFromUnoTunnel<xmlsecurity::Certificate>(xCert)) + if (auto pCertificate = dynamic_cast<xmlsecurity::Certificate*>(xCert.get())) { OUStringBuffer aBuffer; comphelper::Base64::encode(aBuffer, pCertificate->getSHA256Thumbprint()); @@ -379,7 +378,7 @@ bool DocumentSignatureManager::add( OUString aCertDigest; svl::crypto::SignatureMethodAlgorithm eAlgorithmID = svl::crypto::SignatureMethodAlgorithm::RSA; - if (auto pCertificate = comphelper::getFromUnoTunnel<xmlsecurity::Certificate>(xCert)) + if (auto pCertificate = dynamic_cast<xmlsecurity::Certificate*>(xCert.get())) { OUStringBuffer aBuffer; comphelper::Base64::encode(aBuffer, pCertificate->getSHA256Thumbprint()); diff --git a/xmlsecurity/source/helper/xsecverify.cxx b/xmlsecurity/source/helper/xsecverify.cxx index e2d3fc8b5050..c45bece5fed9 100644 --- a/xmlsecurity/source/helper/xsecverify.cxx +++ b/xmlsecurity/source/helper/xsecverify.cxx @@ -42,7 +42,6 @@ #include <comphelper/processfactory.hxx> #include <comphelper/propertyvalue.hxx> #include <comphelper/seqstream.hxx> -#include <comphelper/servicehelper.hxx> namespace com::sun::star::graphic { class XGraphic; } @@ -134,8 +133,8 @@ void XSecController::switchGpgSignature() return; SignatureVerifierImpl* pImpl= - comphelper::getFromUnoTunnel<SignatureVerifierImpl>( - m_vInternalSignatureInformations.back().xReferenceResolvedListener); + dynamic_cast<SignatureVerifierImpl*>( + m_vInternalSignatureInformations.back().xReferenceResolvedListener.get()); if (pImpl) { css::uno::Reference<css::xml::crypto::XSEInitializer> xGpgSEInitializer( diff --git a/xmlsecurity/source/xmlsec/certificate.cxx b/xmlsecurity/source/xmlsec/certificate.cxx deleted file mode 100644 index f43273a47518..000000000000 --- a/xmlsecurity/source/xmlsec/certificate.cxx +++ /dev/null @@ -1,27 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#include <sal/config.h> - -#include <comphelper/servicehelper.hxx> - -#include <certificate.hxx> - -sal_Int64 xmlsecurity::Certificate::getSomething(css::uno::Sequence<sal_Int8> const& aIdentifier) -{ - return comphelper::getSomethingImpl(aIdentifier, this); -} - -css::uno::Sequence<sal_Int8> const& xmlsecurity::Certificate::getUnoTunnelId() -{ - static comphelper::UnoIdInit const id; - return id.getSeq(); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx index 96d4b691d3d4..88bf6169bf11 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx @@ -458,7 +458,7 @@ void X509Certificate_MSCryptImpl::setRawCert( Sequence< sal_Int8 > const & rawCe } /* XUnoTunnel */ -UNO3_GETIMPLEMENTATION2_IMPL(X509Certificate_MSCryptImpl, Certificate); +UNO3_GETIMPLEMENTATION_IMPL(X509Certificate_MSCryptImpl); static OUString findOIDDescription(char const *oid) { diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx index 53016dd6c438..9bd6a34ce68e 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx +++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx @@ -27,13 +27,20 @@ #include <sal/config.h> #include <rtl/ustring.hxx> #include <cppuhelper/factory.hxx> +#include <cppuhelper/implbase.hxx> #include <comphelper/servicehelper.hxx> #include <com/sun/star/uno/Exception.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/uno/SecurityException.hpp> #include <com/sun/star/security/CertificateKind.hpp> +#include <com/sun/star/security/XCertificate.hpp> #include <certificate.hxx> -class X509Certificate_MSCryptImpl : public xmlsecurity::Certificate +class X509Certificate_MSCryptImpl : public ::cppu::WeakImplHelper< + css::security::XCertificate , + css::lang::XUnoTunnel, + css::lang::XServiceInfo > , public xmlsecurity::Certificate { private: const CERT_CONTEXT* m_pCertContext ; diff --git a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx index b737a845fb45..79441da1edf5 100644 --- a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx @@ -334,8 +334,7 @@ SECKEYPrivateKey* X509Certificate_NssImpl::getPrivateKey() /* XUnoTunnel */ sal_Int64 SAL_CALL X509Certificate_NssImpl::getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) { - return comphelper::getSomethingImpl( - aIdentifier, this, comphelper::FallbackToGetSomethingOf<xmlsecurity::Certificate>{}); + return comphelper::getSomethingImpl(aIdentifier, this); } /* XUnoTunnel extension */ diff --git a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx index 26d85a09f491..dbfb6c6b07ed 100644 --- a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx +++ b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx @@ -21,13 +21,20 @@ #include <sal/config.h> #include <rtl/ustring.hxx> +#include <cppuhelper/implbase.hxx> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/security/CertificateKind.hpp> +#include <com/sun/star/security/XCertificate.hpp> #include <certificate.hxx> #include <certt.h> #include <keythi.h> -class X509Certificate_NssImpl : public xmlsecurity::Certificate +class X509Certificate_NssImpl : public ::cppu::WeakImplHelper< + css::security::XCertificate , + css::lang::XUnoTunnel, + css::lang::XServiceInfo > , public xmlsecurity::Certificate { private: CERTCertificate* m_pCert; |