diff options
author | Bartosz Kosiorek <gang65@openoffice.org> | 2010-10-16 21:21:14 +0200 |
---|---|---|
committer | Bartosz Kosiorek <gang65@openoffice.org> | 2010-10-16 21:21:14 +0200 |
commit | 541c40f8d8ed36a8d16593f4a496cea568362b78 (patch) | |
tree | 5be40ae4d5dbd30e2cf419f013c0d69d10c51390 /svx/source/unodraw | |
parent | 875cfd6a3e7a21475b6f2c72be854811c10eed71 (diff) |
svarray: #i112395# #i84159# handle 2^32 numbers
Diffstat (limited to 'svx/source/unodraw')
-rw-r--r-- | svx/source/unodraw/UnoNameItemTable.cxx | 30 | ||||
-rw-r--r-- | svx/source/unodraw/UnoNamespaceMap.cxx | 10 | ||||
-rw-r--r-- | svx/source/unodraw/unomtabl.cxx | 44 | ||||
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 14 |
4 files changed, 49 insertions, 49 deletions
diff --git a/svx/source/unodraw/UnoNameItemTable.cxx b/svx/source/unodraw/UnoNameItemTable.cxx index a802af33fbbd..c7eb679e5e63 100644 --- a/svx/source/unodraw/UnoNameItemTable.cxx +++ b/svx/source/unodraw/UnoNameItemTable.cxx @@ -201,11 +201,11 @@ void SAL_CALL SvxUnoNameItemTable::replaceByName( const OUString& aApiName, cons // if it is not in our own sets, modify the pool! sal_Bool bFound = sal_False; - USHORT nSurrogate; - USHORT nCount = mpModelPool ? mpModelPool->GetItemCount( mnWhich ) : 0; + sal_uInt32 nSurrogate; + sal_uInt32 nCount = mpModelPool ? mpModelPool->GetItemCount2( mnWhich ) : 0; for( nSurrogate = 0; nSurrogate < nCount; nSurrogate++ ) { - pItem = (NameOrIndex*)mpModelPool->GetItem( mnWhich, nSurrogate); + pItem = (NameOrIndex*)mpModelPool->GetItem2( mnWhich, nSurrogate); if( pItem && pItem->GetName() == aSearchName ) { pItem->PutValue( aElement, mnMemberId ); @@ -238,12 +238,12 @@ uno::Any SAL_CALL SvxUnoNameItemTable::getByName( const OUString& aApiName ) { const String aSearchName( aName ); NameOrIndex *pItem; - sal_Int32 nSurrogate; + sal_uInt32 nSurrogate; - sal_Int32 nSurrogateCount = mpModelPool ? (sal_Int32)mpModelPool->GetItemCount( mnWhich ) : 0; + sal_uInt32 nSurrogateCount = mpModelPool ? mpModelPool->GetItemCount2( mnWhich ) : 0; for( nSurrogate = 0; nSurrogate < nSurrogateCount; nSurrogate++ ) { - pItem = (NameOrIndex*)mpModelPool->GetItem( mnWhich, (USHORT)nSurrogate ); + pItem = (NameOrIndex*)mpModelPool->GetItem2( mnWhich, nSurrogate ); if( isValid( pItem ) && (pItem->GetName() == aSearchName) ) { @@ -266,11 +266,11 @@ uno::Sequence< OUString > SAL_CALL SvxUnoNameItemTable::getElementNames( ) NameOrIndex *pItem; OUString aApiName; - const sal_Int32 nSurrogateCount = mpModelPool ? (sal_Int32)mpModelPool->GetItemCount( mnWhich ) : 0; - sal_Int32 nSurrogate; + const sal_uInt32 nSurrogateCount = mpModelPool ? mpModelPool->GetItemCount2( mnWhich ) : 0; + sal_uInt32 nSurrogate; for( nSurrogate = 0; nSurrogate < nSurrogateCount; nSurrogate++ ) { - pItem = (NameOrIndex*)mpModelPool->GetItem( mnWhich, (USHORT)nSurrogate ); + pItem = (NameOrIndex*)mpModelPool->GetItem2( mnWhich, nSurrogate ); if( !isValid( pItem ) ) continue; @@ -305,14 +305,14 @@ sal_Bool SAL_CALL SvxUnoNameItemTable::hasByName( const OUString& aApiName ) return sal_False; const String aSearchName( aName ); - USHORT nSurrogate; + sal_uInt32 nSurrogate; const NameOrIndex *pItem; - USHORT nCount = mpModelPool ? mpModelPool->GetItemCount( mnWhich ) : 0; + sal_uInt32 nCount = mpModelPool ? mpModelPool->GetItemCount2( mnWhich ) : 0; for( nSurrogate = 0; nSurrogate < nCount; nSurrogate++ ) { - pItem = (NameOrIndex*)mpModelPool->GetItem( mnWhich, nSurrogate ); + pItem = (NameOrIndex*)mpModelPool->GetItem2( mnWhich, nSurrogate ); if( isValid( pItem ) && (pItem->GetName() == aSearchName) ) return sal_True; } @@ -327,11 +327,11 @@ sal_Bool SAL_CALL SvxUnoNameItemTable::hasElements( ) const NameOrIndex *pItem; - sal_Int32 nSurrogate; - const sal_Int32 nSurrogateCount = mpModelPool ? (sal_Int32)mpModelPool->GetItemCount( mnWhich ) : 0; + sal_uInt32 nSurrogate; + const sal_uInt32 nSurrogateCount = mpModelPool ? mpModelPool->GetItemCount2( mnWhich ) : 0; for( nSurrogate = 0; nSurrogate < nSurrogateCount; nSurrogate++ ) { - pItem = (NameOrIndex*)mpModelPool->GetItem( mnWhich, (USHORT)nSurrogate ); + pItem = (NameOrIndex*)mpModelPool->GetItem2( mnWhich, nSurrogate ); if( isValid( pItem ) ) return sal_True; diff --git a/svx/source/unodraw/UnoNamespaceMap.cxx b/svx/source/unodraw/UnoNamespaceMap.cxx index 5c7ad5226aff..faf38d64b520 100644 --- a/svx/source/unodraw/UnoNamespaceMap.cxx +++ b/svx/source/unodraw/UnoNamespaceMap.cxx @@ -118,8 +118,8 @@ namespace svx sal_uInt16* mpWhichId; - sal_uInt16 mnItemCount; - sal_uInt16 mnItem; + sal_uInt32 mnItemCount; + sal_uInt32 mnItem; const SvXMLAttrContainerItem* mpCurrentAttr; sal_uInt16 mnCurrentAttr; @@ -145,7 +145,7 @@ NamespaceIteratorImpl::NamespaceIteratorImpl( sal_uInt16* pWhichIds, SfxItemPool mpWhichId = pWhichIds; mnItem = 0; - mnItemCount = (mpWhichId && (0 != *mpWhichId) && mpPool) ? mpPool->GetItemCount( *mpWhichId ) : 0; + mnItemCount = (mpWhichId && (0 != *mpWhichId) && mpPool) ? mpPool->GetItemCount2( *mpWhichId ) : 0; } sal_Bool NamespaceIteratorImpl::next( ::rtl::OUString& rPrefix, ::rtl::OUString& rURL ) @@ -165,7 +165,7 @@ sal_Bool NamespaceIteratorImpl::next( ::rtl::OUString& rPrefix, ::rtl::OUString& const SfxPoolItem* pItem = 0; // look for the next available item in the current pool - while( (mnItem < mnItemCount) && ( NULL == (pItem = mpPool->GetItem( *mpWhichId, mnItem ) ) ) ) + while( (mnItem < mnItemCount) && ( NULL == (pItem = mpPool->GetItem2( *mpWhichId, mnItem ) ) ) ) mnItem++; // are we finished with the current whichid? @@ -177,7 +177,7 @@ sal_Bool NamespaceIteratorImpl::next( ::rtl::OUString& rPrefix, ::rtl::OUString& if( 0 != *mpWhichId ) { mnItem = 0; - mnItemCount = (mpWhichId && (0 != *mpWhichId) && mpPool) ? mpPool->GetItemCount( *mpWhichId ) : 0; + mnItemCount = (mpWhichId && (0 != *mpWhichId) && mpPool) ? mpPool->GetItemCount2( *mpWhichId ) : 0; return next( rPrefix, rURL ); } diff --git a/svx/source/unodraw/unomtabl.cxx b/svx/source/unodraw/unomtabl.cxx index dbb7269c1318..60d19e8d13a9 100644 --- a/svx/source/unodraw/unomtabl.cxx +++ b/svx/source/unodraw/unomtabl.cxx @@ -276,11 +276,11 @@ void SAL_CALL SvxUnoMarkerTable::replaceByName( const OUString& aApiName, const // if it is not in our own sets, modify the pool! sal_Bool bFound = sal_False; - USHORT nSurrogate; - const USHORT nStartCount = mpModelPool ? mpModelPool->GetItemCount( XATTR_LINESTART ) : 0; + sal_uInt32 nSurrogate; + const sal_uInt32 nStartCount = mpModelPool ? mpModelPool->GetItemCount2( XATTR_LINESTART ) : 0; for( nSurrogate = 0; nSurrogate < nStartCount; nSurrogate++ ) { - pItem = (NameOrIndex*)mpModelPool->GetItem( XATTR_LINESTART, nSurrogate); + pItem = (NameOrIndex*)mpModelPool->GetItem2( XATTR_LINESTART, nSurrogate); if( pItem && pItem->GetName() == aSearchName ) { pItem->PutValue( aElement ); @@ -289,10 +289,10 @@ void SAL_CALL SvxUnoMarkerTable::replaceByName( const OUString& aApiName, const } } - const USHORT nEndCount = mpModelPool ? mpModelPool->GetItemCount( XATTR_LINEEND ) : 0; + const sal_uInt32 nEndCount = mpModelPool ? mpModelPool->GetItemCount2( XATTR_LINEEND ) : 0; for( nSurrogate = 0; nSurrogate < nEndCount; nSurrogate++ ) { - pItem = (NameOrIndex*)mpModelPool->GetItem( XATTR_LINEEND, nSurrogate); + pItem = (NameOrIndex*)mpModelPool->GetItem2( XATTR_LINEEND, nSurrogate); if( pItem && pItem->GetName() == aSearchName ) { pItem->PutValue( aElement ); @@ -310,10 +310,10 @@ void SAL_CALL SvxUnoMarkerTable::replaceByName( const OUString& aApiName, const static sal_Bool getByNameFromPool( const String& rSearchName, SfxItemPool* pPool, USHORT nWhich, uno::Any& rAny ) { NameOrIndex *pItem; - const sal_Int32 nSurrogateCount = pPool ? (sal_Int32)pPool->GetItemCount( nWhich ) : 0; - for( sal_Int32 nSurrogate = 0; nSurrogate < nSurrogateCount; nSurrogate++ ) + const sal_uInt32 nSurrogateCount = pPool ? pPool->GetItemCount2( nWhich ) : 0; + for( sal_uInt32 nSurrogate = 0; nSurrogate < nSurrogateCount; nSurrogate++ ) { - pItem = (NameOrIndex*)pPool->GetItem( nWhich, (USHORT)nSurrogate ); + pItem = (NameOrIndex*)pPool->GetItem2( nWhich, nSurrogate ); if( pItem && pItem->GetName() == rSearchName ) { @@ -357,15 +357,15 @@ uno::Any SAL_CALL SvxUnoMarkerTable::getByName( const OUString& aApiName ) static void createNamesForPool( SfxItemPool* pPool, USHORT nWhich, std::set< OUString, comphelper::UStringLess >& rNameSet ) { - const sal_Int32 nSuroCount = pPool->GetItemCount( nWhich ); - sal_Int32 nSurrogate; + const sal_uInt32 nSuroCount = pPool->GetItemCount2( nWhich ); + sal_uInt32 nSurrogate; - NameOrIndex *pItem; + NameOrIndex* pItem; OUString aName; for( nSurrogate = 0; nSurrogate < nSuroCount; nSurrogate++ ) { - pItem = (NameOrIndex*)pPool->GetItem( nWhich, (USHORT)nSurrogate ); + pItem = (NameOrIndex*)pPool->GetItem2( nWhich, nSurrogate ); if( pItem == NULL || pItem->GetName().Len() == 0 ) continue; @@ -415,20 +415,20 @@ sal_Bool SAL_CALL SvxUnoMarkerTable::hasByName( const OUString& aName ) NameOrIndex *pItem; SvxUnogetInternalNameForItem( XATTR_LINESTART, aName, aSearchName ); - USHORT nStartCount = mpModelPool ? mpModelPool->GetItemCount( XATTR_LINESTART ) : 0; - USHORT nSurrogate; + sal_uInt32 nStartCount = mpModelPool ? mpModelPool->GetItemCount2( XATTR_LINESTART ) : 0; + sal_uInt32 nSurrogate; for( nSurrogate = 0; nSurrogate < nStartCount; nSurrogate++ ) { - pItem = (NameOrIndex*)mpModelPool->GetItem( XATTR_LINESTART, nSurrogate); + pItem = (NameOrIndex*)mpModelPool->GetItem2( XATTR_LINESTART, nSurrogate); if( pItem && pItem->GetName() == aSearchName ) return sal_True; } SvxUnogetInternalNameForItem( XATTR_LINEEND, aName, aSearchName ); - USHORT nEndCount = mpModelPool ? mpModelPool->GetItemCount( XATTR_LINEEND ) : 0; + sal_uInt32 nEndCount = mpModelPool ? mpModelPool->GetItemCount2( XATTR_LINEEND ) : 0; for( nSurrogate = 0; nSurrogate < nEndCount; nSurrogate++ ) { - pItem = (NameOrIndex*)mpModelPool->GetItem( XATTR_LINEEND, nSurrogate); + pItem = (NameOrIndex*)mpModelPool->GetItem2( XATTR_LINEEND, nSurrogate); if( pItem && pItem->GetName() == aSearchName ) return sal_True; } @@ -450,19 +450,19 @@ sal_Bool SAL_CALL SvxUnoMarkerTable::hasElements( ) NameOrIndex *pItem; - const USHORT nStartCount = mpModelPool ? mpModelPool->GetItemCount( XATTR_LINESTART ) : 0; - USHORT nSurrogate; + const sal_uInt32 nStartCount = mpModelPool ? mpModelPool->GetItemCount2( XATTR_LINESTART ) : 0; + sal_uInt32 nSurrogate; for( nSurrogate = 0; nSurrogate < nStartCount; nSurrogate++ ) { - pItem = (NameOrIndex*)mpModelPool->GetItem( XATTR_LINESTART, nSurrogate); + pItem = (NameOrIndex*)mpModelPool->GetItem2( XATTR_LINESTART, nSurrogate); if( pItem && pItem->GetName().Len() != 0 ) return sal_True; } - const USHORT nEndCount = mpModelPool ? mpModelPool->GetItemCount( XATTR_LINEEND ) : 0; + const sal_uInt32 nEndCount = mpModelPool ? mpModelPool->GetItemCount2( XATTR_LINEEND ) : 0; for( nSurrogate = 0; nSurrogate < nEndCount; nSurrogate++ ) { - pItem = (NameOrIndex*)mpModelPool->GetItem( XATTR_LINEEND, nSurrogate); + pItem = (NameOrIndex*)mpModelPool->GetItem2( XATTR_LINEEND, nSurrogate); if( pItem && pItem->GetName().Len() != 0 ) return sal_True; } diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index d860f4973fd2..b2874869ef38 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -1721,12 +1721,12 @@ sal_Bool SAL_CALL SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rN const SfxItemPool* pPool = rSet.GetPool(); const String aSearchName( aName ); - const USHORT nCount = pPool->GetItemCount((USHORT)nWID); - const NameOrIndex *pItem; + const sal_uInt32 nCount = pPool->GetItemCount2((USHORT)nWID); + const NameOrIndex* pItem; - for( USHORT nSurrogate = 0; nSurrogate < nCount; nSurrogate++ ) + for( sal_uInt32 nSurrogate = 0; nSurrogate < nCount; nSurrogate++ ) { - pItem = (NameOrIndex*)pPool->GetItem((USHORT)nWID, nSurrogate); + pItem = (NameOrIndex*)pPool->GetItem2((USHORT)nWID, nSurrogate); if( pItem && ( pItem->GetName() == aSearchName ) ) { rSet.Put( *pItem ); @@ -1755,11 +1755,11 @@ sal_Bool SAL_CALL SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rN const SfxItemPool& rPool = pModel->GetItemPool(); const String aSearchName( rName ); - const USHORT nCount = rPool.GetItemCount((USHORT)nWhich); - const NameOrIndex *pItem = 0; + const sal_uInt32 nCount = rPool.GetItemCount((USHORT)nWhich); + const NameOrIndex* pItem = 0; bool bFound = false; - for( USHORT nSurrogate = 0; ! bFound && nSurrogate < nCount; nSurrogate++ ) + for( sal_uInt32 nSurrogate = 0; ! bFound && nSurrogate < nCount; nSurrogate++ ) { pItem = (NameOrIndex*)rPool.GetItem((USHORT)nWhich, nSurrogate); if( pItem && ( pItem->GetName() == aSearchName ) ) |