diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-01-06 12:54:16 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-01-06 12:54:16 +0000 |
commit | 13e27b36a954d5dac7e1b35e3752656050074c1d (patch) | |
tree | abca998c0e49dc9ba9891e6da3a3e9254bdd00a9 /svx/source/dialog/langbox.cxx | |
parent | CWS-TOOLING: integrate CWS ooxml02 (diff) | |
download | core-13e27b36a954d5dac7e1b35e3752656050074c1d.tar.gz core-13e27b36a954d5dac7e1b35e3752656050074c1d.zip |
CWS-TOOLING: integrate CWS locales31
2008-12-10 14:56:44 +0100 er r265193 : calling convention mismatch
2008-12-08 12:04:56 +0100 er r264984 : #i96840# classify some extra languages as CTL
2008-12-05 19:54:02 +0100 erack r264916 : ImpSvNumberformatScan::ScanType: do not miscategorize as automtic currency if currency symbol in General string, such as R in Standard
2008-12-04 12:07:05 +0100 erack r264831 : CWS-TOOLING: rebase CWS locales31 to trunk@264807 (milestone: DEV300:m37)
2008-12-03 16:14:17 +0100 erack r264797 : #i93694# update script+language -> unicode digit mapping; patch from <hdu>
2008-11-25 02:01:18 +0100 erack r264270 : #i83349# apply remaining parts of the patch, now that we use ICU 4.0; contributed by <kstribley>
2008-11-25 01:38:20 +0100 erack r264269 : #i93694# test the bit, not the constant ...
2008-11-24 10:34:58 +0100 erack r264211 : #i93694# LANGUAGE_ARABIC is gone
2008-11-24 01:39:25 +0100 erack r264192 : #i94435# LANGUAGE_SPANISH now is an alias of LANGUAGE_SPANISH_MODERN, need LANGUAGE_SPANISH_DATED in switch case if both are to be used
2008-11-23 22:54:17 +0100 erack r264190 : CWS-TOOLING: rebase CWS locales31 to trunk@263288 (milestone: DEV300:m35)
2008-11-23 20:23:28 +0100 erack r264189 : migrate CWS locales31 to SVN
Diffstat (limited to 'svx/source/dialog/langbox.cxx')
-rw-r--r-- | svx/source/dialog/langbox.cxx | 49 |
1 files changed, 40 insertions, 9 deletions
diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx index 1f2892980995..b5c71c19c36b 100644 --- a/svx/source/dialog/langbox.cxx +++ b/svx/source/dialog/langbox.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: langbox.cxx,v $ - * $Revision: 1.25 $ + * $Revision: 1.25.132.2 $ * * This file is part of OpenOffice.org. * @@ -277,6 +277,8 @@ void SvxLanguageBox::SetLanguageList( INT16 nLangList, nLangType != LANGUAGE_SYSTEM && nLangType != LANGUAGE_NONE && (nLangType < LANGUAGE_USER1 || nLangType > LANGUAGE_USER9) && + (MsLangId::getSubLanguage( nLangType) != 0 || + (nLangList & LANG_LIST_ALSO_PRIMARY_ONLY)) && ((nLangList & LANG_LIST_ALL) != 0 || ((nLangList & LANG_LIST_WESTERN) != 0 && (SvtLanguageOptions::GetScriptTypeOfLanguage(nLangType) == @@ -313,8 +315,19 @@ void SvxLanguageBox::SetLanguageList( INT16 nLangList, USHORT SvxLanguageBox::InsertLanguage( const LanguageType nLangType, USHORT nPos ) { - String aStrEntry = m_pLangTable->GetString( nLangType ); - if (LANGUAGE_NONE == nLangType && m_bHasLangNone && m_bLangNoneIsLangAll) + LanguageType nLang = MsLangId::getReplacementForObsoleteLanguage( nLangType); + // For obsolete and to be replaced languages check whether an entry of the + // replacement already exists and if so don't add an entry with identical + // string as would be returned by SvtLanguageTable::GetString(). + if (nLang != nLangType) + { + USHORT nAt = TypeToPos_Impl( nLang, *this ); + if ( nAt != LISTBOX_ENTRY_NOTFOUND ) + return nAt; + } + + String aStrEntry = m_pLangTable->GetString( nLang ); + if (LANGUAGE_NONE == nLang && m_bHasLangNone && m_bLangNoneIsLangAll) aStrEntry = m_aAllString; USHORT nAt = 0; @@ -329,7 +342,7 @@ USHORT SvxLanguageBox::InsertLanguage( const LanguageType nLangType, USHORT nPos m_pSpellUsedLang = new Sequence< INT16 >( xSpell->getLanguages() ); } bFound = m_pSpellUsedLang ? - lcl_SeqHasLang( *m_pSpellUsedLang, nLangType ) : FALSE; + lcl_SeqHasLang( *m_pSpellUsedLang, nLang ) : FALSE; nAt = ImplInsertImgEntry( aStrEntry, nPos, bFound ); } @@ -345,12 +358,23 @@ USHORT SvxLanguageBox::InsertLanguage( const LanguageType nLangType, USHORT nPos USHORT SvxLanguageBox::InsertLanguage( const LanguageType nLangType, BOOL bCheckEntry, USHORT nPos ) { - String aStrEntry = m_pLangTable->GetString( nLangType ); - if (LANGUAGE_NONE == nLangType && m_bHasLangNone && m_bLangNoneIsLangAll) + LanguageType nLang = MsLangId::getReplacementForObsoleteLanguage( nLangType); + // For obsolete and to be replaced languages check whether an entry of the + // replacement already exists and if so don't add an entry with identical + // string as would be returned by SvtLanguageTable::GetString(). + if (nLang != nLangType) + { + USHORT nAt = TypeToPos_Impl( nLang, *this ); + if ( nAt != LISTBOX_ENTRY_NOTFOUND ) + return nAt; + } + + String aStrEntry = m_pLangTable->GetString( nLang ); + if (LANGUAGE_NONE == nLang && m_bHasLangNone && m_bLangNoneIsLangAll) aStrEntry = m_aAllString; USHORT nAt = ImplInsertImgEntry( aStrEntry, nPos, bCheckEntry ); - SetEntryData( nAt, (void*)(ULONG)nLangType ); + SetEntryData( nAt, (void*)(ULONG)nLang ); return nAt; } @@ -381,7 +405,11 @@ LanguageType SvxLanguageBox::GetSelectLanguage() const void SvxLanguageBox::SelectLanguage( const LanguageType eLangType, BOOL bSelect ) { - USHORT nAt = TypeToPos_Impl( eLangType, *this ); + // If the core uses a LangID of an imported MS document and wants to select + // a language that is replaced, we need to select the replacement instead. + LanguageType nLang = MsLangId::getReplacementForObsoleteLanguage( eLangType); + + USHORT nAt = TypeToPos_Impl( nLang, *this ); if ( nAt != LISTBOX_ENTRY_NOTFOUND ) SelectEntryPos( nAt, bSelect ); @@ -391,7 +419,10 @@ void SvxLanguageBox::SelectLanguage( const LanguageType eLangType, BOOL bSelect BOOL SvxLanguageBox::IsLanguageSelected( const LanguageType eLangType ) const { - USHORT nAt = TypeToPos_Impl( eLangType, *this ); + // Same here, work on the replacement if applicable. + LanguageType nLang = MsLangId::getReplacementForObsoleteLanguage( eLangType); + + USHORT nAt = TypeToPos_Impl( nLang, *this ); if ( nAt != LISTBOX_ENTRY_NOTFOUND ) return IsEntryPosSelected( nAt ); |