summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-04-13 00:34:34 +0200
committerJan Holesovsky <kendy@collabora.com>2017-05-15 21:59:12 +0200
commit23d06332abb81f4eef2a5dcc63fab1ce9d42aaaa (patch)
treefc188869c14f634a0f4fc125baafe7cfe4313b13 /sc/source
parent5ef67aa7c9a4f370b091fdf4b280596d5668553a (diff)
turn assert into SAL_INFO
The old assert conditions don't hold anymore since removeFromDrawPageAndFree() only deletes the SdrCaptionObj on the last refcount, but info can be useful. Change-Id: I456149b8799a0509dcd7a2da09d627fb0de1a912
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/postit.cxx18
1 files changed, 7 insertions, 11 deletions
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 310bddfa606f..2ac98a57cc0b 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -1138,20 +1138,16 @@ void ScPostIt::RemoveCaption()
if (pDrawLayer == maNoteData.mxCaption->GetModel())
maNoteData.mxCaption.removeFromDrawPageAndFree();
-#if 0
- // Either the caption object is gone or, because of Undo or clipboard is
- // held in at least two instances, or only one instance in Undo because the
- // original sheet in this document is just deleted, or the Undo document is
- // just destroyed which leaves us with one reference.
- // Let's detect other use cases..
- assert(!maNoteData.mxCaption || maNoteData.mxCaption.getRefs() >= 2 ||
- (!mrDoc.IsUndo() && !mrDoc.IsClipboard()) || (mrDoc.IsUndo() && mrDoc.IsInDtorClear()));
-#endif
+ SAL_INFO("sc.core","ScPostIt::RemoveCaption - refs: " << maNoteData.mxCaption.getRefs() <<
+ " IsUndo: " << mrDoc.IsUndo() << " IsClip: " << mrDoc.IsClipboard() <<
+ " Dtor: " << mrDoc.IsInDtorClear());
- // Forget the caption object if removeFromDrawPageAndFree() above did not
- // free it.
+ // Forget the caption object if removeFromDrawPageAndFree() did not free it.
if (maNoteData.mxCaption)
+ {
+ SAL_INFO("sc.core","ScPostIt::RemoveCaption - forgetting one ref");
maNoteData.mxCaption.forget();
+ }
}
ScCaptionPtr ScNoteUtil::CreateTempCaption(