summaryrefslogtreecommitdiff
path: root/embeddedobj
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-03-23 10:58:46 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-03-23 14:52:50 +0100
commit781c1181718c295e0f7c0c2169d0f6d539f685df (patch)
tree2ed6621d454e0221e709609c85dddb657adbb016 /embeddedobj
parent1b1cfe4837ee7776317f63bb92edcee2d1903b9c (diff)
sw XHTML import: support OLE2-in-RTF objects
If you like layering things on top of each other, then this commit message is for you. So it's possible to have a PPTX file in the following wrappers: - wrap PPTX in a binary OLE2 container - wrap that in an OLE1 container - wrap that in an RTF fragment - wrap that in an XHTML fragment (in a ReqIF file) Turns out that only the RTF and OLE1 unwrapping was missing, the rest worked already, so implement the missing piece in a new SwReqIfReader namespace. Finally extend OleEmbeddedObject to be able to read its native data stream when the object is opened, reading it from the storage would fail, as the object already opened the storage stream. Change-Id: I2934c9fb7474e981ff6bb2f7eb253a3a86cfd98b Reviewed-on: https://gerrit.libreoffice.org/51772 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'embeddedobj')
-rw-r--r--embeddedobj/source/inc/oleembobj.hxx7
-rw-r--r--embeddedobj/source/msole/olemisc.cxx10
2 files changed, 16 insertions, 1 deletions
diff --git a/embeddedobj/source/inc/oleembobj.hxx b/embeddedobj/source/inc/oleembobj.hxx
index 5df00c5e0a16..e944c6cfd842 100644
--- a/embeddedobj/source/inc/oleembobj.hxx
+++ b/embeddedobj/source/inc/oleembobj.hxx
@@ -36,6 +36,7 @@
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/util/XCloseListener.hpp>
+#include <com/sun/star/io/XActiveDataStreamer.hpp>
#include <cppuhelper/implbase.hxx>
#include <rtl/ref.hxx>
@@ -110,7 +111,8 @@ class OleEmbeddedObject : public ::cppu::WeakImplHelper
, css::embed::XEmbedPersist
, css::embed::XLinkageSupport
, css::embed::XInplaceObject
- , css::container::XChild >
+ , css::container::XChild
+ , css::io::XActiveDataStreamer >
{
friend class OleComponent;
@@ -431,6 +433,9 @@ public:
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent( ) override;
virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& Parent ) override;
+ // XActiveDataStreamer
+ void SAL_CALL setStream(const css::uno::Reference<css::io::XStream>& xStream) override;
+ css::uno::Reference<css::io::XStream> SAL_CALL getStream() override;
};
#endif
diff --git a/embeddedobj/source/msole/olemisc.cxx b/embeddedobj/source/msole/olemisc.cxx
index ad348f468c98..4ae70b745a7a 100644
--- a/embeddedobj/source/msole/olemisc.cxx
+++ b/embeddedobj/source/msole/olemisc.cxx
@@ -670,4 +670,14 @@ void SAL_CALL OleEmbeddedObject::setParent( const css::uno::Reference< css::uno:
m_xParent = xParent;
}
+void OleEmbeddedObject::setStream(const css::uno::Reference<css::io::XStream>& xStream)
+{
+ m_xObjectStream = xStream;
+}
+
+css::uno::Reference<css::io::XStream> OleEmbeddedObject::getStream()
+{
+ return m_xObjectStream;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */