[Libreoffice-commits] core.git: 2 commits - sw/source xmloff/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Feb 4 09:25:19 UTC 2019


 sw/source/core/graphic/ndgrf.cxx |    3 ++-
 xmloff/source/text/txtparae.cxx  |    8 +++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 36aa3f4d6f9e9da7289ed760cfb1e87600cb6459
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sun Feb 3 22:30:05 2019 +0100
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Mon Feb 4 10:25:04 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>

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);
+            }
         }
     }
 
commit 6a36bedd0a418ce12543f797ab46f24ee57feb6c
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sun Feb 3 21:16:40 2019 +0100
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Mon Feb 4 10:24:58 2019 +0100

    tdf#119661 remove the original URL when removing a graphic link
    
    Change-Id: I8c875202ba8af9cbcd7eb9ce0db78f97d56a07a8
    Reviewed-on: https://gerrit.libreoffice.org/67337
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index e439cef7fb11..867e533533e3 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -593,7 +593,7 @@ void SwGrfNode::ReleaseLink()
 {
     if( refLink.is() )
     {
-        const Graphic aLocalGraphic(maGrfObj.GetGraphic());
+        Graphic aLocalGraphic(maGrfObj.GetGraphic());
         const bool bHasOriginalData(aLocalGraphic.IsGfxLink());
 
         {
@@ -605,6 +605,7 @@ void SwGrfNode::ReleaseLink()
 
         getIDocumentLinksAdministration().GetLinkManager().Remove( refLink.get() );
         refLink.clear();
+        aLocalGraphic.setOriginURL("");
 
         // #i15508# added extra processing after getting rid of the link. Use whatever is
         // known from the formerly linked graphic to get to a state as close to a directly


More information about the Libreoffice-commits mailing list