summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-10-28 21:45:06 +0200
committerMichael Stahl <mstahl@redhat.com>2016-10-28 22:49:28 +0200
commit85c38f1cf4844a99bca3d08ddfcc0c798ce5873e (patch)
treed62648d178d49c8bab6ed208001d1da2551beefd /sc
parent0117a5d34e14ec4976022175ff3807a1f3802d74 (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 'sc')
-rw-r--r--sc/source/core/data/docpool.cxx18
1 files changed, 9 insertions, 9 deletions
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 );
}
}