svx/source/svdraw/svdograf.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
New commits: commit 3ee652e1c18186a5de47797aa4b02defcb29c210 Author: Caolán McNamara <[email protected]> AuthorDate: Mon May 11 17:02:50 2020 +0100 Commit: Stephan Bergmann <[email protected]> CommitDate: Tue May 12 21:25:15 2020 +0200 use the LinkManager persist to determine the Referer Change-Id: I4e93878972492a93af368ffa0560412132431a24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94061 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <[email protected]> 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); } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
