summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-03-14 19:57:04 +0100
committerEike Rathke <erack@redhat.com>2017-03-14 19:59:02 +0100
commit409a7799ba06f3c6b9965f2f35169283a948bc30 (patch)
tree14cbaf94574dcc207957786198b0b96fa0aa870d /sc
parentb481928a2104bb659021bd0795c73fcf64129c99 (diff)
no assert for one reference while destroying the Undo document
Change-Id: Idf9e0b2600d503ff50cd6269e8d528c0fad12a3e
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/postit.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 3addea4c948d..2c9646682a52 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -1106,8 +1106,9 @@ void ScPostIt::RemoveCaption()
}
}
// Either the caption object is gone or, because of Undo or clipboard is
- // held in at least two instances.
- assert(!maNoteData.mxCaption || maNoteData.mxCaption.getRefs() >= 2);
+ // held in at least two instances, or the Undo document is just destroyed
+ // which leaves us with one reference.
+ assert(!maNoteData.mxCaption || maNoteData.mxCaption.getRefs() >= 2 || (mrDoc.IsUndo() && mrDoc.IsInDtorClear()));
maNoteData.mxCaption.reset(nullptr);
}