diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2019-02-03 22:30:05 +0100 |
---|---|---|
committer | Xisco Faulí <xiscofauli@libreoffice.org> | 2019-02-06 12:52:08 +0100 |
commit | 6d7fc1be411a19e0860ce515e00b4728e51da11d (patch) | |
tree | e5daa66172b3ca6da4ee47e8db8cf31c03551094 /xmloff | |
parent | aa7b71cd17898cd47f4bd7f12cfe5036cd40cb57 (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.
Reviewed-on: https://gerrit.libreoffice.org/67338
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit 36aa3f4d6f9e9da7289ed760cfb1e87600cb6459)
Change-Id: I2782ec53cf8dc78b0c360365d3eed3e5c54bf271
Reviewed-on: https://gerrit.libreoffice.org/67350
Tested-by: Jenkins
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/xmlexp.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 835b9ea18f80..f941109516df 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -1910,8 +1910,12 @@ bool SvXMLExport::AddEmbeddedXGraphicAsBase64(uno::Reference<graphic::XGraphic> Reference<XInputStream> xInputStream(mxGraphicStorageHandler->createInputStream(rxGraphic)); if (xInputStream.is()) { - XMLBase64Export aBase64Exp(*this); - return aBase64Exp.exportOfficeBinaryDataElement(xInputStream); + Graphic aGraphic(rxGraphic); + if (aGraphic.getOriginURL().isEmpty()) // don't add the base64 if the origin URL is set (image is from an external URL) + { + XMLBase64Export aBase64Exp(*this); + return aBase64Exp.exportOfficeBinaryDataElement(xInputStream); + } } } |