diff options
author | Jan Holesovsky <kendy@collabora.com> | 2019-07-16 11:58:11 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2020-06-04 19:56:14 +0200 |
commit | aed7f71d67762e6b9a8b0f65ec9d0fdd5fd42fbd (patch) | |
tree | f5aca588c23d1f16c7b54de3fb39f4049c9d21a5 /sc/source/ui/app | |
parent | 2519377c55626dfa3191aaad266b751d29fe4917 (diff) |
LOK: Emit the doc. modified state even when changing the cell inline.
The "LOK: emit modified status on entering cell data" patch did this
only for the formula input line, and did not change the state when the
user just clicked on the cell and started modifying it; so this patch
extends it.
Also change the actual DocumentModified state of the document directly
instead of just sending a flag, so that the state in LOOLWSD and in the
core don't get out of sync.
Change-Id: Ie516ce5a74d94247d79cf993517d7f4a6657cc94
Reviewed-on: https://gerrit.libreoffice.org/75701
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95516
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sc/source/ui/app')
-rw-r--r-- | sc/source/ui/app/inputhdl.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 9fa0b7da23a4..d06e374d0366 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -2756,6 +2756,9 @@ void ScInputHandler::InvalidateAttribs() rBindings.Invalidate( SID_SET_SUB_SCRIPT ); rBindings.Invalidate( SID_ATTR_CHAR_STRIKEOUT ); rBindings.Invalidate( SID_ATTR_CHAR_SHADOWED ); + + rBindings.Invalidate( SID_SAVEDOC ); + rBindings.Invalidate( SID_DOC_MODIFIED ); } } @@ -3779,6 +3782,14 @@ bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, bool bStartEdit /* = false // #i114511# don't count cursor keys as modification bool bSetModified = !bCursorKey; DataChanged(false, bSetModified); // also calls UpdateParenthesis() + + // In the LOK case, we want to set the document modified state + // right away at the start of the edit, so that the content is + // saved even when the user leaves the document before hitting + // Enter + if (comphelper::LibreOfficeKit::isActive() && bSetModified && pActiveViewSh && !pActiveViewSh->GetViewData().GetDocShell()->IsModified()) + pActiveViewSh->GetViewData().GetDocShell()->SetModified(); + InvalidateAttribs(); //! in DataChanged? } } |