diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-10-19 17:53:51 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-10-20 14:19:07 +0200 |
commit | 5d17cca632e16b9594f87eb5a5f4cd4f58829283 (patch) | |
tree | 1c217b45cad09e2393e3565ce15a48a0e6201d49 /sw/source/filter/html/htmlreqifreader.cxx | |
parent | 41dfc4ae65679047a8486d78430d5f72abb10a52 (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).
(cherry picked from commit 326c8d06070a4a41a666db919702f7c423dc7a18)
Conflicts:
sw/qa/extras/htmlexport/htmlexport.cxx
Change-Id: If2ec9434c802e23e395cf2a6eaf63ad5b1db9c1c
Diffstat (limited to 'sw/source/filter/html/htmlreqifreader.cxx')
-rw-r--r-- | sw/source/filter/html/htmlreqifreader.cxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sw/source/filter/html/htmlreqifreader.cxx b/sw/source/filter/html/htmlreqifreader.cxx index 69a538cb4d88..3215a2e5bf33 100644 --- a/sw/source/filter/html/htmlreqifreader.cxx +++ b/sw/source/filter/html/htmlreqifreader.cxx @@ -21,6 +21,7 @@ #include <filter/msfilter/msdffimp.hxx> #include <vcl/cvtgrf.hxx> #include <ndole.hxx> +#include <sal/log.hxx> namespace { @@ -156,7 +157,21 @@ OString InsertOLE1HeaderFromOle10NativeStream(tools::SvRef<SotStorage>& xStorage 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); |