diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2008-11-10 15:06:12 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2008-11-10 15:06:12 +0000 |
commit | 57573ad5adbf1a6bb520c1c557684d06211ca7cc (patch) | |
tree | 1716c37d6537f74bf47a1b5b42af93bf0a4277b2 /lingucomponent/source/lingutil/lingutil.cxx | |
parent | CWS-TOOLING: integrate CWS native201_DEV300 (diff) | |
download | core-57573ad5adbf1a6bb520c1c557684d06211ca7cc.tar.gz core-57573ad5adbf1a6bb520c1c557684d06211ca7cc.zip |
CWS-TOOLING: integrate CWS cmcfixes50
2008-11-10 13:31:50 +0100 cmc r263517 : gio doesn't do anything useful for remote stuff wrt info
2008-11-06 00:11:47 +0100 cmc r263359 : #i93436# pile of other 64bit new gcc warnings
2008-11-05 00:39:03 +0100 cmc r263340 : i95856 let a ppc64 vanilla build succeed
2008-11-04 14:00:25 +0100 cmc r263320 : #i93436# useless const
2008-11-04 11:53:10 +0100 cmc r263314 : #i93436# ambiguous
2008-11-04 11:48:05 +0100 cmc r263313 : #i93436# add some braces
2008-11-04 11:29:24 +0100 cmc r263312 : #i93436# ambiguous
2008-11-04 10:53:46 +0100 cmc r263311 :
Diffstat (limited to 'lingucomponent/source/lingutil/lingutil.cxx')
-rw-r--r-- | lingucomponent/source/lingutil/lingutil.cxx | 63 |
1 files changed, 35 insertions, 28 deletions
diff --git a/lingucomponent/source/lingutil/lingutil.cxx b/lingucomponent/source/lingutil/lingutil.cxx index 826e9bde2c80..75e987e07c51 100644 --- a/lingucomponent/source/lingutil/lingutil.cxx +++ b/lingucomponent/source/lingutil/lingutil.cxx @@ -254,36 +254,39 @@ std::vector< SvtLinguConfigDictionaryEntry > GetOldStyleDics( const char *pDicTy if (sPath.lastIndexOf(aSystemSuffix) == sPath.getLength()-aSystemSuffix.getLength()) { sal_Int32 nStartIndex = sPath.lastIndexOf(sal_Unicode('/')) + 1; - if (!sPath.match(aSystemPrefix, nStartIndex)) - continue; + if (!sPath.match(aSystemPrefix, nStartIndex)) + continue; + rtl::OUString sChunk = sPath.copy(0, sPath.getLength() - aSystemSuffix.getLength()); sal_Int32 nIndex = nStartIndex + aSystemPrefix.getLength(); - rtl::OUString sLang = sPath.getToken( 0, '_', nIndex ); - rtl::OUString sRegion = sPath.copy( nIndex, sPath.getLength() - nIndex - aSystemSuffix.getLength()); - if (!sLang.getLength() || !sRegion.getLength()) - continue; - - // Thus we first get the language of the dictionary - LanguageType nLang = MsLangId::convertIsoNamesToLanguage( + rtl::OUString sLang = sChunk.getToken( 0, '_', nIndex ); + if (!sLang.getLength()) + continue; + rtl::OUString sRegion; + if (nIndex != -1); + sRegion = sChunk.copy( nIndex, sChunk.getLength() - nIndex ); + + // Thus we first get the language of the dictionary + LanguageType nLang = MsLangId::convertIsoNamesToLanguage( sLang, sRegion ); - if (aDicLangInUse.count( nLang ) == 0) - { - // remember the new language in use - aDicLangInUse.insert( nLang ); - - // add the dictionary to the resulting vector - SvtLinguConfigDictionaryEntry aDicEntry; - aDicEntry.aLocations.realloc(1); - aDicEntry.aLocaleNames.realloc(1); - rtl::OUString aLocaleName( MsLangId::convertLanguageToIsoString( nLang ) ); - aDicEntry.aLocations[0] = sPath; - aDicEntry.aFormatName = aFormatName; - aDicEntry.aLocaleNames[0] = aLocaleName; - aRes.push_back( aDicEntry ); - } + if (aDicLangInUse.count( nLang ) == 0) + { + // remember the new language in use + aDicLangInUse.insert( nLang ); + + // add the dictionary to the resulting vector + SvtLinguConfigDictionaryEntry aDicEntry; + aDicEntry.aLocations.realloc(1); + aDicEntry.aLocaleNames.realloc(1); + rtl::OUString aLocaleName( MsLangId::convertLanguageToIsoString( nLang ) ); + aDicEntry.aLocations[0] = sPath; + aDicEntry.aFormatName = aFormatName; + aDicEntry.aLocaleNames[0] = aLocaleName; + aRes.push_back( aDicEntry ); + } } } - } + } #endif @@ -317,16 +320,20 @@ void MergeNewStyleDicsAndOldStyleDics( sal_Int32 nOldStyleDics = aIt2->aLocaleNames.getLength(); // old style dics should only have one language listed... - DBG_ASSERT( nOldStyleDics, "old style dictionary with more then one language found!") + DBG_ASSERT( nOldStyleDics, "old style dictionary with more then one language found!"); if (nOldStyleDics > 0) { LanguageType nLang = MsLangId::convertIsoStringToLanguage( aIt2->aLocaleNames[0] ); + if (nLang == LANGUAGE_DONTKNOW || nLang == LANGUAGE_NONE) + { + DBG_ERROR( "old style dictionary with invalid language found!" ); + continue; + } + // language not yet added? if (aNewStyleLanguages.count( nLang ) == 0) - { rNewStyleDics.push_back( *aIt2 ); - } } else { |