From 73df933f5fa5932f94e5a1b338a3eda00a9ce354 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 12 Dec 2022 13:23:05 +0100 Subject: loplugin:unocast (css::embed::EmbeddedUpdate) (See the upcoming commit introducing that loplugin:unocast on why such dynamic_casts from UNO types are dangerous.) Change-Id: Ia0f628be9adf749ffdd9ad36ca9b1e8c98e29936 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144755 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- embeddedobj/source/commonembedding/miscobj.cxx | 7 +++++++ embeddedobj/source/inc/commonembobj.hxx | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'embeddedobj') diff --git a/embeddedobj/source/commonembedding/miscobj.cxx b/embeddedobj/source/commonembedding/miscobj.cxx index ecd149b8bb17..a0cce3c6f34b 100644 --- a/embeddedobj/source/commonembedding/miscobj.cxx +++ b/embeddedobj/source/commonembedding/miscobj.cxx @@ -25,11 +25,13 @@ #include #include #include +#include #include #include #include #include +#include #include #include @@ -762,6 +764,7 @@ uno::Sequence SAL_CALL OCommonEmbeddedObject::getTypes() cppu::UnoType::get(), cppu::UnoType::get(), cppu::UnoType::get(), + cppu::UnoType::get(), }; return aTypes; } @@ -771,6 +774,10 @@ uno::Sequence SAL_CALL OCommonEmbeddedObject::getImplementationId() return uno::Sequence(); } +sal_Int64 OCommonEmbeddedObject::getSomething(css::uno::Sequence const & aIdentifier) { + return comphelper::getSomethingImpl(aIdentifier, static_cast(this)); +} + void SAL_CALL OCommonEmbeddedObject::initialize(const uno::Sequence& rArguments) { if (!rArguments.hasElements()) diff --git a/embeddedobj/source/inc/commonembobj.hxx b/embeddedobj/source/inc/commonembobj.hxx index 8f0a685c22c3..330dbe7ad829 100644 --- a/embeddedobj/source/inc/commonembobj.hxx +++ b/embeddedobj/source/inc/commonembobj.hxx @@ -35,11 +35,12 @@ #include #include #include +#include #include -#include #include #include #include +#include #include namespace com::sun::star { @@ -87,6 +88,7 @@ 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: @@ -434,6 +436,9 @@ public: // XTypeProvider css::uno::Sequence SAL_CALL getTypes() override; css::uno::Sequence SAL_CALL getImplementationId() override; + + // XUnoTunnel + sal_Int64 SAL_CALL getSomething(css::uno::Sequence const & aIdentifier) override; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit