diff options
author | Eike Rathke <erack@redhat.com> | 2020-11-01 18:09:45 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2020-11-01 20:39:28 +0100 |
commit | 14f9dac4fbaeb0e13ad4875f77960c4019d8f229 (patch) | |
tree | 43cfde7772fd21641562b2c195a5cbcbdec1a226 | |
parent | c99e66cb5c75efb933694bfbb8edd7117c3d655f (diff) |
Resolves: tdf#135108 Allow link updates if loaded document so far had none
It is the current user who'll add external references, not the
creator of the loaded document.
Change-Id: I59a6d0b8600a9b299aa54a1efeedfccc16ad69d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105152
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
-rw-r--r-- | sc/source/ui/docshell/docsh4.cxx | 7 | ||||
-rw-r--r-- | sc/source/ui/inc/docsh.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsh4.cxx | 9 |
3 files changed, 16 insertions, 1 deletions
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index c2d1c5047794..737268f9b8e7 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -111,10 +111,15 @@ using namespace ::com::sun::star; #include <svx/xdef.hxx> -void ScDocShell::ReloadAllLinks() +void ScDocShell::AllowLinkUpdate() { m_aDocument.SetLinkFormulaNeedingCheck(false); getEmbeddedObjectContainer().setUserAllowsLinkUpdate(true); +} + +void ScDocShell::ReloadAllLinks() +{ + AllowLinkUpdate(); ReloadTabLinks(); weld::Window *pDialogParent = GetActiveDialogParent(); diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index 706d47cc6996..bfdaf85af4b3 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -294,6 +294,7 @@ public: virtual void ReconnectDdeLink(SfxObjectShell& rServer) override; void UpdateLinks() override; + void AllowLinkUpdate(); void ReloadAllLinks(); void ReloadTabLinks(); ScLkUpdMode GetLinkUpdateModeState() const; diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index c173ca5e69bf..68a76c329007 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -1583,6 +1583,15 @@ void ScTabViewShell::Construct( TriState nForceDesignMode ) SfxCallMode::ASYNCHRON | SfxCallMode::RECORD ); } } + else + { + // No links yet, but loading an existing document may have + // disabled link update but there's no "Allow updating" infobar + // that could enable it again. So in order to enable the user + // to add formulas with external references allow link updates + // again. + pDocSh->AllowLinkUpdate(); + } bool bReImport = false; // update imported data ScDBCollection* pDBColl = rDoc.GetDBCollection(); |