summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2022-05-23 16:24:00 +0200
committerAndras Timar <andras.timar@collabora.com>2022-10-16 16:18:33 +0200
commit874a6f008fe32be8ef25a96ae404d62925364ade (patch)
treecdf66bd4f78b5a44b463318d7e13a11deb7c164c /sw
parented14c4548809006c1ec02661c2066c0361290bf6 (diff)
sw HTML import: extend list of MIME types recognized as image objects
The HTML import sometimes imports <object> elements as embedded objects and sometimes as Writer images. This MIME-type based approach works great to differentiate plain images (with PNG fallback) from real embedded objects, but analysis on some larger document corpus pointed out a few missing entries in this allow-list. Fix the problem by adding a 2nd variant for BMP, TIFF and WMF, which should also count as image, not object. This could be improved further in a later commit by getting a full list of image MIME types we support from VCL. Change-Id: Idb2485012e44b4c7db396b5062e7173f3c85495e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134826 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/html/htmlplug.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx
index 76e07d63073d..46b1b8952b45 100644
--- a/sw/source/filter/html/htmlplug.cxx
+++ b/sw/source/filter/html/htmlplug.cxx
@@ -444,6 +444,9 @@ bool SwHTMLParser::InsertEmbed()
u"image/svg+xml",
u"image/tiff",
u"image/x-emf",
+ u"image/bmp",
+ u"image/tif",
+ u"image/wmf",
};
if (vAllowlist.find(aType) != vAllowlist.end() && m_aEmbeds.empty())