sw/source/core/frmedt/feflyole.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
New commits: commit b221b09739616a3776800b9784f82ec6b747a0dc Author: Serge Krot <[email protected]> AuthorDate: Wed Feb 26 08:41:32 2020 +0100 Commit: Thorsten Behrens <[email protected]> CommitDate: Tue Mar 3 00:51:26 2020 +0100 tdf#130945 Writer: Preview of linked doc is not updated when edited Change-Id: Id8ee653cc9cb5dbcb3ad0a31688a0b5e34d99fff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89499 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <[email protected]> (cherry picked from commit 53735aeb937d7f2c1ac5bc0227e4a2fdc24e4947) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89793 diff --git a/sw/source/core/frmedt/feflyole.cxx b/sw/source/core/frmedt/feflyole.cxx index 0bb75aa65845..aff51cb586b0 100644 --- a/sw/source/core/frmedt/feflyole.cxx +++ b/sw/source/core/frmedt/feflyole.cxx @@ -37,6 +37,9 @@ #include <notxtfrm.hxx> #include <ndole.hxx> #include <swcli.hxx> +#include <docsh.hxx> +#include <IDocumentLinksAdministration.hxx> +#include <sfx2/linkmgr.hxx> using namespace com::sun::star; @@ -111,8 +114,21 @@ bool SwFEShell::FinishOLEObj() // Server is terminated IsCheckForOLEInCaption() ) SetCheckForOLEInCaption( !IsCheckForOLEInCaption() ); + // enable update of the link preview + comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = GetDoc()->GetDocShell()->getEmbeddedObjectContainer(); + const bool aUserAllowsLinkUpdate = rEmbeddedObjectContainer.getUserAllowsLinkUpdate(); + rEmbeddedObjectContainer.setUserAllowsLinkUpdate(true); + // leave UIActive state pIPClient->DeactivateObject(); + + // if we have more than one link let's update them too + sfx2::LinkManager& rLinkManager = GetDoc()->getIDocumentLinksAdministration().GetLinkManager(); + if (rLinkManager.GetLinks().size() > 1) + rLinkManager.UpdateAllLinks(false, false, nullptr); + + // return back original value of the "update of the link preview" flag + rEmbeddedObjectContainer.setUserAllowsLinkUpdate(aUserAllowsLinkUpdate); } return bRet; } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
