[Libreoffice-commits] core.git: Branch 'libreoffice-6-4-4' - svx/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed May 13 10:13:35 UTC 2020


 svx/source/svdraw/svdograf.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 89229809508f863999881088a23cae404f94c974
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon May 11 17:02:50 2020 +0100
Commit:     Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
CommitDate: Wed May 13 12:13:04 2020 +0200

    use the LinkManager persist to determine the Referer
    
    Change-Id: I4e93878972492a93af368ffa0560412132431a24
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93994
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    Tested-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>

diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 7e14a6d3bdd9..53b3e00a35fc 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -19,8 +19,10 @@
 
 #include <unotools/streamwrap.hxx>
 
+#include <sfx2/docfile.hxx>
 #include <sfx2/lnkbase.hxx>
 #include <math.h>
+#include <sfx2/objsh.hxx>
 #include <tools/helpers.hxx>
 #include <sot/exchange.hxx>
 #include <sot/formats.hxx>
@@ -109,8 +111,13 @@ SdrGraphicLink::SdrGraphicLink(SdrGrafObj& rObj)
     {
         sfx2::LinkManager::GetDisplayNames( this, nullptr, &rGrafObj.aFileName, nullptr, &rGrafObj.aFilterName );
 
+        OUString sReferer(getReferer());
+        SfxObjectShell * sh = pLinkManager->GetPersist();
+        if (sh != nullptr && sh->HasName())
+            sReferer = sh->GetMedium()->GetName();
+
         Graphic aGraphic;
-        if (sfx2::LinkManager::GetGraphicFromAny(rMimeType, rValue, getReferer(), aGraphic, nullptr))
+        if (sfx2::LinkManager::GetGraphicFromAny(rMimeType, rValue, sReferer, aGraphic, nullptr))
         {
             rGrafObj.ImpSetLinkedGraphic(aGraphic);
         }


More information about the Libreoffice-commits mailing list