summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2020-11-01 18:09:45 +0100
committerMichael Stahl <michael.stahl@cib.de>2020-11-03 10:39:17 +0100
commit486034a22860e8db1ef5ea4ee258d3fe0395886d (patch)
treea88a69c48bb13139a69776175e6a6478373a200d /sc
parent6e83d327d69fa94b54ad3f2393fbab96d9dd6cd0 (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 (cherry picked from commit 14f9dac4fbaeb0e13ad4875f77960c4019d8f229) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105055 Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/docshell/docsh4.cxx7
-rw-r--r--sc/source/ui/inc/docsh.hxx1
-rw-r--r--sc/source/ui/view/tabvwsh4.cxx9
3 files changed, 16 insertions, 1 deletions
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 3aa1426eb9e7..59caa054701b 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -110,10 +110,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 e23067503bae..dc77bdcbb25b 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 e57caf3c2c33..c3fa4e1fe39f 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1579,6 +1579,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();