Kaydet (Commit) dc0af9ef authored tarafından Noel Grandin's avatar Noel Grandin

mark m_nRefCount in SfxPoolItem as mutable

so that we don't have to const-cast when modifying it

Change-Id: If584e4ddd440638169af00493f0194b34832177f
üst 0361eb7c
......@@ -162,7 +162,7 @@ friend class SfxItemPoolCache;
friend class SfxItemSet;
friend class SfxVoidItem;
sal_uLong m_nRefCount;
mutable sal_uLong m_nRefCount;
sal_uInt16 m_nWhich;
sal_uInt16 m_nKind;
......@@ -274,14 +274,14 @@ inline void SfxPoolItem::AddRef( sal_uLong n ) const
{
DBG_ASSERT(m_nRefCount <= SFX_ITEMS_MAXREF, "AddRef with non-Pool-Item");
DBG_ASSERT(ULONG_MAX - m_nRefCount > n, "AddRef: refcount overflow");
const_cast<SfxPoolItem *>(this)->m_nRefCount += n;
m_nRefCount += n;
}
inline sal_uLong SfxPoolItem::ReleaseRef( sal_uLong n ) const
{
DBG_ASSERT(m_nRefCount <= SFX_ITEMS_MAXREF, "AddRef with non-Pool-Item");
DBG_ASSERT(m_nRefCount >= n, "AddRef: refcount underflow");
const_cast<SfxPoolItem *>(this)->m_nRefCount -= n;
m_nRefCount -= n;
return m_nRefCount;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment