[Libreoffice-commits] core.git: sc/source

Ashod Nakashian (via logerrit) logerrit at kemper.freedesktop.org
Mon Dec 16 16:09:40 UTC 2019


 sc/source/ui/view/cellsh3.cxx |   12 ++++++++++++
 1 file changed, 12 insertions(+)

New commits:
commit d396819ce8c8561afcf69c7e0dbfb6108439b4c3
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Fri Jul 12 11:58:11 2019 -0400
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Mon Dec 16 17:08:46 2019 +0100

    LOK: emit modified status on entering cell data
    
    Entering data into a cell without committing will
    normally not set the modified flag. However clients
    might want to know whether there is in-flight changes
    when they need to save the document.
    
    A possible scenario is that the user enters some
    cell data and then closes the window. Both WSD and
    the client app would here rely on the modified
    notification to decide whether to save the document
    or not.
    
    We do not change the document modified state, since
    that may be incorrect (in case the user actually
    cancel the cell entry), so we preserve that so future
    updates to the modified status would reflect the
    correct state of the file. Instead, we emit a
    client notification that the document has
    been modified, to signal them that saving
    is sensible.
    
    Note that ideally we would undo this when the user
    cancels the cell edit, but that would be complicated
    due to multi-editor scenarios. For example, another
    user might actually edit the document while we
    cancel our cell edit, and in this case we should not
    reset the modify flag. Since this is unreliable,
    we leave the flag set, unless the Core emits
    an update, which will surely be accurate.
    
    Reviewed-on: https://gerrit.libreoffice.org/75513
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    (cherry picked from commit 38b899312245758381fa72ad17c2d4c281edb1ba)
    Reviewed-on: https://gerrit.libreoffice.org/78451
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>
    
    Change-Id: Id26aa6f8ce2c0a08f8bee6812fcf99275dc24551
    Reviewed-on: https://gerrit.libreoffice.org/82093
    Tested-by: Jenkins
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 8bb9f2bfdcfc..3d903ea83a12 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -44,6 +44,9 @@
 #include <scabstdlg.hxx>
 #include <columnspanset.hxx>
 #include <comphelper/lok.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+#include <comphelper/lok.hxx>
+#include <sfx2/lokhelper.hxx>
 
 #include <memory>
 
@@ -165,6 +168,15 @@ void ScCellShell::Execute( SfxRequest& rReq )
             {
                 if ( pReqArgs )
                 {
+                    if (comphelper::LibreOfficeKit::isActive())
+                    {
+                        // 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");
+                    }
+
                     OUString aStr( static_cast<const SfxStringItem&>(pReqArgs->
                                     Get( SID_ENTER_STRING )).GetValue() );
                     const SfxPoolItem* pDontCommitItem;


More information about the Libreoffice-commits mailing list