[Libreoffice-commits] core.git: i18nlangtag/source scripting/source
Eike Rathke
erack at redhat.com
Wed Aug 7 03:03:31 PDT 2013
i18nlangtag/source/languagetag/languagetag.cxx | 5 +++--
scripting/source/stringresource/stringresource.cxx | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
New commits:
commit 6b2aaa7d2393db7c5df9ed3e695013b1e44d868f
Author: Eike Rathke <erack at redhat.com>
Date: Wed Aug 7 11:20:59 2013 +0200
resolved fdo#67444 don't push_back() with already reserved size
Change-Id: I5660bdf07ad0adae053508bed1805369850c1134
diff --git a/i18nlangtag/source/languagetag/languagetag.cxx b/i18nlangtag/source/languagetag/languagetag.cxx
index d35f82f..e438035 100644
--- a/i18nlangtag/source/languagetag/languagetag.cxx
+++ b/i18nlangtag/source/languagetag/languagetag.cxx
@@ -1336,10 +1336,11 @@ LanguageTag::Extraction LanguageTag::simpleExtract( const OUString& rBcp47,
::std::vector< OUString > aFallbacks( LanguageTag( rReference).getFallbackStrings());
aFallbacks.erase( aFallbacks.begin()); // first is full BCP47, we already checked that
::std::vector< ::std::vector< OUString > > aListFallbacks( rList.size());
- for (it = rList.begin(); it != rList.end(); ++it)
+ size_t i = 0;
+ for (it = rList.begin(); it != rList.end(); ++it, ++i)
{
::std::vector< OUString > aTmp( LanguageTag( *it).getFallbackStrings());
- aListFallbacks.push_back( aTmp);
+ aListFallbacks[i] = aTmp;
}
for (::std::vector< OUString >::const_iterator rfb( aFallbacks.begin()); rfb != aFallbacks.end(); ++rfb)
{
diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx
index 7a80699..253d77b 100644
--- a/scripting/source/stringresource/stringresource.cxx
+++ b/scripting/source/stringresource/stringresource.cxx
@@ -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())
More information about the Libreoffice-commits
mailing list