summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embeddedobj/source/commonembedding/miscobj.cxx7
-rw-r--r--embeddedobj/source/inc/commonembobj.hxx7
-rw-r--r--include/svtools/embeddedupdate.hxx (renamed from include/embeddedobj/embeddedupdate.hxx)8
-rw-r--r--svtools/Library_svt.mk1
-rw-r--r--svtools/source/misc/embeddedupdate.cxx22
-rw-r--r--svtools/source/misc/embedhlp.cxx5
6 files changed, 45 insertions, 5 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: */
diff --git a/include/embeddedobj/embeddedupdate.hxx b/include/svtools/embeddedupdate.hxx
index 63e7bf4464c8..95d49d35764a 100644
--- a/include/embeddedobj/embeddedupdate.hxx
+++ b/include/svtools/embeddedupdate.hxx
@@ -9,7 +9,9 @@
#pragma once
-#include <embeddedobj/embobjdllapi.h>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <sal/types.h>
+#include <svtools/svtdllapi.h>
namespace com
{
@@ -24,7 +26,7 @@ namespace embed
@since LibreOffice 7.4
*/
-class EMBOBJ_DLLPUBLIC SAL_LOPLUGIN_ANNOTATE("crosscast") EmbeddedUpdate
+class SVT_DLLPUBLIC EmbeddedUpdate
{
/** By "Refresh all" is used to perform an OLE update and a link update.
In the case of a link update, the class OCommonEmbeddedObject is
@@ -40,6 +42,8 @@ public:
EmbeddedUpdate() = default;
virtual ~EmbeddedUpdate() = default;
+ static css::uno::Sequence<sal_Int8> const& getUnoTunnelId();
+
private:
EmbeddedUpdate(const EmbeddedUpdate&) = delete;
EmbeddedUpdate& operator=(const EmbeddedUpdate&) = delete;
diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk
index ec2405d65636..94c34808d3df 100644
--- a/svtools/Library_svt.mk
+++ b/svtools/Library_svt.mk
@@ -125,6 +125,7 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
svtools/source/misc/cliplistener \
svtools/source/misc/dialogclosedlistener \
svtools/source/misc/ehdl \
+ svtools/source/misc/embeddedupdate \
svtools/source/misc/embedhlp \
svtools/source/misc/embedtransfer \
svtools/source/misc/filechangedchecker \
diff --git a/svtools/source/misc/embeddedupdate.cxx b/svtools/source/misc/embeddedupdate.cxx
new file mode 100644
index 000000000000..e763ef08e7fd
--- /dev/null
+++ b/svtools/source/misc/embeddedupdate.cxx
@@ -0,0 +1,22 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <sal/config.h>
+
+#include <comphelper/servicehelper.hxx>
+#include <sal/types.h>
+#include <svtools/embeddedupdate.hxx>
+
+css::uno::Sequence<sal_Int8> const& css::embed::EmbeddedUpdate::getUnoTunnelId()
+{
+ static comphelper::UnoIdInit const id;
+ return id.getSeq();
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index d784b20a4a39..17808b2892a3 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -19,6 +19,7 @@
#include <libxml/xmlwriter.h>
+#include <svtools/embeddedupdate.hxx>
#include <svtools/embedhlp.hxx>
#include <vcl/graphicfilter.hxx>
#include <vcl/gdimtf.hxx>
@@ -30,6 +31,7 @@
#include <sal/log.hxx>
#include <comphelper/fileformat.h>
#include <comphelper/embeddedobjectcontainer.hxx>
+#include <comphelper/servicehelper.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <unotools/streamwrap.hxx>
@@ -52,7 +54,6 @@
#include <com/sun/star/embed/XLinkageSupport.hpp>
#include <com/sun/star/chart2/XDefaultSizeTransmitter.hpp>
#include <com/sun/star/qa/XDumper.hpp>
-#include <embeddedobj/embeddedupdate.hxx>
#include <cppuhelper/implbase.hxx>
#include <vcl/svapp.hxx>
#include <comphelper/diagnose_ex.hxx>
@@ -933,7 +934,7 @@ void EmbeddedObjectRef::UpdateReplacement( bool bUpdateOle )
void EmbeddedObjectRef::UpdateOleObject( bool bUpdateOle )
{
- embed::EmbeddedUpdate* pObj = dynamic_cast<embed::EmbeddedUpdate*> (GetObject().get());
+ embed::EmbeddedUpdate* pObj = comphelper::getFromUnoTunnel<embed::EmbeddedUpdate> (GetObject());
if( pObj )
pObj->SetOleState( bUpdateOle );
}