summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/cellsh3.cxx
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2019-07-16 11:58:11 +0200
committerAndras Timar <andras.timar@collabora.com>2019-07-16 12:25:25 +0200
commitcfb54020eed2122fc8e5c926bad40e399036feaf (patch)
treeb0bdcfaed5db8ff915be5366b0471eb81ee23d49 /sc/source/ui/view/cellsh3.cxx
parent5c70f4dd398509956e1b07c647fe92ac944b2ef6 (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/75710 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sc/source/ui/view/cellsh3.cxx')
-rw-r--r--sc/source/ui/view/cellsh3.cxx16
1 files changed, 10 insertions, 6 deletions
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 2fc6cc37a9f8..bdf1a3325d07 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -168,13 +168,17 @@ void ScCellShell::Execute( SfxRequest& rReq )
{
if ( pReqArgs )
{
- if (comphelper::LibreOfficeKit::isActive())
+ // 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
+ // NOTE: This also means we want to set the modified state
+ // regardless of the DontCommit parameter's value.
+ if (comphelper::LibreOfficeKit::isActive() && !GetViewData()->GetDocShell()->IsModified())
{
- // Let the client know about our entry, so if they save
- // (say because the user closes the document or window,)
- // this change gets persisted (assuming DontTerminateEdit
- // is set to false in the .uno:Save command).
- SfxLokHelper::notifyAllViews(LOK_CALLBACK_STATE_CHANGED, ".uno:ModifiedStatus=true");
+ GetViewData()->GetDocShell()->SetModified();
+ rBindings.Invalidate(SID_SAVEDOC);
+ rBindings.Invalidate(SID_DOC_MODIFIED);
}
OUString aStr( static_cast<const SfxStringItem&>(pReqArgs->