sw/source/core/frmedt/feflyole.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
New commits: commit 53735aeb937d7f2c1ac5bc0227e4a2fdc24e4947 Author: Serge Krot <serge.k...@cib.de> AuthorDate: Wed Feb 26 08:41:32 2020 +0100 Commit: Thorsten Behrens <thorsten.behr...@cib.de> CommitDate: Mon Mar 2 01:39:11 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 <thorsten.behr...@cib.de> diff --git a/sw/source/core/frmedt/feflyole.cxx b/sw/source/core/frmedt/feflyole.cxx index 33ec9cc9a3b1..b34fb3f77195 100644 --- a/sw/source/core/frmedt/feflyole.cxx +++ b/sw/source/core/frmedt/feflyole.cxx @@ -28,6 +28,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; @@ -102,8 +105,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 libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits