summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-05-11 17:02:50 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-06-03 00:43:01 +0200
commit665258448af655f4b9da434ec29d380597b901e6 (patch)
treefd63463e049514a066639cc69fd3560e47704c31
parentddd7a2f43634bb3e2b2a1978bcf09d8f3fd27bab (diff)
use the LinkManager persist to determine the Referer
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94061 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit 3ee652e1c18186a5de47797aa4b02defcb29c210) Conflicts: svx/source/svdraw/svdograf.cxx Change-Id: I4e93878972492a93af368ffa0560412132431a24
-rw-r--r--svx/source/svdraw/svdograf.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 6b0b2bc7b44e..0b1f788cd8bf 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/formats.hxx>
#include <sot/storage.hxx>
@@ -228,8 +230,13 @@ void SdrGraphicLink::RemoveGraphicUpdater()
{
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))
+ if (sfx2::LinkManager::GetGraphicFromAny(rMimeType, rValue, sReferer, aGraphic))
{
rGrafObj.ImpSetLinkedGraphic(aGraphic);
}