Kaydet (Commit) d3676cee authored tarafından Eike Rathke's avatar Eike Rathke

in decRefAndDestroy() the remaining element must be one and only one

So head can be destroyed already there and removeFromList() take a short cut.

Change-Id: I8f53d252c4e0ad867674ee410ecfaa300ac0c731
üst e6a90b3f
......@@ -637,14 +637,11 @@ void ScCaptionPtr::decRefAndDestroy()
* foo and call SdrObject::Free(), likely with mpHead->mpCaption, see
* ScPostIt::RemoveCaption(). Further work needed to be able to do so.
* */
ScCaptionPtr* pThat = (mpHead ? mpHead->mpFirst : this);
do
{
pThat->mpCaption = nullptr;
pThat = pThat->mpNext;
}
while (pThat);
assert(!mpCaption); // this ought to be in list and nulled
assert(mpHead->mpFirst == this); // this must be one and only one
mpCaption = nullptr;
assert(!mpNext); // this must be one and only one
delete mpHead;
mpHead = nullptr;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment