summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-06-07 16:49:58 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-07-04 18:08:20 +0200
commit76abcd5f912f1a9e6f86ffc2a489ba7dba1aac56 (patch)
treeded6e260c003a5e15e02c85b65516c5890d46146 /filter
parentefa1d0df9a108b585bddd0a7e8ba5a4f64df3489 (diff)
sw HTML export: use PNG fallback + RTF native data for all images for ReqIF
ReqIF says the image should be either PNG or has a PNG fallback and then it can be something else. We used to convert images to PNG to avoid writing any native data, but results in data loss. So instead: 1) Write the original image as an RTF fragment, so it's not lost. 2) Some ReqIF parsers expect an RTF fragment even for PNG, so make sure we always write the RTF fragment, even if that means a small duplication. Change-Id: Ida0fcaa58d56b9e11f81992307505599807353b5 Reviewed-on: https://gerrit.libreoffice.org/55430 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins
Diffstat (limited to 'filter')
-rw-r--r--filter/source/msfilter/rtfutil.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/filter/source/msfilter/rtfutil.cxx b/filter/source/msfilter/rtfutil.cxx
index ad2031d5536f..4ff71330b85c 100644
--- a/filter/source/msfilter/rtfutil.cxx
+++ b/filter/source/msfilter/rtfutil.cxx
@@ -285,6 +285,22 @@ bool ExtractOLE2FromObjdata(const OString& rObjdata, SvStream& rOle2)
return true;
}
+
+bool StripMetafileHeader(const sal_uInt8*& rpGraphicAry, sal_uInt64& rSize)
+{
+ if (rpGraphicAry && (rSize > 0x22))
+ {
+ if ((rpGraphicAry[0] == 0xd7) && (rpGraphicAry[1] == 0xcd) && (rpGraphicAry[2] == 0xc6)
+ && (rpGraphicAry[3] == 0x9a))
+ {
+ // we have to get rid of the metafileheader
+ rpGraphicAry += 22;
+ rSize -= 22;
+ return true;
+ }
+ }
+ return false;
+}
}
}