diff options
author | Serge Krot <Serge.Krot@cib.de> | 2020-02-26 08:41:32 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2020-03-02 01:39:11 +0100 |
commit | 53735aeb937d7f2c1ac5bc0227e4a2fdc24e4947 (patch) | |
tree | 449ef34ef5256f119259671827fb62f3f7f881eb /sw/source | |
parent | 8461127750e1fe92a615409505256132e54fb8e8 (diff) |
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.Behrens@CIB.de>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/frmedt/feflyole.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
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; } |