diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx index 60ab39d470a2..9ad9716dde1d 100644 --- a/canvas/source/vcl/canvashelper.cxx +++ b/canvas/source/vcl/canvashelper.cxx @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -612,7 +613,7 @@ namespace vclcanvas ENSURE_ARG_OR_THROW( xLayoutedText.is(), "layout is NULL"); - TextLayout* pTextLayout = dynamic_cast< TextLayout* >( xLayoutedText.get() ); + TextLayout* pTextLayout = comphelper::getFromUnoTunnel< TextLayout >( xLayoutedText ); if( pTextLayout ) { diff --git a/canvas/source/vcl/textlayout.cxx b/canvas/source/vcl/textlayout.cxx index 689720e4570a..6131cce0e380 100644 --- a/canvas/source/vcl/textlayout.cxx +++ b/canvas/source/vcl/textlayout.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -420,6 +421,15 @@ namespace vclcanvas { return { "com.sun.star.rendering.TextLayout" }; } + + sal_Int64 TextLayout::getSomething(css::uno::Sequence const & aIdentifier) { + return comphelper::getSomethingImpl(aIdentifier, this); + } + + css::uno::Sequence 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 be8603d812f1..53f3f73033ac 100644 --- a/canvas/source/vcl/textlayout.hxx +++ b/canvas/source/vcl/textlayout.hxx @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -34,7 +35,8 @@ namespace vclcanvas { typedef ::cppu::WeakComponentImplHelper< css::rendering::XTextLayout, - css::lang::XServiceInfo > TextLayout_Base; + css::lang::XServiceInfo, + css::lang::XUnoTunnel > TextLayout_Base; class TextLayout : public ::cppu::BaseMutex, public TextLayout_Base @@ -78,6 +80,9 @@ 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 const & aIdentifier) override; + static css::uno::Sequence const & getUnoTunnelId(); + void draw( OutputDevice& rOutDev, const Point& rOutpos, const css::rendering::ViewState& viewState,