summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-07-21 12:23:23 +0200
committerNoel Grandin <noel@peralex.com>2014-07-23 13:26:17 +0200
commitdc0af9ef8eb00170997181c2adddbe93315486c7 (patch)
tree1fb7fcb5fc98f0dc1e1286924b5506339486dd69 /include
parent0361eb7c20db4eba051ad5593c63b69f3565e488 (diff)
mark m_nRefCount in SfxPoolItem as mutable
so that we don't have to const-cast when modifying it Change-Id: If584e4ddd440638169af00493f0194b34832177f
Diffstat (limited to 'include')
-rw-r--r--include/svl/poolitem.hxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/svl/poolitem.hxx b/include/svl/poolitem.hxx
index e3243e2f2afa..8878355e66e3 100644
--- a/include/svl/poolitem.hxx
+++ b/include/svl/poolitem.hxx
@@ -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;
}