[Libreoffice-commits] core.git: sc/source

Eike Rathke erack at redhat.com
Fri Apr 7 14:59:43 UTC 2017


 sc/source/core/data/postit.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit e4364376b32c58edc0eaba4c587abe7de0eb9987
Author: Eike Rathke <erack at redhat.com>
Date:   Fri Apr 7 16:58:13 2017 +0200

    yet another mxCaption refs==1 case to exclude from assert
    
    Change-Id: Iffa8f2bc7d0bb77d5145a569da2c03aefbb9de4a

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);
 }
 


More information about the Libreoffice-commits mailing list