diff options
Diffstat (limited to 'canvas')
38 files changed, 38 insertions, 283 deletions
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, |