summaryrefslogtreecommitdiff
path: root/embeddedobj
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-12-12 13:23:05 +0100
committerStephan Bergmann <sbergman@redhat.com>2022-12-22 13:47:26 +0000
commit73df933f5fa5932f94e5a1b338a3eda00a9ce354 (patch)
tree21987771fdf693a38bba3414e6b22cc74ce8d4fa /embeddedobj
parent420165ab0ef03c0467f9d17f504de2d2fc78f0e6 (diff)
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 <sbergman@redhat.com>
Diffstat (limited to 'embeddedobj')
-rw-r--r--embeddedobj/source/commonembedding/miscobj.cxx7
-rw-r--r--embeddedobj/source/inc/commonembobj.hxx7
2 files changed, 13 insertions, 1 deletions
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 <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>
@@ -762,6 +764,7 @@ 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;
}
@@ -771,6 +774,10 @@ 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 8f0a685c22c3..330dbe7ad829 100644
--- a/embeddedobj/source/inc/commonembobj.hxx
+++ b/embeddedobj/source/inc/commonembobj.hxx
@@ -35,11 +35,12 @@
#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 {
@@ -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<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: */