summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/svx/langbox.hxx2
-rw-r--r--svx/source/cui/optgdlg.cxx74
-rw-r--r--svx/source/cui/optgdlg.src46
-rw-r--r--svx/source/dialog/langbox.cxx28
4 files changed, 105 insertions, 45 deletions
diff --git a/svx/inc/svx/langbox.hxx b/svx/inc/svx/langbox.hxx
index 888640fd6e..a99d4eb418 100644
--- a/svx/inc/svx/langbox.hxx
+++ b/svx/inc/svx/langbox.hxx
@@ -78,6 +78,7 @@ private:
SVX_DLLPRIVATE void Init();
SVX_DLLPRIVATE USHORT ImplInsertImgEntry( const String& rEntry, USHORT nPos, bool bChecked );
+ SVX_DLLPRIVATE USHORT ImplInsertLanguage(LanguageType, USHORT, sal_Int16 );
public:
SvxLanguageBox( Window* pParent, WinBits nWinStyle, BOOL bCheck = FALSE);
@@ -89,6 +90,7 @@ public:
BOOL bCheckSpellAvail = FALSE );
USHORT InsertLanguage( const LanguageType eLangType, USHORT nPos = LISTBOX_APPEND );
+ USHORT InsertDefaultLanguage( sal_Int16 nType, USHORT nPos = LISTBOX_APPEND );
USHORT InsertLanguage( const LanguageType eLangType,
BOOL bCheckEntry, USHORT nPos = LISTBOX_APPEND );
void RemoveLanguage( const LanguageType eLangType );
diff --git a/svx/source/cui/optgdlg.cxx b/svx/source/cui/optgdlg.cxx
index ba9219e018..12910c0302 100644
--- a/svx/source/cui/optgdlg.cxx
+++ b/svx/source/cui/optgdlg.cxx
@@ -103,6 +103,7 @@
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
#include <com/sun/star/container/XSet.hpp>
+#include <com/sun/star/i18n/ScriptType.hpp>
#include <vcl/svapp.hxx>
@@ -1277,8 +1278,13 @@ OfaLanguagesTabPage::OfaLanguagesTabPage( Window* pParent, const SfxItemSet& rSe
// initialize user interface language selection
SvtLanguageTable* pLanguageTable = new SvtLanguageTable;
- String aStr( pLanguageTable->GetString( LANGUAGE_SYSTEM ) );
- aUserInterfaceLB.InsertEntry(aStr);
+ const String aStr( pLanguageTable->GetString( LANGUAGE_SYSTEM ) );
+
+ String aUILang(aStr);
+ aUILang += String::CreateFromAscii(" - ");
+ aUILang += pLanguageTable->GetString( Application::GetSettings().GetUILanguage() );
+
+ aUserInterfaceLB.InsertEntry(aUILang);
aUserInterfaceLB.SetEntryData(0, 0);
aUserInterfaceLB.SelectEntryPos(0);
try
@@ -1340,16 +1346,24 @@ OfaLanguagesTabPage::OfaLanguagesTabPage( Window* pParent, const SfxItemSet& rSe
}
aWesternLanguageLB.SetLanguageList( LANG_LIST_WESTERN | LANG_LIST_ONLY_KNOWN, TRUE, FALSE, TRUE );
- aAsianLanguageLB .SetLanguageList( LANG_LIST_CJK | LANG_LIST_ONLY_KNOWN, TRUE, FALSE, TRUE );
+ aWesternLanguageLB.InsertDefaultLanguage( ::com::sun::star::i18n::ScriptType::LATIN );
+ aAsianLanguageLB.SetLanguageList( LANG_LIST_CJK | LANG_LIST_ONLY_KNOWN, TRUE, FALSE, TRUE );
+ aAsianLanguageLB.InsertDefaultLanguage( ::com::sun::star::i18n::ScriptType::ASIAN );
aComplexLanguageLB.SetLanguageList( LANG_LIST_CTL | LANG_LIST_ONLY_KNOWN, TRUE, FALSE, TRUE );
- aLocaleSettingLB .SetLanguageList( LANG_LIST_ALL | LANG_LIST_ONLY_KNOWN, FALSE, FALSE, FALSE);
- aLocaleSettingLB.InsertLanguage( LANGUAGE_SYSTEM );
+ aComplexLanguageLB.InsertDefaultLanguage( ::com::sun::star::i18n::ScriptType::COMPLEX );
- // insert SYSTEM entry, no specific currency
- aCurrencyLB.InsertEntry( aStr );
+ aLocaleSettingLB.SetLanguageList( LANG_LIST_ALL | LANG_LIST_ONLY_KNOWN, FALSE, FALSE, FALSE);
+ aLocaleSettingLB.InsertDefaultLanguage( ::com::sun::star::i18n::ScriptType::WEAK );
+
+ const NfCurrencyTable& rCurrTab = SvNumberFormatter::GetTheCurrencyTable();
+ const NfCurrencyEntry& rCurr = SvNumberFormatter::GetCurrencyEntry( LANGUAGE_SYSTEM );
+ // insert SYSTEM entry
+ String aDefaultCurr(aStr);
+ aDefaultCurr += String::CreateFromAscii(" - ");
+ aDefaultCurr += rCurr.GetBankSymbol();
+ aCurrencyLB.InsertEntry( aDefaultCurr );
// all currencies
String aTwoSpace( RTL_CONSTASCII_USTRINGPARAM( " " ) );
- const NfCurrencyTable& rCurrTab = SvNumberFormatter::GetTheCurrencyTable();
USHORT nCurrCount = rCurrTab.Count();
// first entry is SYSTEM, skip it
for ( USHORT j=1; j < nCurrCount; ++j )
@@ -1572,7 +1586,7 @@ BOOL OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
if(!bCurrentDocCBChecked)
{
Any aValue;
- Locale aLocale = SvxCreateLocale( eSelectLang );
+ Locale aLocale = MsLangId::convertLanguageToLocale( eSelectLang, false );
aValue <<= aLocale;
OUString aPropName( C2U("DefaultLocale") );
pLangConfig->aLinguConfig.SetProperty( aPropName, aValue );
@@ -1581,7 +1595,8 @@ BOOL OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
}
if(pCurrentDocShell)
{
- rSet.Put(SvxLanguageItem(eSelectLang, SID_ATTR_LANGUAGE));
+ rSet.Put(SvxLanguageItem(MsLangId::resolveSystemLanguageByScriptType(eSelectLang, ::com::sun::star::i18n::ScriptType::LATIN),
+ SID_ATTR_LANGUAGE));
bRet = TRUE;
}
}
@@ -1592,7 +1607,7 @@ BOOL OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
if(!bCurrentDocCBChecked)
{
Any aValue;
- Locale aLocale = SvxCreateLocale( eSelectLang );
+ Locale aLocale = MsLangId::convertLanguageToLocale( eSelectLang, false );
aValue <<= aLocale;
OUString aPropName( C2U("DefaultLocale_CJK") );
pLangConfig->aLinguConfig.SetProperty( aPropName, aValue );
@@ -1601,7 +1616,8 @@ BOOL OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
}
if(pCurrentDocShell)
{
- rSet.Put(SvxLanguageItem(eSelectLang, SID_ATTR_CHAR_CJK_LANGUAGE));
+ rSet.Put(SvxLanguageItem(MsLangId::resolveSystemLanguageByScriptType(eSelectLang, ::com::sun::star::i18n::ScriptType::ASIAN),
+ SID_ATTR_CHAR_CJK_LANGUAGE));
bRet = TRUE;
}
}
@@ -1612,7 +1628,7 @@ BOOL OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
if(!bCurrentDocCBChecked)
{
Any aValue;
- Locale aLocale = SvxCreateLocale( eSelectLang );
+ Locale aLocale = MsLangId::convertLanguageToLocale( eSelectLang, false );
aValue <<= aLocale;
OUString aPropName( C2U("DefaultLocale_CTL") );
pLangConfig->aLinguConfig.SetProperty( aPropName, aValue );
@@ -1621,7 +1637,8 @@ BOOL OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
}
if(pCurrentDocShell)
{
- rSet.Put(SvxLanguageItem(eSelectLang, SID_ATTR_CHAR_CTL_LANGUAGE));
+ rSet.Put(SvxLanguageItem(MsLangId::resolveSystemLanguageByScriptType(eSelectLang, ::com::sun::star::i18n::ScriptType::COMPLEX),
+ SID_ATTR_CHAR_CTL_LANGUAGE));
bRet = TRUE;
}
}
@@ -1721,13 +1738,18 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet& rSet )
aWestLang = pLangConfig->aLinguConfig.GetProperty(C2U("DefaultLocale"));
Locale aLocale;
aWestLang >>= aLocale;
- eCurLang = SvxLocaleToLanguage( aLocale );
+
+ eCurLang = MsLangId::convertLocaleToLanguage( aLocale );
+
aCJKLang = pLangConfig->aLinguConfig.GetProperty(C2U("DefaultLocale_CJK"));
+ aLocale = Locale();
aCJKLang >>= aLocale;
- eCurLangCJK = SvxLocaleToLanguage( aLocale );
+ eCurLangCJK = MsLangId::convertLocaleToLanguage( aLocale );
+
aCTLLang = pLangConfig->aLinguConfig.GetProperty(C2U("DefaultLocale_CTL"));
+ aLocale = Locale();
aCTLLang >>= aLocale;
- eCurLangCTL = SvxLocaleToLanguage( aLocale );
+ eCurLangCTL = MsLangId::convertLocaleToLanguage( aLocale );
}
catch(Exception&)
{
@@ -1739,13 +1761,25 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet& rSet )
aCurrentDocCB.Check(bLanguageCurrentDoc_Impl);
const SfxPoolItem* pLang;
if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_LANGUAGE, FALSE, &pLang))
- eCurLang = ((const SvxLanguageItem*)pLang)->GetValue();
+ {
+ LanguageType eTempCurLang = ((const SvxLanguageItem*)pLang)->GetValue();
+ if (MsLangId::resolveSystemLanguageByScriptType(eCurLang, ::com::sun::star::i18n::ScriptType::LATIN) != eTempCurLang)
+ eCurLang = eTempCurLang;
+ }
if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_CHAR_CJK_LANGUAGE, FALSE, &pLang))
- eCurLangCJK = ((const SvxLanguageItem*)pLang)->GetValue();
+ {
+ LanguageType eTempCurLang = ((const SvxLanguageItem*)pLang)->GetValue();
+ if (MsLangId::resolveSystemLanguageByScriptType(eCurLangCJK, ::com::sun::star::i18n::ScriptType::ASIAN) != eTempCurLang)
+ eCurLangCJK = eTempCurLang;
+ }
if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_CHAR_CTL_LANGUAGE, FALSE, &pLang))
- eCurLangCTL = ((const SvxLanguageItem*)pLang)->GetValue();
+ {
+ LanguageType eTempCurLang = ((const SvxLanguageItem*)pLang)->GetValue();
+ if (MsLangId::resolveSystemLanguageByScriptType(eCurLangCTL, ::com::sun::star::i18n::ScriptType::COMPLEX) != eTempCurLang)
+ eCurLangCTL = eTempCurLang;
+ }
}
if(LANGUAGE_NONE == eCurLang || LANGUAGE_DONTKNOW == eCurLang)
aWesternLanguageLB.SelectLanguage(LANGUAGE_NONE);
diff --git a/svx/source/cui/optgdlg.src b/svx/source/cui/optgdlg.src
index a711be6bf0..f663a7ed44 100644
--- a/svx/source/cui/optgdlg.src
+++ b/svx/source/cui/optgdlg.src
@@ -460,13 +460,13 @@ TabPage OFA_TP_LANGUAGES
FixedText FT_USERINTERFACE
{
Pos = MAP_APPFONT ( 12 , 16 ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
+ Size = MAP_APPFONT ( 108 , 8 ) ;
Text [ en-US ] = "~User interface";
};
ListBox LB_USERINTERFACE
{
- Pos = MAP_APPFONT ( 135 , 14 ) ;
- Size = MAP_APPFONT ( 113 , 60 ) ;
+ Pos = MAP_APPFONT ( 123 , 14 ) ;
+ Size = MAP_APPFONT ( 125 , 60 ) ;
DropDown = TRUE ;
Border = TRUE ;
TabStop = TRUE ;
@@ -481,13 +481,13 @@ TabPage OFA_TP_LANGUAGES
FixedText FT_LOCALESETTING
{
Pos = MAP_APPFONT ( 12 , 31 ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
+ Size = MAP_APPFONT ( 108 , 8 ) ;
Text [ en-US ] = "Locale setting";
};
ListBox LB_LOCALESETTING
{
- Pos = MAP_APPFONT ( 135 , 30 ) ;
- Size = MAP_APPFONT ( 113 , 60 ) ;
+ Pos = MAP_APPFONT ( 123 , 30 ) ;
+ Size = MAP_APPFONT ( 125 , 60 ) ;
DropDown = TRUE ;
Border = TRUE ;
TabStop = TRUE ;
@@ -496,13 +496,13 @@ TabPage OFA_TP_LANGUAGES
FixedText FT_DECIMALSEPARATOR
{
Pos = MAP_APPFONT ( 12 , 46 ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
+ Size = MAP_APPFONT ( 108 , 8 ) ;
Text [ en-US ] = "Decimal separator key";
};
CheckBox CB_DECIMALSEPARATOR
{
- Pos = MAP_APPFONT ( 135 , 46) ;
- Size = MAP_APPFONT ( 119 , RSC_CD_CHECKBOX_HEIGHT ) ;
+ Pos = MAP_APPFONT ( 123 , 46) ;
+ Size = MAP_APPFONT ( 125 , RSC_CD_CHECKBOX_HEIGHT ) ;
Text [ en-US ] = "~Same as locale setting ( %1 )";
};
FixedImage FI_CURRENCY
@@ -514,13 +514,13 @@ TabPage OFA_TP_LANGUAGES
FixedText FT_CURRENCY
{
Pos = MAP_APPFONT ( 12 , 61 ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
+ Size = MAP_APPFONT ( 108 , 8 ) ;
Text [ en-US ] = "~Default currency";
};
ListBox LB_CURRENCY
{
- Pos = MAP_APPFONT ( 135 , 59 ) ;
- Size = MAP_APPFONT ( 113 , 60 ) ;
+ Pos = MAP_APPFONT ( 123 , 59 ) ;
+ Size = MAP_APPFONT ( 125 , 60 ) ;
DropDown = TRUE ;
Border = TRUE ;
TabStop = TRUE ;
@@ -541,14 +541,14 @@ TabPage OFA_TP_LANGUAGES
FixedText FT_WEST_LANG
{
Pos = MAP_APPFONT ( 12 , 90 ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
+ Size = MAP_APPFONT ( 108 , 8 ) ;
Text [ en-US ] = "Western";
};
ListBox LB_WEST_LANG
{
- Pos = MAP_APPFONT ( 135 , 88 ) ;
- Size = MAP_APPFONT ( 113 , 60 ) ;
+ Pos = MAP_APPFONT ( 123 , 88 ) ;
+ Size = MAP_APPFONT ( 125 , 60 ) ;
DropDown = TRUE ;
Border = TRUE ;
TabStop = TRUE ;
@@ -563,13 +563,13 @@ TabPage OFA_TP_LANGUAGES
FixedText FT_ASIAN_LANG
{
Pos = MAP_APPFONT ( 12 , 106 ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
+ Size = MAP_APPFONT ( 108 , 8 ) ;
Text [ en-US ] = "Asian";
};
ListBox LB_ASIAN_LANG
{
- Pos = MAP_APPFONT ( 135 , 104 ) ;
- Size = MAP_APPFONT ( 113 , 60 ) ;
+ Pos = MAP_APPFONT ( 123 , 104 ) ;
+ Size = MAP_APPFONT ( 125 , 60 ) ;
DropDown = TRUE ;
Border = TRUE ;
TabStop = TRUE ;
@@ -584,13 +584,13 @@ TabPage OFA_TP_LANGUAGES
FixedText FT_COMPLEX_LANG
{
Pos = MAP_APPFONT ( 12 , 122 ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
+ Size = MAP_APPFONT ( 108 , 8 ) ;
Text [ en-US ] = "C~TL";
};
ListBox LB_COMPLEX_LANG
{
- Pos = MAP_APPFONT ( 135 , 120 ) ;
- Size = MAP_APPFONT ( 113 , 60 ) ;
+ Pos = MAP_APPFONT ( 123 , 120 ) ;
+ Size = MAP_APPFONT ( 125 , 60 ) ;
DropDown = TRUE ;
Border = TRUE ;
TabStop = TRUE ;
@@ -598,8 +598,8 @@ TabPage OFA_TP_LANGUAGES
};
CheckBox CB_CURRENT_DOC
{
- Pos = MAP_APPFONT ( 135 , 135 ) ;
- Size = MAP_APPFONT ( 113 , RSC_CD_CHECKBOX_HEIGHT ) ;
+ Pos = MAP_APPFONT ( 123 , 135 ) ;
+ Size = MAP_APPFONT ( 125 , RSC_CD_CHECKBOX_HEIGHT ) ;
Text [ en-US ] = "For the current document only";
};
FixedLine FL_ENHANCED
diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index 318f2a8077..b70f498c60 100644
--- a/svx/source/dialog/langbox.cxx
+++ b/svx/source/dialog/langbox.cxx
@@ -37,8 +37,9 @@
#include <com/sun/star/linguistic2/XLinguServiceManager.hdl>
#endif
#include <com/sun/star/linguistic2/XAvailableLocales.hpp>
+#include <com/sun/star/i18n/ScriptType.hpp>
#include <linguistic/misc.hxx>
-#include<rtl/ustring.hxx>
+#include <rtl/ustring.hxx>
#include <unotools/localedatawrapper.hxx>
#include <svtools/langtab.hxx>
@@ -315,6 +316,13 @@ void SvxLanguageBox::SetLanguageList( INT16 nLangList,
USHORT SvxLanguageBox::InsertLanguage( const LanguageType nLangType, USHORT nPos )
{
+ return ImplInsertLanguage( nLangType, nPos, ::com::sun::star::i18n::ScriptType::WEAK );
+}
+
+//------------------------------------------------------------------------
+
+USHORT SvxLanguageBox::ImplInsertLanguage( const LanguageType nLangType, USHORT nPos, sal_Int16 nType )
+{
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
@@ -329,6 +337,15 @@ USHORT SvxLanguageBox::InsertLanguage( const LanguageType nLangType, USHORT nPos
String aStrEntry = m_pLangTable->GetString( nLang );
if (LANGUAGE_NONE == nLang && m_bHasLangNone && m_bLangNoneIsLangAll)
aStrEntry = m_aAllString;
+
+ LanguageType nRealLang = nLang;
+ if (nRealLang == LANGUAGE_SYSTEM)
+ {
+ nRealLang = MsLangId::resolveSystemLanguageByScriptType(nRealLang, nType);
+ aStrEntry.AppendAscii(" - ");
+ aStrEntry.Append(m_pLangTable->GetString( nRealLang ));
+ }
+
aStrEntry = ApplyLreOrRleEmbedding( aStrEntry );
USHORT nAt = 0;
@@ -343,7 +360,7 @@ USHORT SvxLanguageBox::InsertLanguage( const LanguageType nLangType, USHORT nPos
m_pSpellUsedLang = new Sequence< INT16 >( xSpell->getLanguages() );
}
bFound = m_pSpellUsedLang ?
- lcl_SeqHasLang( *m_pSpellUsedLang, nLang ) : FALSE;
+ lcl_SeqHasLang( *m_pSpellUsedLang, nRealLang ) : FALSE;
nAt = ImplInsertImgEntry( aStrEntry, nPos, bFound );
}
@@ -356,6 +373,13 @@ USHORT SvxLanguageBox::InsertLanguage( const LanguageType nLangType, USHORT nPos
//------------------------------------------------------------------------
+USHORT SvxLanguageBox::InsertDefaultLanguage( sal_Int16 nType, USHORT nPos )
+{
+ return ImplInsertLanguage( LANGUAGE_SYSTEM, nPos, nType );
+}
+
+//------------------------------------------------------------------------
+
USHORT SvxLanguageBox::InsertLanguage( const LanguageType nLangType,
BOOL bCheckEntry, USHORT nPos )
{