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

Jan Holesovsky kendy at collabora.com
Wed May 17 17:48:28 UTC 2017


 sc/source/ui/docshell/docsh4.cxx |    2 ++
 sc/source/ui/undo/undocell.cxx   |    2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit dd4adcd54bdff0b114560589872216a450fa6def
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed May 17 15:08:25 2017 +0200

    sc lok: Don't crash on comment undo.
    
    Change-Id: I3b8686e2d52359de2d99413e63d4a424ba1439d1
    Reviewed-on: https://gerrit.libreoffice.org/37710
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index a4bc25827e4e..1cd085e0b3aa 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -2237,8 +2237,10 @@ void ScDocShell::LOKCommentNotify(LOKCommentNotificationType nType, const ScDocu
                                (nType == LOKCommentNotificationType::Remove ? "Remove" :
                                 (nType == LOKCommentNotificationType::Modify ? "Modify" : "???"))));
 
+    assert(pNote);
     aAnnotation.put("id", pNote->GetId());
     aAnnotation.put("tab", rPos.Tab());
+
     if (nType != LOKCommentNotificationType::Remove && pNote)
     {
         aAnnotation.put("author", pNote->GetAuthor());
diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx
index 0abd6920867c..0050bb6eeae3 100644
--- a/sc/source/ui/undo/undocell.cxx
+++ b/sc/source/ui/undo/undocell.cxx
@@ -805,7 +805,7 @@ void ScUndoReplaceNote::DoRemoveNote( const ScNoteData& rNoteData )
                 caption object from the drawing layer while deleting pNote
                 (removing the caption is done by a drawing undo action). */
             pNote->ForgetCaption();
-            ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Remove, &rDoc, maPos, nullptr);
+            ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Remove, &rDoc, maPos, pNote);
             delete pNote;
         }
     }


More information about the Libreoffice-commits mailing list