diff options
-rw-r--r-- | canvas/source/vcl/canvasfont.cxx | 10 | ||||
-rw-r--r-- | canvas/source/vcl/canvasfont.hxx | 7 | ||||
-rw-r--r-- | canvas/source/vcl/canvashelper.cxx | 2 |
3 files changed, 17 insertions, 2 deletions
diff --git a/canvas/source/vcl/canvasfont.cxx b/canvas/source/vcl/canvasfont.cxx index e7fab0492549..0f342de0785a 100644 --- a/canvas/source/vcl/canvasfont.cxx +++ b/canvas/source/vcl/canvasfont.cxx @@ -22,6 +22,7 @@ #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> @@ -168,6 +169,15 @@ 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 fdfa870f5ed3..a4fd9fb0bc3e 100644 --- a/canvas/source/vcl/canvasfont.hxx +++ b/canvas/source/vcl/canvasfont.hxx @@ -23,6 +23,7 @@ #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,7 +41,8 @@ namespace vclcanvas { typedef ::cppu::WeakComponentImplHelper< css::rendering::XCanvasFont, - css::lang::XServiceInfo > CanvasFont_Base; + css::lang::XServiceInfo, + css::lang::XUnoTunnel > CanvasFont_Base; class CanvasFont : public ::cppu::BaseMutex, public CanvasFont_Base @@ -73,6 +75,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<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 cbbd18a376d9..60ab39d470a2 100644 --- a/canvas/source/vcl/canvashelper.cxx +++ b/canvas/source/vcl/canvashelper.cxx @@ -1111,7 +1111,7 @@ namespace vclcanvas setupOutDevState( viewState, renderState, TEXT_COLOR ); - CanvasFont* pFont = dynamic_cast< CanvasFont* >( xFont.get() ); + CanvasFont* pFont = comphelper::getFromUnoTunnel< CanvasFont >( xFont ); ENSURE_ARG_OR_THROW( pFont, "Font not compatible with this canvas" ); |