summaryrefslogtreecommitdiff
path: root/sw/source/filter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-10-19 17:53:51 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-10-20 00:41:26 +0200
commit326c8d06070a4a41a666db919702f7c423dc7a18 (patch)
tree6f7d669c5f5cf40cb94c003c6fdbcb7512ba2337 /sw/source/filter
parentc4cec8647faf130111d67302e75998ddff4c0792 (diff)
sw reqif-xhtml export, embedded objects: handle non-package Ole10Native stream
Commit 1392fd6a7eaf9f507639096984c2a0108f254795 (sw reqif-xhtml export, embedded objects: handle Ole10Native stream, 2020-04-30) added support for handling an OLE1 stream which contains something other than OLE2 data. However, that assumed a fixed class name ("Package") and a matching class id. Fix this, similar to how the import side was fixed with commit 247b247dadc8f0133a8eb94f1423a29315cf998a (sw reqif-xhtml import, embedded objects: handle non-package Ole10Native stream, 2020-10-16). Change-Id: If2ec9434c802e23e395cf2a6eaf63ad5b1db9c1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104531 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/source/filter')
-rw-r--r--sw/source/filter/html/htmlreqifreader.cxx17
1 files changed, 16 insertions, 1 deletions
diff --git a/sw/source/filter/html/htmlreqifreader.cxx b/sw/source/filter/html/htmlreqifreader.cxx
index 2e20e84f06b8..e7b4dece4a41 100644
--- a/sw/source/filter/html/htmlreqifreader.cxx
+++ b/sw/source/filter/html/htmlreqifreader.cxx
@@ -20,6 +20,7 @@
#include <filter/msfilter/msdffimp.hxx>
#include <vcl/cvtgrf.hxx>
#include <ndole.hxx>
+#include <sal/log.hxx>
namespace
{
@@ -155,7 +156,21 @@ OString InsertOLE1HeaderFromOle10NativeStream(const tools::SvRef<SotStorage>& xS
sal_uInt32 nOle1Size = 0;
xOle1Stream->ReadUInt32(nOle1Size);
- OString aClassName("Package");
+ OString aClassName;
+ if (xStorage->GetClassName() == SvGlobalName(0x0003000A, 0, 0, 0xc0, 0, 0, 0, 0, 0, 0, 0x46))
+ {
+ aClassName = "PBrush";
+ }
+ else
+ {
+ if (xStorage->GetClassName()
+ != SvGlobalName(0x0003000C, 0, 0, 0xc0, 0, 0, 0, 0, 0, 0, 0x46))
+ {
+ SAL_WARN("sw.html", "InsertOLE1HeaderFromOle10NativeStream: unexpected class id: "
+ << xStorage->GetClassName().GetHexName());
+ }
+ aClassName = "Package";
+ }
// Write ObjectHeader, see [MS-OLEDS] 2.2.4.
rOle1.Seek(0);