rename ScCaptionPtr (mb|set)InUndo to (mb|set)NotOwner
... which better suits the general purpose we'll need
Change-Id: I32805c91d17180d5f18225a02c8a436826242e19
diff --git a/sc/inc/postit.hxx b/sc/inc/postit.hxx
index a630aef..d9584e1 100644
--- a/sc/inc/postit.hxx
+++ b/sc/inc/postit.hxx
@@ -86,7 +86,7 @@ public:
bool forget();
/** Flag that this instance is in Undo, so drawing layer owns it. */
void setInUndo();
void setNotOwner();
oslInterlockedCount getRefs() const;
@@ -104,7 +104,7 @@ private:
Head* mpHead; ///< points to the "master" entry
mutable ScCaptionPtr* mpNext; ///< next in list
SdrCaptionObj* mpCaption; ///< the caption object, managed by head master
bool mbInUndo; ///< whether this caption object is held in Undo
bool mbNotOwner; ///< whether this caption object is owned by something else, e.g. held in Undo
/* TODO: can that be moved to Head?
* It's unclear when to reset, so
* each instance has its own flag.
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index d2ef02f..78cd43a 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -445,12 +445,12 @@ ScNoteCaptionCreator::ScNoteCaptionCreator( ScDocument& rDoc, const ScAddress& r
ScCaptionPtr::ScCaptionPtr() :
mpHead(nullptr), mpNext(nullptr), mpCaption(nullptr), mbInUndo(false)
mpHead(nullptr), mpNext(nullptr), mpCaption(nullptr), mbNotOwner(false)
{
}
ScCaptionPtr::ScCaptionPtr( SdrCaptionObj* p ) :
mpHead(nullptr), mpNext(nullptr), mpCaption(p), mbInUndo(false)
mpHead(nullptr), mpNext(nullptr), mpCaption(p), mbNotOwner(false)
{
if (p)
{
@@ -459,7 +459,7 @@ ScCaptionPtr::ScCaptionPtr( SdrCaptionObj* p ) :
}
ScCaptionPtr::ScCaptionPtr( const ScCaptionPtr& r ) :
mpHead(r.mpHead), mpCaption(r.mpCaption), mbInUndo(false)
mpHead(r.mpHead), mpCaption(r.mpCaption), mbNotOwner(false)
{
if (r.mpCaption)
{
@@ -477,7 +477,7 @@ ScCaptionPtr::ScCaptionPtr( const ScCaptionPtr& r ) :
}
ScCaptionPtr::ScCaptionPtr( ScCaptionPtr&& r ) :
mpHead(r.mpHead), mpNext(r.mpNext), mpCaption(r.mpCaption), mbInUndo(false)
mpHead(r.mpHead), mpNext(r.mpNext), mpCaption(r.mpCaption), mbNotOwner(false)
{
r.replaceInList( this );
r.mpCaption = nullptr;
@@ -534,9 +534,9 @@ ScCaptionPtr& ScCaptionPtr::operator=( const ScCaptionPtr& r )
return *this;
}
void ScCaptionPtr::setInUndo()
void ScCaptionPtr::setNotOwner()
{
mbInUndo = true;
mbNotOwner = true;
}
ScCaptionPtr::Head::Head( ScCaptionPtr* p ) :
@@ -697,7 +697,7 @@ void ScCaptionPtr::decRefAndDestroy()
mpCaption = nullptr;
#else
// Destroying Draw Undo deletes its SdrObject, don't attempt that twice.
if (!mbInUndo)
if (!mbNotOwner)
{
removeFromDrawPageAndFree( true ); // ignoring Undo
if (mpCaption)
diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx
index 202acdd..7db4c90 100644
--- a/sc/source/ui/undo/undocell.cxx
+++ b/sc/source/ui/undo/undocell.cxx
@@ -712,12 +712,12 @@ ScUndoReplaceNote::ScUndoReplaceNote( ScDocShell& rDocShell, const ScAddress& rP
if (bInsert)
{
maNewData = rNoteData;
maNewData.mxCaption.setInUndo();
maNewData.mxCaption.setNotOwner();
}
else
{
maOldData = rNoteData;
maOldData.mxCaption.setInUndo();
maOldData.mxCaption.setNotOwner();
}
}
@@ -731,8 +731,8 @@ ScUndoReplaceNote::ScUndoReplaceNote( ScDocShell& rDocShell, const ScAddress& rP
{
OSL_ENSURE( maOldData.mxCaption || maNewData.mxCaption, "ScUndoReplaceNote::ScUndoReplaceNote - missing note captions" );
OSL_ENSURE( !maOldData.mxInitData.get() && !maNewData.mxInitData.get(), "ScUndoReplaceNote::ScUndoReplaceNote - unexpected unitialized note" );
maOldData.mxCaption.setInUndo();
maNewData.mxCaption.setInUndo();
maOldData.mxCaption.setNotOwner();
maNewData.mxCaption.setNotOwner();
}
ScUndoReplaceNote::~ScUndoReplaceNote()