diff options
author | Noel Grandin <noel@peralex.com> | 2012-06-12 17:22:34 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-06-12 23:25:10 +0200 |
commit | 072a67d198120a1e7a0cea16e834e33fcc9631bc (patch) | |
tree | 9caa48888748af352e4bd5e34fee30e176ff00ab | |
parent | 2a360b68475d6fff5b6618feddb0b52f3a4a2373 (diff) |
Convert SV_DECL_PTRARR_DEL(NfWSStringsDtor) to std::vector
I had to keep the pointer typedef because MacOS gcc gets
confused otherwise.
Change-Id: I0681585f7273dcac25b2cb835601b29353e2183a
-rw-r--r-- | svl/inc/svl/zforlist.hxx | 12 | ||||
-rw-r--r-- | svl/source/numbers/zforlist.cxx | 29 | ||||
-rw-r--r-- | svx/source/items/numfmtsh.cxx | 5 |
3 files changed, 27 insertions, 19 deletions
diff --git a/svl/inc/svl/zforlist.hxx b/svl/inc/svl/zforlist.hxx index 701216468f0d..79bff15dc8c7 100644 --- a/svl/inc/svl/zforlist.hxx +++ b/svl/inc/svl/zforlist.hxx @@ -318,8 +318,18 @@ public: typedef NfCurrencyEntry* NfCurrencyEntryPtr; SV_DECL_PTRARR_DEL( NfCurrencyTable, NfCurrencyEntryPtr, 128 ) + typedef String* WSStringPtr; -SV_DECL_PTRARR_DEL_VISIBILITY( NfWSStringsDtor, WSStringPtr, 8, SVL_DLLPUBLIC ) +class SVL_DLLPUBLIC NfWSStringsDtor : public std::vector<WSStringPtr> +{ +public: + ~NfWSStringsDtor() + { + for( const_iterator it = begin(); it != end(); ++it ) + delete *it; + } + +}; class SvNumberFormatterRegistry_Impl; diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 7c8a49ca727b..65f4922ac7f9 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -186,7 +186,6 @@ namespace } sal_uInt16 SvNumberFormatter::nSystemCurrencyPosition = 0; SV_IMPL_PTRARR( NfCurrencyTable, NfCurrencyEntry* ); -SV_IMPL_PTRARR( NfWSStringsDtor, String* ); // Whether BankSymbol (not CurrencySymbol!) is always at the end (1 $;-1 $) or // language dependent. @@ -3192,10 +3191,10 @@ sal_uInt32 SvNumberFormatter::ImpGetDefaultSystemCurrencyFormat() NfWSStringsDtor aCurrList; sal_uInt16 nDefault = GetCurrencyFormatStrings( aCurrList, GetCurrencyEntry( LANGUAGE_SYSTEM ), false ); - DBG_ASSERT( aCurrList.Count(), "where is the NewCurrency System standard format?!?" ); + DBG_ASSERT( aCurrList.size(), "where is the NewCurrency System standard format?!?" ); // if already loaded or user defined nDefaultSystemCurrencyFormat // will be set to the right value - PutEntry( *aCurrList.GetObject( nDefault ), nCheck, nType, + PutEntry( *aCurrList[ nDefault ], nCheck, nType, nDefaultSystemCurrencyFormat, LANGUAGE_SYSTEM ); DBG_ASSERT( nCheck == 0, "NewCurrency CheckError" ); DBG_ASSERT( nDefaultSystemCurrencyFormat != NUMBERFORMAT_ENTRY_NOT_FOUND, @@ -3234,13 +3233,13 @@ sal_uInt32 SvNumberFormatter::ImpGetDefaultCurrencyFormat() NfWSStringsDtor aCurrList; sal_uInt16 nDefault = GetCurrencyFormatStrings( aCurrList, GetCurrencyEntry( ActLnge ), false ); - DBG_ASSERT( aCurrList.Count(), "where is the NewCurrency standard format?" ); - if ( aCurrList.Count() ) + DBG_ASSERT( aCurrList.size(), "where is the NewCurrency standard format?" ); + if ( !aCurrList.empty() ) { // if already loaded or user defined nDefaultSystemCurrencyFormat // will be set to the right value short nType; - PutEntry( *aCurrList.GetObject( nDefault ), nCheck, nType, + PutEntry( *aCurrList[ nDefault ], nCheck, nType, nDefaultCurrencyFormat, ActLnge ); DBG_ASSERT( nCheck == 0, "NewCurrency CheckError" ); DBG_ASSERT( nDefaultCurrencyFormat != NUMBERFORMAT_ENTRY_NOT_FOUND, @@ -3694,9 +3693,9 @@ sal_uInt16 SvNumberFormatter::GetCurrencyFormatStrings( NfWSStringsDtor& rStrArr *pFormat1 += aNegativeBank; *pFormat2 += aNegativeBank; - rStrArr.Insert( pFormat1, rStrArr.Count() ); - rStrArr.Insert( pFormat2, rStrArr.Count() ); - nDefault = rStrArr.Count() - 1; + rStrArr.push_back( pFormat1 ); + rStrArr.push_back( pFormat2 ); + nDefault = rStrArr.size() - 1; } else { @@ -3750,14 +3749,14 @@ sal_uInt16 SvNumberFormatter::GetCurrencyFormatStrings( NfWSStringsDtor& rStrArr *pFormat4 += aNegative; if ( pFormat1 ) - rStrArr.Insert( pFormat1, rStrArr.Count() ); - rStrArr.Insert( pFormat2, rStrArr.Count() ); + rStrArr.push_back( pFormat1 ); + rStrArr.push_back( pFormat2 ); if ( pFormat3 ) - rStrArr.Insert( pFormat3, rStrArr.Count() ); - rStrArr.Insert( pFormat4, rStrArr.Count() ); - nDefault = rStrArr.Count() - 1; + rStrArr.push_back( pFormat3 ); + rStrArr.push_back( pFormat4 ); + nDefault = rStrArr.size() - 1; if ( pFormat5 ) - rStrArr.Insert( pFormat5, rStrArr.Count() ); + rStrArr.push_back( pFormat5 ); } return nDefault; } diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx index d696123ea8b4..b2ee52a00695 100644 --- a/svx/source/items/numfmtsh.cxx +++ b/svx/source/items/numfmtsh.cxx @@ -1026,8 +1026,7 @@ short SvxNumberFormatShell::FillEListWithUserCurrencys( std::vector<String*>& rL } size_t nOldListCount = rList.size(); - for( size_t i = 0, nPos = nOldListCount; - i < static_cast<size_t>(aWSStringsDtor.Count()); ++i ) + for( size_t i = 0, nPos = nOldListCount; i < aWSStringsDtor.size(); ++i ) { bool bFlag = true; String aInsStr(*aWSStringsDtor[i]); @@ -1792,7 +1791,7 @@ bool SvxNumberFormatShell::IsInTable(sal_uInt16 nPos,bool bTmpBanking,const Stri pFormatter->GetCurrencyFormatStrings( aWSStringsDtor, *pTmpCurrencyEntry, bTmpBanking ); - for(sal_uInt16 i=0;i<aWSStringsDtor.Count();i++) + for(sal_uInt16 i=0;i<aWSStringsDtor.size();i++) { if(*aWSStringsDtor[i]==rFmtString) { |