summaryrefslogtreecommitdiff
path: root/sw/source/core/inc/swcache.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/inc/swcache.hxx')
-rw-r--r--sw/source/core/inc/swcache.hxx20
1 files changed, 14 insertions, 6 deletions
diff --git a/sw/source/core/inc/swcache.hxx b/sw/source/core/inc/swcache.hxx
index 2cc6138cb2b1..af6c5a45a1d2 100644
--- a/sw/source/core/inc/swcache.hxx
+++ b/sw/source/core/inc/swcache.hxx
@@ -101,7 +101,7 @@ public:
const bool bToTop = true );
void ToTop( SwCacheObj *pObj );
- bool Insert( SwCacheObj *pNew );
+ bool Insert(SwCacheObj *pNew, bool isDuplicateOwnerAllowed);
void Delete(const void * pOwner, sal_uInt16 nIndex);
void Delete( const void *pOwner );
@@ -146,7 +146,15 @@ class SwCacheObj
void SetNext( SwCacheObj *pNew ) { m_pNext = pNew; }
void SetPrev( SwCacheObj *pNew ) { m_pPrev = pNew; }
- void SetCachePos( const sal_uInt16 nNew ) { m_nCachePos = nNew; }
+ void SetCachePos(const sal_uInt16 nNew)
+ {
+ if (m_nCachePos != nNew)
+ {
+ m_nCachePos = nNew;
+ UpdateCachePos();
+ }
+ }
+ virtual void UpdateCachePos() { }
protected:
const void *m_pOwner;
@@ -187,7 +195,7 @@ class SwCacheAccess
{
SwCache &m_rCache;
- void Get_();
+ void Get_(bool isDuplicateOwnerAllowed);
protected:
SwCacheObj *m_pObj;
@@ -195,7 +203,7 @@ protected:
virtual SwCacheObj *NewObj() = 0;
- inline SwCacheObj *Get();
+ inline SwCacheObj *Get(bool isDuplicateOwnerAllowed);
inline SwCacheAccess( SwCache &rCache, const void *pOwner, bool bSeek );
inline SwCacheAccess( SwCache &rCache, const void *pOwner, const sal_uInt16 nIndex );
@@ -241,10 +249,10 @@ inline SwCacheAccess::SwCacheAccess( SwCache &rC, const void *pOwn,
m_pObj->Lock();
}
-inline SwCacheObj *SwCacheAccess::Get()
+inline SwCacheObj *SwCacheAccess::Get(bool const isDuplicateOwnerAllowed = true)
{
if ( !m_pObj )
- Get_();
+ Get_(isDuplicateOwnerAllowed);
return m_pObj;
}