diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/postit.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx index 1bb1f89e506d..9568148077d0 100644 --- a/sc/source/core/data/postit.cxx +++ b/sc/source/core/data/postit.cxx @@ -1103,9 +1103,11 @@ void ScPostIt::RemoveCaption() } } // Either the caption object is gone or, because of Undo or clipboard is - // held in at least two instances, or the Undo document is just destroyed + // held in at least two instances, or only one instance in Undo because the + // original sheet was deleted, or the Undo document is just destroyed // which leaves us with one reference. - assert(!maNoteData.mxCaption || maNoteData.mxCaption.getRefs() >= 2 || (mrDoc.IsUndo() && mrDoc.IsInDtorClear())); + // Let's detect other use cases.. + assert(!maNoteData.mxCaption || maNoteData.mxCaption.getRefs() >= 2 || !mrDoc.IsUndo() || mrDoc.IsInDtorClear()); maNoteData.mxCaption.reset(nullptr); } |