diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-10-28 21:45:06 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-10-28 22:49:28 +0200 |
commit | 85c38f1cf4844a99bca3d08ddfcc0c798ce5873e (patch) | |
tree | d62648d178d49c8bab6ed208001d1da2551beefd /include | |
parent | 0117a5d34e14ec4976022175ff3807a1f3802d74 (diff) |
svl: change SfxPoolItem ref-count to sal_uInt32
Fixes the inconsistency between potentially 64-bit sal_uLong and
the max-value macros that are ~2^32.
Change-Id: I895c674819cf4766cb2c7441f670bc1305362a74
Diffstat (limited to 'include')
-rw-r--r-- | include/svl/itempool.hxx | 12 | ||||
-rw-r--r-- | include/svl/poolitem.hxx | 16 |
2 files changed, 14 insertions, 14 deletions
diff --git a/include/svl/itempool.hxx b/include/svl/itempool.hxx index 512117714750..624ef08127f4 100644 --- a/include/svl/itempool.hxx +++ b/include/svl/itempool.hxx @@ -79,9 +79,9 @@ public: const sal_uInt16* GetFrozenIdRanges() const; protected: - static inline void SetRefCount( SfxPoolItem& rItem, sal_uLong n ); - static inline void AddRef( const SfxPoolItem& rItem, sal_uLong n = 1 ); - static inline sal_uLong ReleaseRef( const SfxPoolItem& rItem, sal_uLong n = 1); + static inline void SetRefCount(SfxPoolItem& rItem, sal_uInt32 n); + static inline void AddRef(const SfxPoolItem& rItem, sal_uInt32 n = 1); + static inline sal_uInt32 ReleaseRef(const SfxPoolItem& rItem, sal_uInt32 n = 1); static inline void SetKind( SfxPoolItem& rItem, SfxItemKind nRef ); public: @@ -216,19 +216,19 @@ private: }; // only the pool may manipulate the reference counts -inline void SfxItemPool::SetRefCount( SfxPoolItem& rItem, sal_uLong n ) +inline void SfxItemPool::SetRefCount(SfxPoolItem& rItem, sal_uInt32 n) { rItem.SetRefCount(n); } // only the pool may manipulate the reference counts -inline void SfxItemPool::AddRef( const SfxPoolItem& rItem, sal_uLong n ) +inline void SfxItemPool::AddRef(const SfxPoolItem& rItem, sal_uInt32 n) { rItem.AddRef(n); } // only the pool may manipulate the reference counts -inline sal_uLong SfxItemPool::ReleaseRef( const SfxPoolItem& rItem, sal_uLong n ) +inline sal_uInt32 SfxItemPool::ReleaseRef(const SfxPoolItem& rItem, sal_uInt32 n) { return rItem.ReleaseRef(n); } diff --git a/include/svl/poolitem.hxx b/include/svl/poolitem.hxx index cbc60a952c5c..b6d8011a40f5 100644 --- a/include/svl/poolitem.hxx +++ b/include/svl/poolitem.hxx @@ -120,17 +120,17 @@ friend class SfxItemPoolCache; friend class SfxItemSet; friend class SfxVoidItem; - mutable sal_uLong m_nRefCount; + mutable sal_uInt32 m_nRefCount; sal_uInt16 m_nWhich; SfxItemKind m_nKind; private: - inline void SetRefCount( sal_uLong n ); + inline void SetRefCount(sal_uInt32 n); inline void SetKind( SfxItemKind n ); public: - inline void AddRef( sal_uLong n = 1 ) const; + inline void AddRef(sal_uInt32 n = 1) const; private: - inline sal_uLong ReleaseRef( sal_uLong n = 1 ) const; + inline sal_uInt32 ReleaseRef(sal_uInt32 n = 1) const; protected: explicit SfxPoolItem( sal_uInt16 nWhich = 0 ); @@ -170,7 +170,7 @@ public: // clone and call SetWhich SfxPoolItem* CloneSetWhich( sal_uInt16 nNewWhich ) const; - sal_uLong GetRefCount() const { return m_nRefCount; } + sal_uInt32 GetRefCount() const { return m_nRefCount; } inline SfxItemKind GetKind() const { return m_nKind; } virtual void dumpAsXml(struct _xmlTextWriter* pWriter) const; @@ -178,7 +178,7 @@ private: SfxPoolItem& operator=( const SfxPoolItem& ) = delete; }; -inline void SfxPoolItem::SetRefCount( sal_uLong n ) +inline void SfxPoolItem::SetRefCount(sal_uInt32 n) { m_nRefCount = n; m_nKind = SfxItemKind::NONE; @@ -190,14 +190,14 @@ inline void SfxPoolItem::SetKind( SfxItemKind n ) m_nKind = n; } -inline void SfxPoolItem::AddRef( sal_uLong n ) const +inline void SfxPoolItem::AddRef(sal_uInt32 n) const { assert(m_nRefCount <= SFX_ITEMS_MAXREF && "AddRef with non-Pool-Item"); assert(n <= SFX_ITEMS_MAXREF - m_nRefCount && "AddRef: refcount overflow"); m_nRefCount += n; } -inline sal_uLong SfxPoolItem::ReleaseRef( sal_uLong n ) const +inline sal_uInt32 SfxPoolItem::ReleaseRef(sal_uInt32 n) const { assert(m_nRefCount <= SFX_ITEMS_MAXREF && "ReleaseRef with non-Pool-Item"); assert(n <= m_nRefCount); |