summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2019-08-22 09:15:15 -0400
committerAndras Timar <andras.timar@collabora.com>2019-08-29 11:32:07 +0200
commit629a0173ea46bc9b8115e47a5138b19d07cdf52e (patch)
tree66dd62d58e5f236264f200a941e679df3704e4e9 /sc
parentbcd9acfedc6f303398df125830739154ddf1c664 (diff)
sc: LOK: commit cell edits before saveas cd-6.0-29-20190828
Users typically don't recognize that changes done to a cell need to be committed (typically by hitting RETURN) before they are saved to file. This is especially true on the web. This patch commits any in-flight changes before SaveAs. This is currently done only for LOK and unconditionally at that. This can be controlled via a flag, if there is such a use-case. Change-Id: I2a88b2f1df47be764058f4505561b22830d9d67a Reviewed-on: https://gerrit.libreoffice.org/78012 Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com> (cherry picked from commit cc7eb4d345e3fede698a3f255c1938d275305c14) Reviewed-on: https://gerrit.libreoffice.org/78149 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/docshell/docsh.cxx6
-rw-r--r--sc/source/ui/inc/docsh.hxx2
2 files changed, 8 insertions, 0 deletions
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index a2c6a5a69eb3..39f4770ef8c8 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -1766,6 +1766,12 @@ void popFileName(OUString& rPath)
}
+void ScDocShell::TerminateEditing()
+{
+ // Commit any cell changes before saving.
+ SC_MOD()->InputEnterHandler();
+}
+
bool ScDocShell::SaveAs( SfxMedium& rMedium )
{
OUString aCurPath; // empty for new document that hasn't been saved.
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index 90c5292c828b..349dc278c3b3 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -210,6 +210,8 @@ public:
virtual void SetVisArea( const tools::Rectangle & rVisArea ) override;
+ virtual void TerminateEditing() override;
+
using SfxObjectShell::GetVisArea;
virtual tools::Rectangle GetVisArea( sal_uInt16 nAspect ) const override;