diff options
-rw-r--r-- | include/svl/itempool.hxx | 12 | ||||
-rw-r--r-- | include/svl/poolitem.hxx | 16 | ||||
-rw-r--r-- | sc/source/core/data/docpool.cxx | 18 |
3 files changed, 23 insertions, 23 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); diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx index 1dedbae775a9..00c60e83258e 100644 --- a/sc/source/core/data/docpool.cxx +++ b/sc/source/core/data/docpool.cxx @@ -610,7 +610,7 @@ const SfxPoolItem& ScDocumentPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWh // Else Put must always happen, because it could be another Pool const SfxPoolItem& rNew = SfxItemPool::Put( rItem, nWhich ); - sal_uLong nRef = rNew.GetRefCount(); + sal_uInt32 nRef = rNew.GetRefCount(); if (nRef == 1) { ++mnCurrentMaxKey; @@ -624,13 +624,13 @@ void ScDocumentPool::Remove( const SfxPoolItem& rItem ) { if ( rItem.Which() == ATTR_PATTERN ) // Only Pattern is special { - sal_uLong nRef = rItem.GetRefCount(); - if ( nRef >= (sal_uLong) SC_MAX_POOLREF && nRef <= (sal_uLong) SFX_ITEMS_OLD_MAXREF ) + sal_uInt32 nRef = rItem.GetRefCount(); + if ( nRef >= (sal_uInt32) SC_MAX_POOLREF && nRef <= (sal_uInt32) SFX_ITEMS_OLD_MAXREF ) { - if ( nRef != (sal_uLong) SC_SAFE_POOLREF ) + if ( nRef != (sal_uInt32) SC_SAFE_POOLREF ) { OSL_FAIL("Who fiddles with my ref counts?"); - SetRefCount( (SfxPoolItem&)rItem, (sal_uLong) SC_SAFE_POOLREF ); + SetRefCount( (SfxPoolItem&)rItem, (sal_uInt32) SC_SAFE_POOLREF ); } return; // Do not decrement } @@ -640,14 +640,14 @@ void ScDocumentPool::Remove( const SfxPoolItem& rItem ) void ScDocumentPool::CheckRef( const SfxPoolItem& rItem ) { - sal_uLong nRef = rItem.GetRefCount(); - if ( nRef >= (sal_uLong) SC_MAX_POOLREF && nRef <= (sal_uLong) SFX_ITEMS_OLD_MAXREF ) + sal_uInt32 nRef = rItem.GetRefCount(); + if ( nRef >= (sal_uInt32) SC_MAX_POOLREF && nRef <= (sal_uInt32) SFX_ITEMS_OLD_MAXREF ) { // At the Apply of the Cache we might increase by 2 (to MAX+1 or SAFE+2) // We only decrease by 1 (in LoadCompleted) - OSL_ENSURE( nRef<=(sal_uLong)SC_MAX_POOLREF+1 || (nRef>=(sal_uLong)SC_SAFE_POOLREF-1 && nRef<=(sal_uLong)SC_SAFE_POOLREF+2), + OSL_ENSURE( nRef<=(sal_uInt32)SC_MAX_POOLREF+1 || (nRef>=(sal_uInt32)SC_SAFE_POOLREF-1 && nRef<=(sal_uInt32)SC_SAFE_POOLREF+2), "ScDocumentPool::CheckRef" ); - SetRefCount( (SfxPoolItem&)rItem, (sal_uLong) SC_SAFE_POOLREF ); + SetRefCount( (SfxPoolItem&)rItem, (sal_uInt32) SC_SAFE_POOLREF ); } } |