diff options
author | Eike Rathke <er@openoffice.org> | 2001-06-12 12:04:36 +0000 |
---|---|---|
committer | Eike Rathke <er@openoffice.org> | 2001-06-12 12:04:36 +0000 |
commit | 306bb06f17988ad4b5c21a1a4e76255671d51766 (patch) | |
tree | 53093a3d02e7050e85a057095609e1d421133f7c /svx/source/dialog/langbox.cxx | |
parent | #87980# merge error corrected (diff) | |
download | core-306bb06f17988ad4b5c21a1a4e76255671d51766.tar.gz core-306bb06f17988ad4b5c21a1a4e76255671d51766.zip |
#87257# LANG_LIST_ONLY_KNOWN: list only locales provided by I18N framework
Diffstat (limited to 'svx/source/dialog/langbox.cxx')
-rw-r--r-- | svx/source/dialog/langbox.cxx | 60 |
1 files changed, 41 insertions, 19 deletions
diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx index c6606affdaa5..74ccb16fdd58 100644 --- a/svx/source/dialog/langbox.cxx +++ b/svx/source/dialog/langbox.cxx @@ -2,9 +2,9 @@ * * $RCSfile: langbox.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: os $ $Date: 2001-04-18 08:50:38 $ + * last change: $Author: er $ $Date: 2001-06-12 13:04:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -74,6 +74,10 @@ #include<rtl/ustring.hxx> #endif +#ifndef _UNOTOOLS_LOCALEDATAWRAPPER_HXX +#include <unotools/localedatawrapper.hxx> +#endif + #ifndef _SHL_HXX #include <tools/shl.hxx> #endif @@ -285,6 +289,9 @@ void SvxLanguageBox::SetLanguageList( INT16 nLangList, } } + ::com::sun::star::uno::Sequence< sal_uInt16 > xKnown; + if ( nLangList & LANG_LIST_ONLY_KNOWN ) + xKnown = LocaleDataWrapper::getInstalledLanguageTypes(); SvxLanguageTable aLangTable; const USHORT nCount = aLangTable.GetEntryCount(); for ( USHORT i = 0; i < nCount; i++ ) @@ -296,23 +303,38 @@ void SvxLanguageBox::SetLanguageList( INT16 nLangList, nLangType != LANGUAGE_NONE && !(LANGUAGE_USER1 <= nLangType && nLangType <= LANGUAGE_USER9) ) { - if (!bInsert && (nLangList & LANG_LIST_ALL)) - bInsert |= TRUE; - if (!bInsert && (nLangList & LANG_LIST_WESTERN)) - bInsert |= SCRIPTTYPE_LATIN == GetScriptTypeOfLanguage( nLangType ); - if (!bInsert && (nLangList & LANG_LIST_CTL)) - bInsert |= SCRIPTTYPE_COMPLEX == GetScriptTypeOfLanguage( nLangType ); - if (!bInsert && (nLangList & LANG_LIST_CJK)) - bInsert |= SCRIPTTYPE_ASIAN == GetScriptTypeOfLanguage( nLangType ); - if (!bInsert && (nLangList & LANG_LIST_FBD_CHARS)) - bInsert |= lcl_HasLanguage( aForbiddenCharLang, - nForbiddenCharLang, nLangType ); - if (!bInsert && (nLangList & LANG_LIST_SPELL_AVAIL)) - bInsert |= lcl_SeqHasLang( aSpellAvailLang, nLangType ); - if (!bInsert && (nLangList & LANG_LIST_HYPH_AVAIL)) - bInsert |= lcl_SeqHasLang( aHyphAvailLang, nLangType ); - if (!bInsert && (nLangList & LANG_LIST_THES_AVAIL)) - bInsert |= lcl_SeqHasLang( aThesAvailLang, nLangType ); + BOOL bDoList = TRUE; + if ( nLangList & LANG_LIST_ONLY_KNOWN ) + { + const sal_uInt16* pKnown = xKnown.getConstArray(); + for ( sal_Int32 j=0; j < xKnown.getLength(); ++j ) + { + if ( pKnown[j] == nLangType ) + break; // for + } + if ( j >= xKnown.getLength() ) + bDoList = FALSE; + } + if ( bDoList ) + { + if (!bInsert && (nLangList & LANG_LIST_ALL)) + bInsert |= TRUE; + if (!bInsert && (nLangList & LANG_LIST_WESTERN)) + bInsert |= SCRIPTTYPE_LATIN == GetScriptTypeOfLanguage( nLangType ); + if (!bInsert && (nLangList & LANG_LIST_CTL)) + bInsert |= SCRIPTTYPE_COMPLEX == GetScriptTypeOfLanguage( nLangType ); + if (!bInsert && (nLangList & LANG_LIST_CJK)) + bInsert |= SCRIPTTYPE_ASIAN == GetScriptTypeOfLanguage( nLangType ); + if (!bInsert && (nLangList & LANG_LIST_FBD_CHARS)) + bInsert |= lcl_HasLanguage( aForbiddenCharLang, + nForbiddenCharLang, nLangType ); + if (!bInsert && (nLangList & LANG_LIST_SPELL_AVAIL)) + bInsert |= lcl_SeqHasLang( aSpellAvailLang, nLangType ); + if (!bInsert && (nLangList & LANG_LIST_HYPH_AVAIL)) + bInsert |= lcl_SeqHasLang( aHyphAvailLang, nLangType ); + if (!bInsert && (nLangList & LANG_LIST_THES_AVAIL)) + bInsert |= lcl_SeqHasLang( aThesAvailLang, nLangType ); + } } if (bInsert) |