diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-01-28 19:05:59 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-01-28 19:12:15 +0100 |
commit | 9ad661e5740142a95893e91e4c138caee2abe7c2 (patch) | |
tree | 5dd171947d22d245bd75aa8bed59dcb92fefbc94 /svl/inc | |
parent | 4651402a5399e00f62311bb3fe545413b0818a2d (diff) |
SfxPoolItem: fix annoying -Werror=shadow the hard way
... by properly prefixing the members.
Change-Id: Idfdb93b19bf9fdd5309fb55d4e7e56da81ee822a
Diffstat (limited to 'svl/inc')
-rw-r--r-- | svl/inc/svl/poolitem.hxx | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/svl/inc/svl/poolitem.hxx b/svl/inc/svl/poolitem.hxx index 70d4eeacf0cc..4e50e1ceb270 100644 --- a/svl/inc/svl/poolitem.hxx +++ b/svl/inc/svl/poolitem.hxx @@ -172,9 +172,9 @@ friend class SfxItemPoolCache; friend class SfxItemSet; friend class SfxVoidItem; - sal_uLong nRefCount; // Referenzzaehler - sal_uInt16 nWhich; - sal_uInt16 nKind; + sal_uLong m_nRefCount; + sal_uInt16 m_nWhich; + sal_uInt16 m_nKind; private: inline void SetRefCount( sal_uLong n ); @@ -195,10 +195,10 @@ public: void SetWhich( sal_uInt16 nId ) { DBG_CHKTHIS(SfxPoolItem, 0); - nWhich = nId; } + m_nWhich = nId; } sal_uInt16 Which() const { DBG_CHKTHIS(SfxPoolItem, 0); - return nWhich; } + return m_nWhich; } virtual int operator==( const SfxPoolItem& ) const = 0; int operator!=( const SfxPoolItem& rItem ) const { return !(*this == rItem); } @@ -222,8 +222,8 @@ public: virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const = 0; - sal_uLong GetRefCount() const { return nRefCount; } - inline sal_uInt16 GetKind() const { return nKind; } + sal_uLong GetRefCount() const { return m_nRefCount; } + inline sal_uInt16 GetKind() const { return m_nKind; } /** Read in a Unicode string from a streamed byte string representation. @@ -278,32 +278,32 @@ private: inline void SfxPoolItem::SetRefCount( sal_uLong n ) { DBG_CHKTHIS( SfxPoolItem, 0 ); - nRefCount = n; - nKind = 0; + m_nRefCount = n; + m_nKind = 0; } inline void SfxPoolItem::SetKind( sal_uInt16 n ) { DBG_CHKTHIS( SfxPoolItem, 0 ); - nRefCount = SFX_ITEMS_SPECIAL; - nKind = n; + m_nRefCount = SFX_ITEMS_SPECIAL; + m_nKind = n; } inline sal_uLong SfxPoolItem::AddRef( sal_uLong n ) const { DBG_CHKTHIS( SfxPoolItem, 0 ); - DBG_ASSERT( nRefCount <= SFX_ITEMS_MAXREF, "AddRef mit nicht-Pool-Item" ); - DBG_ASSERT( ULONG_MAX - nRefCount > n, "AddRef: Referenzzaehler ueberschlaegt sich" ); - return ( ((SfxPoolItem *)this)->nRefCount += n ); + DBG_ASSERT(m_nRefCount <= SFX_ITEMS_MAXREF, "AddRef with non-Pool-Item"); + DBG_ASSERT(ULONG_MAX - m_nRefCount > n, "AddRef: refcount overflow"); + return (const_cast<SfxPoolItem *>(this)->m_nRefCount += n); } inline sal_uLong SfxPoolItem::ReleaseRef( sal_uLong n ) const { DBG_CHKTHIS( SfxPoolItem, 0 ); - DBG_ASSERT( nRefCount <= SFX_ITEMS_MAXREF, "AddRef mit nicht-Pool-Item" ); - DBG_ASSERT( nRefCount >= n, "ReleaseRef: Referenzzaehler ueberschlaegt sich" ); - ((SfxPoolItem *)this)->nRefCount -= n; - return nRefCount; + 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; + return m_nRefCount; } // ----------------------------------------------------------------------- @@ -355,7 +355,7 @@ public: // von sich selbst eine Kopie erzeugen virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - void SetWhich(sal_uInt16 nWh) { nWhich = nWh; } + void SetWhich(sal_uInt16 nWh) { m_nWhich = nWh; } }; // ----------------------------------------------------------------------- |