summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2017-05-17 15:08:25 +0200
committerAron Budea <aron.budea@collabora.com>2017-05-17 15:12:21 +0200
commited1123a9284b2230d26ed114c87df9f4d28eea07 (patch)
tree8935eb308979068c52f2616edf00ff9b8c698e0f /sc
parentaadbf483583acab13f043ac36af035be570a0b20 (diff)
sc lok: Don't crash on comment undo.
Change-Id: I3b8686e2d52359de2d99413e63d4a424ba1439d1 Reviewed-on: https://gerrit.libreoffice.org/37709 Reviewed-by: Aron Budea <aron.budea@collabora.com> Tested-by: Aron Budea <aron.budea@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/docshell/docsh4.cxx2
-rw-r--r--sc/source/ui/undo/undocell.cxx2
2 files changed, 3 insertions, 1 deletions
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index ef4b9ef4a9c6..0bc4581359c7 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -2254,8 +2254,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 44a56627b214..2cc72dd025ae 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;
}
}