diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2018-01-04 00:06:58 -0500 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-01-05 12:08:15 +0100 |
commit | 07d7a3bb24a4c1f4d6289cd8d3a90852f69f9f71 (patch) | |
tree | bab13d3958d4cd6946ce331b208bb7687b5a2764 /sc | |
parent | 8069d8bf63c7dcee4d7724ca943c6dd5739a94f4 (diff) |
lok: send modified status when applying cell-formula before saving
Without this, the modified status resulting from applying
the cell-formula immediately before saving is lost, since
it is clobbered after the save.
Change-Id: Ie402812d0fc0528020161fffe57e8220c5abfeb5
Reviewed-on: https://gerrit.libreoffice.org/47368
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit 530f163eee03fffe60f2c2a6413441693f682496)
Reviewed-on: https://gerrit.libreoffice.org/47396
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/inc/inputhdl.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsha.cxx | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/sc/source/ui/inc/inputhdl.hxx b/sc/source/ui/inc/inputhdl.hxx index 68dc71930cac..4326928e035b 100644 --- a/sc/source/ui/inc/inputhdl.hxx +++ b/sc/source/ui/inc/inputhdl.hxx @@ -224,6 +224,7 @@ public: bool TakesReturn() const { return ( nTipVisible != 0 ); } + bool GetModified() const { return bModified; } void SetModified() { bModified = true; } bool GetSelIsRef() const { return bSelIsRef; } diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index a5672100d1b4..5946a6054b8f 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -56,6 +56,9 @@ #include "markdata.hxx" #include "cellvalue.hxx" #include "tokenarray.hxx" +#include <LibreOfficeKit/LibreOfficeKitEnums.h> +#include <comphelper/lok.hxx> +#include <sfx2/lokhelper.hxx> #include <com/sun/star/table/BorderLineStyle.hpp> @@ -723,7 +726,22 @@ void ScTabViewShell::ExecuteSave( SfxRequest& rReq ) // Finish entering unless 'DontTerminateEdit' is specified, even if a formula is being processed if (bCommitChanges) + { + if (comphelper::LibreOfficeKit::isActive()) + { + // Normally this isn't needed, but in Calc when editing a cell formula + // and manually saving (without changing cells or hitting enter), while + // InputEnterHandler will mark the doc as modified (when it is), because + // we will save the doc immediately afterwards, the modified state event + // is clobbered. To avoid that, we notify all views immediately of the + // modified state, apply the modification, then save the document. + ScInputHandler* pHdl = SC_MOD()->GetInputHdl(); + if (pHdl != nullptr && pHdl->GetModified()) + SfxLokHelper::notifyAllViews(LOK_CALLBACK_STATE_CHANGED, ".uno:ModifiedStatus=true"); + } + SC_MOD()->InputEnterHandler(); + } if ( GetViewData().GetDocShell()->IsDocShared() ) { |