summaryrefslogtreecommitdiff
path: root/xmloff/source/text/txtparae.cxx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2019-02-03 22:30:05 +0100
committerTomaž Vajngerl <quikee@gmail.com>2019-02-04 10:25:04 +0100
commit36aa3f4d6f9e9da7289ed760cfb1e87600cb6459 (patch)
tree030fdc07bcf748a33a4a60586616933bf20632ca /xmloff/source/text/txtparae.cxx
parent6a36bedd0a418ce12543f797ab46f24ee57feb6c (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>
Diffstat (limited to 'xmloff/source/text/txtparae.cxx')
-rw-r--r--xmloff/source/text/txtparae.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 9a7776eec9e3..3b3b52b5f635 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;
@@ -3181,7 +3182,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);
+ }
}
}