diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2019-02-03 22:30:05 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-02-05 10:35:48 +0100 |
commit | 2d4608ac3b958aaaff032725ded152a13b3bac7d (patch) | |
tree | 0921b847dbb2fe53741d1987f5bd6798575e4bd9 /xmloff | |
parent | 380fd85348084e3b35531bc6b50f6e2629b49bcc (diff) |
tdf#118879 don't embed base64 image data if we have an origin URL
If an Graphic has an OriginURL it means it was created from an
external source. We want to preserve this so we don't want to add
the image base64 data - used in Flat ODF format.
Change-Id: I2782ec53cf8dc78b0c360365d3eed3e5c54bf271
Reviewed-on: https://gerrit.libreoffice.org/67338
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit 36aa3f4d6f9e9da7289ed760cfb1e87600cb6459)
Reviewed-on: https://gerrit.libreoffice.org/67346
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 3d27ac07ffeb..c9d84b5885d0 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -120,6 +120,7 @@ #include <algorithm> #include <iterator> #include <officecfg/Office/Common.hxx> +#include <vcl/graph.hxx> using namespace ::std; using namespace ::com::sun::star; @@ -3178,7 +3179,12 @@ void XMLTextParagraphExport::_exportTextGraphic( if (xGraphic.is()) { SvXMLElementExport aElement(GetExport(), XML_NAMESPACE_DRAW, XML_IMAGE, false, true ); - GetExport().AddEmbeddedXGraphicAsBase64(xGraphic); + + Graphic aGraphic(xGraphic); + if (aGraphic.getOriginURL().isEmpty()) // don't add the base64 if the origin URL is set (image is from an external URL) + { + GetExport().AddEmbeddedXGraphicAsBase64(xGraphic); + } } } |