summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/core/data/postit.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 1f694abd545a..193022830c1b 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -695,9 +695,16 @@ void ScCaptionPtr::decRefAndDestroy()
#if 1
// FIXME: there are still cases where the caption pointer is dangling
mpCaption = nullptr;
+ mbNotOwner = false;
#else
- // Destroying Draw Undo deletes its SdrObject, don't attempt that twice.
- if (!mbNotOwner)
+ // Destroying Draw Undo and some other delete the SdrObject, don't
+ // attempt that twice.
+ if (mbNotOwner)
+ {
+ mpCaption = nullptr;
+ mbNotOwner = false;
+ }
+ else
{
removeFromDrawPageAndFree( true ); // ignoring Undo
if (mpCaption)