resolved fdo#67444 don't push_back() with already reserved size

Change-Id: I5660bdf07ad0adae053508bed1805369850c1134
This commit is contained in:
Eike Rathke
2013-08-07 11:20:59 +02:00
parent 18767fd249
commit 6b2aaa7d23
2 changed files with 6 additions and 4 deletions

View File

@@ -687,10 +687,11 @@ LocaleItem* StringResourceImpl::getClosestMatchItemForLocale( const Locale& loca
LocaleItem* pRetItem = NULL;
::std::vector< Locale > aLocales( m_aLocaleItemVector.size());
for( LocaleItemVectorConstIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it )
size_t i = 0;
for( LocaleItemVectorConstIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it, ++i )
{
LocaleItem* pLocaleItem = *it;
aLocales.push_back( pLocaleItem ? pLocaleItem->m_locale : Locale());
aLocales[i] = (pLocaleItem ? pLocaleItem->m_locale : Locale());
}
::std::vector< Locale >::const_iterator iFound( LanguageTag::getMatchingFallback( aLocales, locale));
if (iFound != aLocales.end())