diff options
author | Eike Rathke <erack@redhat.com> | 2017-02-27 19:50:07 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-02-27 19:52:14 +0100 |
commit | 8d6afde106f3b9ba4eab0fa00cb6ddd28494a258 (patch) | |
tree | b0c15e37453f4c4bcf8802d44538e73bfa256fc4 /sc/inc | |
parent | e7adffff8039175bc50b56b4c07ce0b9d8fed629 (diff) |
rework ScCaptionPtr to have a distinct head element
Not only saves a pointer per list element, but future versions could
hold a document pointer and/or drawing layer's draw page as well.
Change-Id: I85e05981239223bec88c47f2ebe4c22e50cd9a0d
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/postit.hxx | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sc/inc/postit.hxx b/sc/inc/postit.hxx index ea4a43d9d4de..ad671fb649c2 100644 --- a/sc/inc/postit.hxx +++ b/sc/inc/postit.hxx @@ -72,11 +72,18 @@ public: oslInterlockedCount getRefs() const; private: - ScCaptionPtr* mpHead; ///< points to the "master" entry - mutable ScCaptionPtr* mpNext; ///< next in list - SdrCaptionObj* mpCaption; ///< the caption object, managed by head master - mutable oslInterlockedCount mnRefs; ///< use count, managed by head master + struct Head + { + ScCaptionPtr* mpFirst; ///< first in list + oslInterlockedCount mnRefs; ///< use count + }; + + Head* mpHead; ///< points to the "master" entry + mutable ScCaptionPtr* mpNext; ///< next in list + SdrCaptionObj* mpCaption; ///< the caption object, managed by head master + + void newHead(); //< Allocate a new Head and init. void incRef() const; bool decRef() const; //< @returns <TRUE/> if the last reference was decremented. void decRefAndDestroy(); //< Destroys caption object if the last reference was decremented. |