diff options
author | Eike Rathke <er@openoffice.org> | 2001-06-12 14:06:00 +0000 |
---|---|---|
committer | Eike Rathke <er@openoffice.org> | 2001-06-12 14:06:00 +0000 |
commit | 9fbc124c9a9813e58c9d61622e147b7257cd1b1c (patch) | |
tree | 2f11acf9e80685e47e5d447664e66f24947efb39 /svx/source/dialog/langbox.cxx | |
parent | #87313#: added Base64 methods for graphic objects (diff) | |
download | core-9fbc124c9a9813e58c9d61622e147b7257cd1b1c.tar.gz core-9fbc124c9a9813e58c9d61622e147b7257cd1b1c.zip |
#87257# LANG_LIST_ONLY_KNOWN: without loop in loop
Diffstat (limited to 'svx/source/dialog/langbox.cxx')
-rw-r--r-- | svx/source/dialog/langbox.cxx | 73 |
1 files changed, 36 insertions, 37 deletions
diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx index 74ccb16fdd58..7f9bbab2b441 100644 --- a/svx/source/dialog/langbox.cxx +++ b/svx/source/dialog/langbox.cxx @@ -2,9 +2,9 @@ * * $RCSfile: langbox.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: er $ $Date: 2001-06-12 13:04:36 $ + * last change: $Author: er $ $Date: 2001-06-12 15:06:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -289,52 +289,51 @@ void SvxLanguageBox::SetLanguageList( INT16 nLangList, } } + SvxLanguageTable aLangTable; ::com::sun::star::uno::Sequence< sal_uInt16 > xKnown; + const sal_uInt16* pKnown; + USHORT nCount; if ( nLangList & LANG_LIST_ONLY_KNOWN ) + { xKnown = LocaleDataWrapper::getInstalledLanguageTypes(); - SvxLanguageTable aLangTable; - const USHORT nCount = aLangTable.GetEntryCount(); + pKnown = xKnown.getConstArray(); + nCount = (USHORT) xKnown.getLength(); + } + else + { + nCount = aLangTable.GetEntryCount(); + pKnown = NULL; + } for ( USHORT i = 0; i < nCount; i++ ) { - LanguageType nLangType = aLangTable.GetTypeAtIndex( i ); + LanguageType nLangType; + if ( nLangList & LANG_LIST_ONLY_KNOWN ) + nLangType = pKnown[i]; + else + nLangType = aLangTable.GetTypeAtIndex( i ); BOOL bInsert = FALSE; if ( nLangType != LANGUAGE_DONTKNOW && nLangType != LANGUAGE_SYSTEM && nLangType != LANGUAGE_NONE && !(LANGUAGE_USER1 <= nLangType && nLangType <= LANGUAGE_USER9) ) { - 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 && (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) |