diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2018-11-14 17:17:46 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2018-11-14 19:20:43 +0100 |
commit | 72e6269b88a32a672e00d2c25f0d0400038d1360 (patch) | |
tree | 13ba7aecd52a64f354f5d2a94a62dba7fc0aa5dc /embeddedobj/source/inc/oleembobj.hxx | |
parent | 6e566c2b2b23d457a9fd47c16df15ce11e84c8e8 (diff) |
sw: fix modification of ole obj native data during HTML import
It is expected that if you load an OLE2 storage (from reqif-xhtml) and
you save it as ODT, the OLE2 data is not modified. This was almost the
case, but we insisted on removing the OLE2 preview from the storage.
Add a new flag to OleEmbeddedObject, so import filters can opt in for
not modifying the OLE2 data.
[ The nice situation is that we already had a test file which had a
preview stream in the OLE2 storage, so we can easily assert there that
the size doesn't change. ]
Change-Id: I9b8b29f015dd4f2513e51a1066767218580cb5d8
Reviewed-on: https://gerrit.libreoffice.org/63381
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'embeddedobj/source/inc/oleembobj.hxx')
-rw-r--r-- | embeddedobj/source/inc/oleembobj.hxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/embeddedobj/source/inc/oleembobj.hxx b/embeddedobj/source/inc/oleembobj.hxx index b1f44fbbd429..d9b75d2a9836 100644 --- a/embeddedobj/source/inc/oleembobj.hxx +++ b/embeddedobj/source/inc/oleembobj.hxx @@ -37,6 +37,7 @@ #include <com/sun/star/util/XCloseable.hpp> #include <com/sun/star/util/XCloseListener.hpp> #include <com/sun/star/io/XActiveDataStreamer.hpp> +#include <com/sun/star/lang/XInitialization.hpp> #include <cppuhelper/implbase.hxx> #include <rtl/ref.hxx> @@ -117,7 +118,8 @@ class OleEmbeddedObject : public ::cppu::WeakImplHelper , css::embed::XLinkageSupport , css::embed::XInplaceObject , css::container::XChild - , css::io::XActiveDataStreamer > + , css::io::XActiveDataStreamer + , css::lang::XInitialization > { friend class OleComponent; @@ -205,6 +207,9 @@ class OleEmbeddedObject : public ::cppu::WeakImplHelper css::uno::Reference< css::uno::XInterface > m_xParent; + /// If it is allowed to modify entires in the stream of the OLE storage. + bool m_bStreamReadOnly = false; + protected: /// @throws css::uno::Exception css::uno::Reference< css::io::XStream > TryToGetAcceptableFormat_Impl( @@ -441,6 +446,9 @@ public: // XActiveDataStreamer void SAL_CALL setStream(const css::uno::Reference<css::io::XStream>& xStream) override; css::uno::Reference<css::io::XStream> SAL_CALL getStream() override; + + // XInitialization + void SAL_CALL initialize(const css::uno::Sequence<css::uno::Any>& rArguments) override; }; #endif |