diff options
-rw-r--r-- | sw/source/core/bastyp/swcache.cxx | 9 | ||||
-rw-r--r-- | sw/source/core/inc/swcache.hxx | 1 | ||||
-rw-r--r-- | sw/source/core/text/txtfrm.cxx | 4 |
3 files changed, 14 insertions, 0 deletions
diff --git a/sw/source/core/bastyp/swcache.cxx b/sw/source/core/bastyp/swcache.cxx index 2019d7d0b3b5..ab82fe11ba74 100644 --- a/sw/source/core/bastyp/swcache.cxx +++ b/sw/source/core/bastyp/swcache.cxx @@ -326,6 +326,15 @@ void SwCache::DeleteObj( SwCacheObj *pObj ) CHECK; } +void SwCache::Delete(void const*const pOwner, sal_uInt16 const nIndex) +{ + INCREMENT( m_nDelete ); + if (SwCacheObj *const pObj = Get(pOwner, nIndex, false)) + { + DeleteObj(pObj); + } +} + void SwCache::Delete( const void *pOwner ) { INCREMENT( m_nDelete ); diff --git a/sw/source/core/inc/swcache.hxx b/sw/source/core/inc/swcache.hxx index 30410061b49f..a481bbff28ff 100644 --- a/sw/source/core/inc/swcache.hxx +++ b/sw/source/core/inc/swcache.hxx @@ -102,6 +102,7 @@ public: void ToTop( SwCacheObj *pObj ); bool Insert( SwCacheObj *pNew ); + void Delete(const void * pOwner, sal_uInt16 nIndex); void Delete( const void *pOwner ); void SetLRUOfst( const sal_uInt16 nOfst ); /// nOfst determines how many are not to be touched diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index 62b281ae6974..c759be22aa02 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -693,6 +693,10 @@ void SwTextFrame::DestroyImpl() SwTextFrame::~SwTextFrame() { + if (GetCacheIdx() != USHRT_MAX) + { + s_pTextCache->Delete(this, GetCacheIdx()); + } } namespace sw { |