[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - xmloff/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Feb 6 11:52:28 UTC 2019


 xmloff/source/core/xmlexp.cxx |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 6d7fc1be411a19e0860ce515e00b4728e51da11d
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sun Feb 3 22:30:05 2019 +0100
Commit:     Xisco Faulí <xiscofauli at libreoffice.org>
CommitDate: Wed Feb 6 12:52:08 2019 +0100

    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 at 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 at libreoffice.org>

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);
+            }
         }
     }
 


More information about the Libreoffice-commits mailing list