diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2008-12-15 12:01:46 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2008-12-15 12:01:46 +0000 |
commit | a10ddaf8a9d8cf16aa219f72bcdba67df8f6b678 (patch) | |
tree | 1e1f4d8edb2a31c2930a090eb10b08a6cd5124ae /lingucomponent/source/lingutil/lingutil.cxx | |
parent | CWS-TOOLING: integrate CWS fwk92 (diff) | |
download | core-a10ddaf8a9d8cf16aa219f72bcdba67df8f6b678.tar.gz core-a10ddaf8a9d8cf16aa219f72bcdba67df8f6b678.zip |
CWS-TOOLING: integrate CWS tl56_DEV300
Diffstat (limited to 'lingucomponent/source/lingutil/lingutil.cxx')
-rw-r--r-- | lingucomponent/source/lingutil/lingutil.cxx | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/lingucomponent/source/lingutil/lingutil.cxx b/lingucomponent/source/lingutil/lingutil.cxx index 75e987e07c51..dcf61e351950 100644 --- a/lingucomponent/source/lingutil/lingutil.cxx +++ b/lingucomponent/source/lingutil/lingutil.cxx @@ -166,81 +166,10 @@ std::vector< SvtLinguConfigDictionaryEntry > GetOldStyleDics( const char *pDicTy if (aFormatName.getLength() == 0 || aDicExtension.Len() == 0) return aRes; - dictentry * pDict = NULL; // shared dict entry pointer - // set of languages to remember the language where it is already // decided to make use of the dictionary. std::set< LanguageType > aDicLangInUse; - const sal_Int16 USER_LAYER = 0; - for (int k = 0; k < 2; ++k) - { - // Search for 'dictionary.lst' file still in use. - // First look in the user paths for downloaded dictionaries then - // look in paths for shared installed dictionaries. - // In each path sequence there should be at most one 'dictionary.lst' be found... - const sal_Int16 nFlags = k == USER_LAYER ? PATH_FLAG_USER : PATH_FLAG_INTERNAL; - const uno::Sequence< ::rtl::OUString > aPaths( linguistic::GetLinguisticPaths( nFlags ) ); - - // invoke a dictionary manager to get the dictionary list - String aLstFile( String::CreateFromAscii("dictionary.lst") ); - aLstFile = linguistic::SearchFileInPaths( aLstFile, aPaths ); - rtl::OUString aLstFileURL; - osl::FileBase::getSystemPathFromFileURL( aLstFile, aLstFileURL ); - rtl::OString aSysPathToFile( OU2ENC( aLstFileURL, osl_getThreadTextEncoding() ) ); - DictMgr aDictMgr( aSysPathToFile.getStr(), pDicType ); - int nDicts = aDictMgr.get_list( &pDict ); - - // Test for existence of the actual dictionary files - // and remember the ones we like to use... - for (int i = 0; i < nDicts; ++i) - { - // Note: the 'dictionary.lst' file and the actual dictionary files - // need to reside in the very same directory!! - String aDicFileName( String::CreateFromAscii( pDict[i].filename ) ); - aDicFileName += aDicExtension; - aDicFileName = linguistic::SearchFileInPaths( aDicFileName, aPaths ); - - // file not found? - if (aDicFileName.Len() == 0) - continue; - - - // - // Now, since the dictionary does exist add it to the resulting vector. - // But don't make use of shared layer dictionaries if for the - // same language user layer dictionaries do exist. - // The user dictionaries must get precedence over shared layer - // (system installed dictionaries) in order to let the user have - // the choice. E.g. when he wants touse a newer version of a - // shared layer installed dictionary... - // - - // Thus we first get the language of the dictionary - LanguageType nLang = MsLangId::convertIsoNamesToLanguage( - A2OU( pDict[i].lang ), - A2OU( pDict[i].region ) ); - - // Don't add shared layer dictionary if there is already - // a user layer dictionary... - if (k == USER_LAYER || 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] = aDicFileName; - aDicEntry.aFormatName = aFormatName; - aDicEntry.aLocaleNames[0] = aLocaleName; - aRes.push_back( aDicEntry ); - } - } - } - #ifdef SYSTEM_DICTS osl::Directory aSystemDicts(aSystemDir); if (aSystemDicts.open() == osl::FileBase::E_None) |