[Libreoffice-commits] .: svl/inc svl/source
Nigel Hawkins
nhawkins at kemper.freedesktop.org
Tue Aug 9 07:31:22 PDT 2011
svl/inc/svl/zforlist.hxx | 3 +--
svl/source/numbers/zforlist.cxx | 13 ++++++-------
2 files changed, 7 insertions(+), 9 deletions(-)
New commits:
commit b3a2205527b969128438bec50531e57c2efe9a32
Author: Nigel Hawkins <n.hawkins at gmx.com>
Date: Tue Aug 9 15:29:47 2011 +0100
Replace SvUShorts with vector in svl/zforlist.[ch]xx
LGPLv3+/MPL1.1
diff --git a/svl/inc/svl/zforlist.hxx b/svl/inc/svl/zforlist.hxx
index 4b0441c..60f42ba 100644
--- a/svl/inc/svl/zforlist.hxx
+++ b/svl/inc/svl/zforlist.hxx
@@ -47,7 +47,6 @@
class Date;
class SvStream;
class Color;
-class SvUShorts;
class CharClass;
class CalendarWrapper;
@@ -791,7 +790,7 @@ public:
void GetCompatibilityCurrency( String& rSymbol, String& rAbbrev ) const;
/// Fill rList with the language/country codes that have been allocated
- void GetUsedLanguages( SvUShorts& rList );
+ void GetUsedLanguages( std::vector<sal_uInt16>& rList );
/// Fill a <type>NfKeywordIndex</type> table with keywords of a language/country
void FillKeywordTable( NfKeywordTable& rKeywords, LanguageType eLang );
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index bb12e31..8a9a3d5 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -886,12 +886,11 @@ sal_Bool SvNumberFormatter::Load( SvStream& rStream )
// generate additional i18n standard formats for all used locales
LanguageType eOldLanguage = ActLnge;
NumberFormatCodeWrapper aNumberFormatCode( xServiceManager, GetLocale() );
- SvUShorts aList;
+ std::vector<sal_uInt16> aList;
GetUsedLanguages( aList );
- sal_uInt16 nCount = aList.Count();
- for ( sal_uInt16 j=0; j<nCount; j++ )
+ for ( std::vector<sal_uInt16>::const_iterator it(aList.begin()); it != aList.end(); ++it )
{
- LanguageType eLang = aList[j];
+ LanguageType eLang = *it;
ChangeIntl( eLang );
sal_uInt32 CLOffset = ImpGetCLOffset( eLang );
ImpGenerateAdditionalFormats( CLOffset, aNumberFormatCode, sal_True );
@@ -941,16 +940,16 @@ sal_Bool SvNumberFormatter::Save( SvStream& rStream ) const
return sal_True;
}
-void SvNumberFormatter::GetUsedLanguages( SvUShorts& rList )
+void SvNumberFormatter::GetUsedLanguages( std::vector<sal_uInt16>& rList )
{
- rList.Remove( 0, rList.Count() );
+ rList.clear();
sal_uInt32 nOffset = 0;
while (nOffset <= MaxCLOffset)
{
SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(nOffset);
if (pFormat)
- rList.Insert( pFormat->GetLanguage(), rList.Count() );
+ rList.push_back( pFormat->GetLanguage() );
nOffset += SV_COUNTRY_LANGUAGE_OFFSET;
}
}
More information about the Libreoffice-commits
mailing list