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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Feb 5 09:36:09 UTC 2019


 xmloff/source/text/txtparae.cxx |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 2d4608ac3b958aaaff032725ded152a13b3bac7d
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sun Feb 3 22:30:05 2019 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Tue Feb 5 10:35:48 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.
    
    Change-Id: I2782ec53cf8dc78b0c360365d3eed3e5c54bf271
    Reviewed-on: https://gerrit.libreoffice.org/67338
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
    (cherry picked from commit 36aa3f4d6f9e9da7289ed760cfb1e87600cb6459)
    Reviewed-on: https://gerrit.libreoffice.org/67346
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

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


More information about the Libreoffice-commits mailing list