svx/source/svdraw/svdograf.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
New commits: commit a8d25394a02def4bf1b8d1ad022ea9da25d92935 Author: Caolán McNamara <[email protected]> AuthorDate: Mon May 11 17:02:50 2020 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Tue May 12 16:08:55 2020 +0200 use the LinkManager persist to determine the Referer Change-Id: I4e93878972492a93af368ffa0560412132431a24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93984 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 5c216bd2835d..b0a13593845c 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -19,7 +19,9 @@ #include <unotools/streamwrap.hxx> +#include <sfx2/docfile.hxx> #include <sfx2/lnkbase.hxx> +#include <sfx2/objsh.hxx> #include <rtl/ustrbuf.hxx> #include <tools/helpers.hxx> #include <tools/stream.hxx> @@ -90,8 +92,13 @@ SdrGraphicLink::SdrGraphicLink(SdrGrafObj& rObj) { sfx2::LinkManager::GetDisplayNames( this, nullptr, &rGrafObj.aFileName, nullptr, &rGrafObj.aFilterName ); + OUString sReferer(rGrafObj.aReferer); + SfxObjectShell * sh = pLinkManager->GetPersist(); + if (sh != nullptr && sh->HasName()) + sReferer = sh->GetMedium()->GetName(); + Graphic aGraphic; - if (sfx2::LinkManager::GetGraphicFromAny(rMimeType, rValue, rGrafObj.aReferer, 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
