summaryrefslogtreecommitdiff
path: root/sw/source/filter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-05-31 17:37:02 +0200
committerMiklos Vajna <vmiklos@collabora.com>2021-05-31 19:25:44 +0200
commite1546b790763c1004dc2e2e3581c666466d7cf9c (patch)
tree1680a35b77634676638f0ea82db554728e12af8b /sw/source/filter
parent2efe1e8977a83143696b8db49c7c26bbff91c04c (diff)
sw XHTML / reqif export: export PNG images directly, without an OLE wrapper
Do this by default and add a ExportImagesAsOLE=true option for those who want the old behavior. Adapt existing tests to ask for the old behavior and add a new one that depends on the new default. Change-Id: If863215ce267d6accc85b5c8f7bdbd3f2b1e9187 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116486 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/source/filter')
-rw-r--r--sw/source/filter/html/htmlflywriter.cxx4
-rw-r--r--sw/source/filter/html/wrthtml.cxx10
-rw-r--r--sw/source/filter/html/wrthtml.hxx3
3 files changed, 12 insertions, 5 deletions
diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx
index d2ab65efc7dc..09dfa97a5220 100644
--- a/sw/source/filter/html/htmlflywriter.cxx
+++ b/sw/source/filter/html/htmlflywriter.cxx
@@ -1863,7 +1863,7 @@ static Writer& OutHTML_FrameFormatGrfNode( Writer& rWrt, const SwFrameFormat& rF
if (xGraphic.is() && aMimeType.isEmpty())
xGraphic->getPropertyValue("MimeType") >>= aMimeType;
- if (rHTMLWrt.mbReqIF)
+ if (rHTMLWrt.mbReqIF && rHTMLWrt.m_bExportImagesAsOLE)
{
// Write the original image as an RTF fragment.
OUString aFileName;
@@ -1893,7 +1893,7 @@ static Writer& OutHTML_FrameFormatGrfNode( Writer& rWrt, const SwFrameFormat& rF
OutHTML_Image( rWrt, rFrameFormat, aGraphicURL, aGraphic, pGrfNd->GetTitle(),
pGrfNd->GetTwipSize(), nFrameFlags, "graphic", nullptr, aMimeType );
- if (rHTMLWrt.mbReqIF)
+ if (rHTMLWrt.mbReqIF && rHTMLWrt.m_bExportImagesAsOLE)
rWrt.Strm().WriteOString(OString("</" + rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_object ">"));
return rWrt;
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index 81456897d47f..63857cf65c73 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -196,12 +196,16 @@ void SwHTMLWriter::SetupFilterOptions(SfxMedium& rMedium)
comphelper::SequenceAsHashMap aStoreMap(rMedium.GetArgs());
auto it = aStoreMap.find("RTFOLEMimeType");
- if (it == aStoreMap.end())
+ if (it != aStoreMap.end())
{
- return;
+ it->second >>= m_aRTFOLEMimeType;
}
- it->second >>= m_aRTFOLEMimeType;
+ it = aStoreMap.find("ExportImagesAsOLE");
+ if (it != aStoreMap.end())
+ {
+ it->second >>= m_bExportImagesAsOLE;
+ }
}
void SwHTMLWriter::SetupFilterOptions(const OUString& rFilterOptions)
diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx
index 38ccf0cf8c46..3e23616f6b21 100644
--- a/sw/source/filter/html/wrthtml.hxx
+++ b/sw/source/filter/html/wrthtml.hxx
@@ -408,6 +408,9 @@ public:
OUString m_aRTFOLEMimeType;
+ /// ReqIF mode: export images as OLE objects.
+ bool m_bExportImagesAsOLE = false;
+
/// Construct an instance of SwHTMLWriter and optionally give it
/// the filter options directly, which can also be set via SetupFilterOptions().
explicit SwHTMLWriter( const OUString& rBaseURL, const OUString& rFilterOptions = "" );