Kaydet (Commit) b4d1aaa0 authored tarafından Jeremy Brown's avatar Jeremy Brown Kaydeden (comit) Tor Lillqvist

fdo#36324 fdo#42929 - option to ingore system input language changes

Created a new checkbox on the Langauges options page:
[] Ignore system input language

This is unchecked by default so that the current behavior remains the
default, i.e. newly entered text will be flagged as whatever the
current system input language is.

When checked however, this instructs LibreOffice to ignore the system
language (on Windows for example, the language from the Language Bar)
when determining the language for newly entered text. This is handled in
the lcl_isNonDefaultLanguage method of sw/source/ui/docvw/edtwin.cxx.

The option is also saved in registrymodifications.xcu

There are two main use cases:
1. This allows someone to use a single "international" keyboard on
Windows to type in multiple languages, (e.g. English, French, Spanish)
without changing the system keyboard. The person is then responsible for
setting the language for each word or run of text themselves in
LibreOffice. This seems to be the preferred workflow for some
translators and some educators developing language materials.

2. This allows someone writing in a minority language that is not
represented in one of Windows' locale options to still be able to type
in LibreOffice in their language using a keyboard tagged for another
language. Once they set the language in LibreOffice (e.g. to Teke-Eboo
[ebo_CG]), they can type with a keyboard as being for "Swahili" but
still succeed in entering new text in their language. This allows
spell-checking to work properly without them having to select each new
word they enter and reset the language of that word to Teke-Eboo (as is
currently the case).

Change-Id: I86248f5865b69048eb1f3e427a8c03b093138796
Reviewed-on: https://gerrit.libreoffice.org/1029Reviewed-by: 's avatarTor Lillqvist <tml@iki.fi>
Tested-by: 's avatarTor Lillqvist <tml@iki.fi>
üst fa637c4d
...@@ -1222,6 +1222,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage( Window* pParent, const SfxItemSet& rSe ...@@ -1222,6 +1222,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage( Window* pParent, const SfxItemSet& rSe
aAsianSupportCB(this, CUI_RES(CB_ASIANSUPPORT )), aAsianSupportCB(this, CUI_RES(CB_ASIANSUPPORT )),
aCTLSupportFI(this, CUI_RES(FI_CTLSUPPORT )), aCTLSupportFI(this, CUI_RES(FI_CTLSUPPORT )),
aCTLSupportCB(this, CUI_RES(CB_CTLSUPPORT )), aCTLSupportCB(this, CUI_RES(CB_CTLSUPPORT )),
aIgnoreLanguageChangeCB(this, CUI_RES(CB_IGNORE_LANG_CHANGE )),
sDecimalSeparatorLabel(aDecimalSeparatorCB.GetText()), sDecimalSeparatorLabel(aDecimalSeparatorCB.GetText()),
pLangConfig(new LanguageConfig_Impl) pLangConfig(new LanguageConfig_Impl)
{ {
...@@ -1347,6 +1348,8 @@ OfaLanguagesTabPage::OfaLanguagesTabPage( Window* pParent, const SfxItemSet& rSe ...@@ -1347,6 +1348,8 @@ OfaLanguagesTabPage::OfaLanguagesTabPage( Window* pParent, const SfxItemSet& rSe
aCTLSupportCB.Enable(!bReadonly); aCTLSupportCB.Enable(!bReadonly);
aCTLSupportFI.Show(bReadonly); aCTLSupportFI.Show(bReadonly);
SupportHdl( &aCTLSupportCB ); SupportHdl( &aCTLSupportCB );
aIgnoreLanguageChangeCB.Check( pLangConfig->aSysLocaleOptions.IsIgnoreLanguageChange() );
} }
OfaLanguagesTabPage::~OfaLanguagesTabPage() OfaLanguagesTabPage::~OfaLanguagesTabPage()
...@@ -1514,6 +1517,9 @@ sal_Bool OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet ) ...@@ -1514,6 +1517,9 @@ sal_Bool OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
if(aDecimalSeparatorCB.GetSavedValue() != aDecimalSeparatorCB.IsChecked()) if(aDecimalSeparatorCB.GetSavedValue() != aDecimalSeparatorCB.IsChecked())
pLangConfig->aSysLocaleOptions.SetDecimalSeparatorAsLocale(aDecimalSeparatorCB.IsChecked()); pLangConfig->aSysLocaleOptions.SetDecimalSeparatorAsLocale(aDecimalSeparatorCB.IsChecked());
if(aIgnoreLanguageChangeCB.GetSavedValue() != aIgnoreLanguageChangeCB.IsChecked())
pLangConfig->aSysLocaleOptions.SetIgnoreLanguageChange(aIgnoreLanguageChangeCB.IsChecked());
// Configured currency, for example, USD-en-US or EUR-de-DE, or empty for locale default. // Configured currency, for example, USD-en-US or EUR-de-DE, or empty for locale default.
OUString sOldCurr = pLangConfig->aSysLocaleOptions.GetCurrencyConfigString(); OUString sOldCurr = pLangConfig->aSysLocaleOptions.GetCurrencyConfigString();
sal_uInt16 nCurrPos = aCurrencyLB.GetSelectEntryPos(); sal_uInt16 nCurrPos = aCurrencyLB.GetSelectEntryPos();
...@@ -1659,6 +1665,9 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet& rSet ) ...@@ -1659,6 +1665,9 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet& rSet )
aDecimalSeparatorCB.Check( pLangConfig->aSysLocaleOptions.IsDecimalSeparatorAsLocale()); aDecimalSeparatorCB.Check( pLangConfig->aSysLocaleOptions.IsDecimalSeparatorAsLocale());
aDecimalSeparatorCB.SaveValue(); aDecimalSeparatorCB.SaveValue();
aIgnoreLanguageChangeCB.Check( pLangConfig->aSysLocaleOptions.IsIgnoreLanguageChange());
aIgnoreLanguageChangeCB.SaveValue();
// let LocaleSettingHdl enable/disable checkboxes for CJK/CTL support // let LocaleSettingHdl enable/disable checkboxes for CJK/CTL support
// #i15812# must be done *before* the configured currency is set // #i15812# must be done *before* the configured currency is set
// and update the decimal separator used for the given locale // and update the decimal separator used for the given locale
...@@ -1775,6 +1784,7 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet& rSet ) ...@@ -1775,6 +1784,7 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet& rSet )
aWesternLanguageLB.SaveValue(); aWesternLanguageLB.SaveValue();
aAsianLanguageLB.SaveValue(); aAsianLanguageLB.SaveValue();
aComplexLanguageLB.SaveValue(); aComplexLanguageLB.SaveValue();
aIgnoreLanguageChangeCB.SaveValue();
aCurrentDocCB.SaveValue(); aCurrentDocCB.SaveValue();
sal_Bool bEnable = !pLangConfig->aLinguConfig.IsReadOnly( "DefaultLocale" ); sal_Bool bEnable = !pLangConfig->aLinguConfig.IsReadOnly( "DefaultLocale" );
......
...@@ -176,6 +176,7 @@ ...@@ -176,6 +176,7 @@
#define FI_DATEPATTERNS 32 #define FI_DATEPATTERNS 32
#define FT_DATEPATTERNS 33 #define FT_DATEPATTERNS 33
#define ED_DATEPATTERNS 34 #define ED_DATEPATTERNS 34
#define CB_IGNORE_LANG_CHANGE 35
#define FL_FILEDLG 53 #define FL_FILEDLG 53
#define FI_FILEDLG_RO 54 #define FI_FILEDLG_RO 54
......
...@@ -185,6 +185,7 @@ class OfaLanguagesTabPage : public SfxTabPage ...@@ -185,6 +185,7 @@ class OfaLanguagesTabPage : public SfxTabPage
CheckBox aAsianSupportCB; CheckBox aAsianSupportCB;
ReadOnlyImage aCTLSupportFI; ReadOnlyImage aCTLSupportFI;
CheckBox aCTLSupportCB; CheckBox aCTLSupportCB;
CheckBox aIgnoreLanguageChangeCB;
const String sDecimalSeparatorLabel; const String sDecimalSeparatorLabel;
......
...@@ -455,20 +455,20 @@ TabPage OFA_TP_LANGUAGES ...@@ -455,20 +455,20 @@ TabPage OFA_TP_LANGUAGES
}; };
FixedImage FI_USERINTERFACE FixedImage FI_USERINTERFACE
{ {
Pos = MAP_APPFONT ( 5 , 17 ) ; Pos = MAP_APPFONT ( 5 , 17-1 ) ;
Size = MAP_APPFONT ( 6 , 6 ) ; Size = MAP_APPFONT ( 6 , 6 ) ;
Hide = TRUE; Hide = TRUE;
}; };
FixedText FT_USERINTERFACE FixedText FT_USERINTERFACE
{ {
Pos = MAP_APPFONT ( 12 , 16 ) ; Pos = MAP_APPFONT ( 12 , 16-1 ) ;
Size = MAP_APPFONT ( 108 , 8 ) ; Size = MAP_APPFONT ( 108 , 8 ) ;
Text [ en-US ] = "~User interface"; Text [ en-US ] = "~User interface";
}; };
ListBox LB_USERINTERFACE ListBox LB_USERINTERFACE
{ {
HelpID = "cui:ListBox:OFA_TP_LANGUAGES:LB_USERINTERFACE"; HelpID = "cui:ListBox:OFA_TP_LANGUAGES:LB_USERINTERFACE";
Pos = MAP_APPFONT ( 123 , 14 ) ; Pos = MAP_APPFONT ( 123 , 14-1 ) ;
Size = MAP_APPFONT ( 125 , 60 ) ; Size = MAP_APPFONT ( 125 , 60 ) ;
DropDown = TRUE ; DropDown = TRUE ;
Border = TRUE ; Border = TRUE ;
...@@ -477,20 +477,20 @@ TabPage OFA_TP_LANGUAGES ...@@ -477,20 +477,20 @@ TabPage OFA_TP_LANGUAGES
}; };
FixedImage FI_LOCALESETTING FixedImage FI_LOCALESETTING
{ {
Pos = MAP_APPFONT ( 5 , 32 ) ; Pos = MAP_APPFONT ( 5 , 32-2 ) ;
Size = MAP_APPFONT ( 6 , 6 ) ; Size = MAP_APPFONT ( 6 , 6 ) ;
Hide = TRUE; Hide = TRUE;
}; };
FixedText FT_LOCALESETTING FixedText FT_LOCALESETTING
{ {
Pos = MAP_APPFONT ( 12 , 31 ) ; Pos = MAP_APPFONT ( 12 , 31-2 ) ;
Size = MAP_APPFONT ( 108 , 8 ) ; Size = MAP_APPFONT ( 108 , 8 ) ;
Text [ en-US ] = "Locale setting"; Text [ en-US ] = "Locale setting";
}; };
ListBox LB_LOCALESETTING ListBox LB_LOCALESETTING
{ {
HelpID = "cui:ListBox:OFA_TP_LANGUAGES:LB_LOCALESETTING"; HelpID = "cui:ListBox:OFA_TP_LANGUAGES:LB_LOCALESETTING";
Pos = MAP_APPFONT ( 123 , 30 ) ; Pos = MAP_APPFONT ( 123 , 30-2 ) ;
Size = MAP_APPFONT ( 125 , 60 ) ; Size = MAP_APPFONT ( 125 , 60 ) ;
DropDown = TRUE ; DropDown = TRUE ;
Border = TRUE ; Border = TRUE ;
...@@ -499,33 +499,33 @@ TabPage OFA_TP_LANGUAGES ...@@ -499,33 +499,33 @@ TabPage OFA_TP_LANGUAGES
}; };
FixedText FT_DECIMALSEPARATOR FixedText FT_DECIMALSEPARATOR
{ {
Pos = MAP_APPFONT ( 12 , 46 ) ; Pos = MAP_APPFONT ( 12 , 46-3 ) ;
Size = MAP_APPFONT ( 108 , 8 ) ; Size = MAP_APPFONT ( 108 , 8 ) ;
Text [ en-US ] = "Decimal separator key"; Text [ en-US ] = "Decimal separator key";
}; };
CheckBox CB_DECIMALSEPARATOR CheckBox CB_DECIMALSEPARATOR
{ {
HelpID = "cui:CheckBox:OFA_TP_LANGUAGES:CB_DECIMALSEPARATOR"; HelpID = "cui:CheckBox:OFA_TP_LANGUAGES:CB_DECIMALSEPARATOR";
Pos = MAP_APPFONT ( 123 , 46) ; Pos = MAP_APPFONT ( 123 , 46-3) ;
Size = MAP_APPFONT ( 125 , RSC_CD_CHECKBOX_HEIGHT ) ; Size = MAP_APPFONT ( 125 , RSC_CD_CHECKBOX_HEIGHT ) ;
Text [ en-US ] = "~Same as locale setting ( %1 )"; Text [ en-US ] = "~Same as locale setting ( %1 )";
}; };
FixedImage FI_CURRENCY FixedImage FI_CURRENCY
{ {
Pos = MAP_APPFONT ( 5 , 63 ) ; Pos = MAP_APPFONT ( 5 , 63-4 ) ;
Size = MAP_APPFONT ( 6 , 6 ) ; Size = MAP_APPFONT ( 6 , 6 ) ;
Hide = TRUE; Hide = TRUE;
}; };
FixedText FT_CURRENCY FixedText FT_CURRENCY
{ {
Pos = MAP_APPFONT ( 12 , 61 ) ; Pos = MAP_APPFONT ( 12 , 61-4 ) ;
Size = MAP_APPFONT ( 108 , 8 ) ; Size = MAP_APPFONT ( 108 , 8 ) ;
Text [ en-US ] = "~Default currency"; Text [ en-US ] = "~Default currency";
}; };
ListBox LB_CURRENCY ListBox LB_CURRENCY
{ {
HelpID = "cui:ListBox:OFA_TP_LANGUAGES:LB_CURRENCY"; HelpID = "cui:ListBox:OFA_TP_LANGUAGES:LB_CURRENCY";
Pos = MAP_APPFONT ( 123 , 59 ) ; Pos = MAP_APPFONT ( 123 , 59-4 ) ;
Size = MAP_APPFONT ( 125 , 60 ) ; Size = MAP_APPFONT ( 125 , 60 ) ;
DropDown = TRUE ; DropDown = TRUE ;
Border = TRUE ; Border = TRUE ;
...@@ -534,39 +534,39 @@ TabPage OFA_TP_LANGUAGES ...@@ -534,39 +534,39 @@ TabPage OFA_TP_LANGUAGES
}; };
FixedImage FI_DATEPATTERNS FixedImage FI_DATEPATTERNS
{ {
Pos = MAP_APPFONT ( 5 , 78 ) ; Pos = MAP_APPFONT ( 5 , 78-5 ) ;
Size = MAP_APPFONT ( 6 , 6 ) ; Size = MAP_APPFONT ( 6 , 6 ) ;
Hide = TRUE; Hide = TRUE;
}; };
FixedText FT_DATEPATTERNS FixedText FT_DATEPATTERNS
{ {
Pos = MAP_APPFONT ( 12 , 76 ) ; Pos = MAP_APPFONT ( 12 , 76-5 ) ;
Size = MAP_APPFONT ( 108 , 8 ) ; Size = MAP_APPFONT ( 108 , 8 ) ;
Text [ en-US ] = "Date acceptance ~patterns"; Text [ en-US ] = "Date acceptance ~patterns";
}; };
Edit ED_DATEPATTERNS Edit ED_DATEPATTERNS
{ {
HelpID = "cui:Edit:OFA_TP_LANGUAGES:ED_DATEPATTERNS"; HelpID = "cui:Edit:OFA_TP_LANGUAGES:ED_DATEPATTERNS";
Pos = MAP_APPFONT ( 123 , 74 ) ; Pos = MAP_APPFONT ( 123 , 74-5 ) ;
Size = MAP_APPFONT ( 125 , 12 ) ; Size = MAP_APPFONT ( 125 , 12 ) ;
Border = TRUE ; Border = TRUE ;
TabStop = TRUE ; TabStop = TRUE ;
}; };
FixedLine FL_LINGU_LANG FixedLine FL_LINGU_LANG
{ {
Pos = MAP_APPFONT ( 6 , 92 ) ; Pos = MAP_APPFONT ( 6 , 92-5 ) ;
Size = MAP_APPFONT ( 248 , 8 ) ; Size = MAP_APPFONT ( 248 , 8 ) ;
Text [ en-US ] = "Default languages for documents"; Text [ en-US ] = "Default languages for documents";
}; };
FixedImage FI_WEST_LANG FixedImage FI_WEST_LANG
{ {
Pos = MAP_APPFONT ( 5 , 107 ) ; Pos = MAP_APPFONT ( 5 , 107-6 ) ;
Size = MAP_APPFONT ( 6 , 6 ) ; Size = MAP_APPFONT ( 6 , 6 ) ;
Hide = TRUE; Hide = TRUE;
}; };
FixedText FT_WEST_LANG FixedText FT_WEST_LANG
{ {
Pos = MAP_APPFONT ( 12 , 105 ) ; Pos = MAP_APPFONT ( 12 , 105-6 ) ;
Size = MAP_APPFONT ( 108 , 8 ) ; Size = MAP_APPFONT ( 108 , 8 ) ;
Text [ en-US ] = "Western"; Text [ en-US ] = "Western";
}; };
...@@ -574,7 +574,7 @@ TabPage OFA_TP_LANGUAGES ...@@ -574,7 +574,7 @@ TabPage OFA_TP_LANGUAGES
ListBox LB_WEST_LANG ListBox LB_WEST_LANG
{ {
HelpID = "cui:ListBox:OFA_TP_LANGUAGES:LB_WEST_LANG"; HelpID = "cui:ListBox:OFA_TP_LANGUAGES:LB_WEST_LANG";
Pos = MAP_APPFONT ( 123 , 103 ) ; Pos = MAP_APPFONT ( 123 , 103-6 ) ;
Size = MAP_APPFONT ( 125 , 60 ) ; Size = MAP_APPFONT ( 125 , 60 ) ;
DropDown = TRUE ; DropDown = TRUE ;
Border = TRUE ; Border = TRUE ;
...@@ -583,20 +583,20 @@ TabPage OFA_TP_LANGUAGES ...@@ -583,20 +583,20 @@ TabPage OFA_TP_LANGUAGES
}; };
FixedImage FI_ASIAN_LANG FixedImage FI_ASIAN_LANG
{ {
Pos = MAP_APPFONT ( 5 , 123 ) ; Pos = MAP_APPFONT ( 5 , 123-7 ) ;
Size = MAP_APPFONT ( 6 , 6 ) ; Size = MAP_APPFONT ( 6 , 6 ) ;
Hide = TRUE; Hide = TRUE;
}; };
FixedText FT_ASIAN_LANG FixedText FT_ASIAN_LANG
{ {
Pos = MAP_APPFONT ( 12 , 121 ) ; Pos = MAP_APPFONT ( 12 , 121-7 ) ;
Size = MAP_APPFONT ( 108 , 8 ) ; Size = MAP_APPFONT ( 108 , 8 ) ;
Text [ en-US ] = "Asian"; Text [ en-US ] = "Asian";
}; };
ListBox LB_ASIAN_LANG ListBox LB_ASIAN_LANG
{ {
HelpID = "cui:ListBox:OFA_TP_LANGUAGES:LB_ASIAN_LANG"; HelpID = "cui:ListBox:OFA_TP_LANGUAGES:LB_ASIAN_LANG";
Pos = MAP_APPFONT ( 123 , 119 ) ; Pos = MAP_APPFONT ( 123 , 119-7 ) ;
Size = MAP_APPFONT ( 125 , 60 ) ; Size = MAP_APPFONT ( 125 , 60 ) ;
DropDown = TRUE ; DropDown = TRUE ;
Border = TRUE ; Border = TRUE ;
...@@ -605,20 +605,20 @@ TabPage OFA_TP_LANGUAGES ...@@ -605,20 +605,20 @@ TabPage OFA_TP_LANGUAGES
}; };
FixedImage FI_COMPLEX_LANG FixedImage FI_COMPLEX_LANG
{ {
Pos = MAP_APPFONT ( 5 , 139 ) ; Pos = MAP_APPFONT ( 5 , 139-8 ) ;
Size = MAP_APPFONT ( 6 , 6 ) ; Size = MAP_APPFONT ( 6 , 6 ) ;
Hide = TRUE; Hide = TRUE;
}; };
FixedText FT_COMPLEX_LANG FixedText FT_COMPLEX_LANG
{ {
Pos = MAP_APPFONT ( 12 , 137 ) ; Pos = MAP_APPFONT ( 12 , 137-8 ) ;
Size = MAP_APPFONT ( 108 , 8 ) ; Size = MAP_APPFONT ( 108 , 8 ) ;
Text [ en-US ] = "C~TL"; Text [ en-US ] = "C~TL";
}; };
ListBox LB_COMPLEX_LANG ListBox LB_COMPLEX_LANG
{ {
HelpID = "cui:ListBox:OFA_TP_LANGUAGES:LB_COMPLEX_LANG"; HelpID = "cui:ListBox:OFA_TP_LANGUAGES:LB_COMPLEX_LANG";
Pos = MAP_APPFONT ( 123 , 135 ) ; Pos = MAP_APPFONT ( 123 , 135-8 ) ;
Size = MAP_APPFONT ( 125 , 60 ) ; Size = MAP_APPFONT ( 125 , 60 ) ;
DropDown = TRUE ; DropDown = TRUE ;
Border = TRUE ; Border = TRUE ;
...@@ -628,42 +628,49 @@ TabPage OFA_TP_LANGUAGES ...@@ -628,42 +628,49 @@ TabPage OFA_TP_LANGUAGES
CheckBox CB_CURRENT_DOC CheckBox CB_CURRENT_DOC
{ {
HelpID = "cui:CheckBox:OFA_TP_LANGUAGES:CB_CURRENT_DOC"; HelpID = "cui:CheckBox:OFA_TP_LANGUAGES:CB_CURRENT_DOC";
Pos = MAP_APPFONT ( 123 , 150 ) ; Pos = MAP_APPFONT ( 123 , 150-8 ) ;
Size = MAP_APPFONT ( 125 , RSC_CD_CHECKBOX_HEIGHT ) ; Size = MAP_APPFONT ( 125 , RSC_CD_CHECKBOX_HEIGHT ) ;
Text [ en-US ] = "For the current document only"; Text [ en-US ] = "For the current document only";
}; };
FixedLine FL_ENHANCED FixedLine FL_ENHANCED
{ {
Pos = MAP_APPFONT ( 6 , 160 ) ; Pos = MAP_APPFONT ( 6 , 160-8 ) ;
Size = MAP_APPFONT ( 248 , 8 ) ; Size = MAP_APPFONT ( 248 , 8 ) ;
Text [ en-US ] = "Enhanced language support"; Text [ en-US ] = "Enhanced language support";
}; };
FixedImage FI_ASIANSUPPORT FixedImage FI_ASIANSUPPORT
{ {
Pos = MAP_APPFONT ( 5 , 175 ) ; Pos = MAP_APPFONT ( 5 , 175-9 ) ;
Size = MAP_APPFONT ( 6 , 6 ) ; Size = MAP_APPFONT ( 6 , 6 ) ;
Hide = TRUE; Hide = TRUE;
}; };
CheckBox CB_ASIANSUPPORT CheckBox CB_ASIANSUPPORT
{ {
HelpID = "cui:CheckBox:OFA_TP_LANGUAGES:CB_ASIANSUPPORT"; HelpID = "cui:CheckBox:OFA_TP_LANGUAGES:CB_ASIANSUPPORT";
Pos = MAP_APPFONT ( 12 , 173 ) ; Pos = MAP_APPFONT ( 12 , 173-9 ) ;
Size = MAP_APPFONT ( 236 ,RSC_CD_CHECKBOX_HEIGHT ) ; Size = MAP_APPFONT ( 236 ,RSC_CD_CHECKBOX_HEIGHT ) ;
Text [ en-US ] = "Show UI elements for East Asia~n writings"; Text [ en-US ] = "Show UI elements for East Asia~n writings";
}; };
FixedImage FI_CTLSUPPORT FixedImage FI_CTLSUPPORT
{ {
Pos = MAP_APPFONT ( 5 , 190 ) ; Pos = MAP_APPFONT ( 5 , 190-10 ) ;
Size = MAP_APPFONT ( 6 , 6 ) ; Size = MAP_APPFONT ( 6 , 6 ) ;
Hide = TRUE; Hide = TRUE;
}; };
CheckBox CB_CTLSUPPORT CheckBox CB_CTLSUPPORT
{ {
HelpID = "cui:CheckBox:OFA_TP_LANGUAGES:CB_CTLSUPPORT"; HelpID = "cui:CheckBox:OFA_TP_LANGUAGES:CB_CTLSUPPORT";
Pos = MAP_APPFONT ( 12 , 188 ) ; Pos = MAP_APPFONT ( 12 , 188-10 ) ;
Size = MAP_APPFONT ( 236 , RSC_CD_CHECKBOX_HEIGHT ) ; Size = MAP_APPFONT ( 236 , RSC_CD_CHECKBOX_HEIGHT ) ;
Text [ en-US ] = "Show UI elements for B~i-Directional writing"; Text [ en-US ] = "Show UI elements for B~i-Directional writing";
}; };
CheckBox CB_IGNORE_LANG_CHANGE
{
HelpID = "cui:CheckBox:OFA_TP_LANGUAGES:CB_IGNORE_LANG_CHANGE";
Pos = MAP_APPFONT ( 12 , 188-11+15 ) ;
Size = MAP_APPFONT ( 125 , RSC_CD_CHECKBOX_HEIGHT ) ;
Text [ en-US ] = "Ignore s~ystem input language";
};
}; };
InfoBox RID_SVX_MSGBOX_LANGUAGE_RESTART InfoBox RID_SVX_MSGBOX_LANGUAGE_RESTART
......
...@@ -457,6 +457,14 @@ ...@@ -457,6 +457,14 @@
</info> </info>
<value>true</value> <value>true</value>
</prop> </prop>
<prop oor:name="IgnoreLanguageChange" oor:type="xs:boolean" oor:nillable="false">
<info>
<author>OS</author>
<desc>Indicates whether changes to the system input language/keyboard will be ignored. If ignored, when new text is typed that text will follow the language of the document or current paragraph, not the current system language.</desc>
<label>Ignore system input language.</label>
</info>
<value>false</value>
</prop>
<prop oor:name="DateAcceptancePatterns" oor:type="xs:string" oor:nillable="true"> <prop oor:name="DateAcceptancePatterns" oor:type="xs:string" oor:nillable="true">
<!-- UIHints: Tools - Options - Language Settings - Languages - Language of - Date acceptance patterns --> <!-- UIHints: Tools - Options - Language Settings - Languages - Language of - Date acceptance patterns -->
<info> <info>
......
...@@ -149,6 +149,8 @@ ...@@ -149,6 +149,8 @@
#include "../../core/inc/rootfrm.hxx" #include "../../core/inc/rootfrm.hxx"
#include <unotools/syslocaleoptions.hxx>
using namespace sw::mark; using namespace sw::mark;
using namespace ::com::sun::star; using namespace ::com::sun::star;
...@@ -773,6 +775,16 @@ static sal_uInt16 lcl_isNonDefaultLanguage(LanguageType eBufferLanguage, SwView& ...@@ -773,6 +775,16 @@ static sal_uInt16 lcl_isNonDefaultLanguage(LanguageType eBufferLanguage, SwView&
const String &rInBuffer) const String &rInBuffer)
{ {
sal_uInt16 nWhich = INVALID_HINT; sal_uInt16 nWhich = INVALID_HINT;
//If the option to IgnoreLanguageChange is set, short-circuit this method
//which results in the document/paragraph language remaining the same
//despite a change to the keyboard/input language
SvtSysLocaleOptions aSysLocaleOptions;
if(aSysLocaleOptions.IsIgnoreLanguageChange())
{
return INVALID_HINT;
}
bool bLang = true; bool bLang = true;
if(eBufferLanguage != LANGUAGE_DONTKNOW) if(eBufferLanguage != LANGUAGE_DONTKNOW)
{ {
......
...@@ -36,6 +36,7 @@ const sal_uLong SYSLOCALEOPTIONS_HINT_CURRENCY = 0x00000002; ...@@ -36,6 +36,7 @@ const sal_uLong SYSLOCALEOPTIONS_HINT_CURRENCY = 0x00000002;
const sal_uLong SYSLOCALEOPTIONS_HINT_UILOCALE = 0x00000004; const sal_uLong SYSLOCALEOPTIONS_HINT_UILOCALE = 0x00000004;
const sal_uLong SYSLOCALEOPTIONS_HINT_DECSEP = 0x00000008; const sal_uLong SYSLOCALEOPTIONS_HINT_DECSEP = 0x00000008;
const sal_uLong SYSLOCALEOPTIONS_HINT_DATEPATTERNS = 0x00000010; const sal_uLong SYSLOCALEOPTIONS_HINT_DATEPATTERNS = 0x00000010;
const sal_uLong SYSLOCALEOPTIONS_HINT_IGNORELANG = 0x00000020;
class SvtSysLocaleOptions_Impl; class SvtSysLocaleOptions_Impl;
class SvtListener; class SvtListener;
...@@ -121,6 +122,11 @@ public: ...@@ -121,6 +122,11 @@ public:
sal_Bool IsDecimalSeparatorAsLocale() const; sal_Bool IsDecimalSeparatorAsLocale() const;
void SetDecimalSeparatorAsLocale( sal_Bool bSet); void SetDecimalSeparatorAsLocale( sal_Bool bSet);
// determine whether to ignore changes to the system keyboard/locale/language when
// determining the language for newly entered text
sal_Bool IsIgnoreLanguageChange() const;
void SetIgnoreLanguageChange( sal_Bool bSet);
// convenience methods // convenience methods
/// Get currency abbreviation and locale from an USD-en-US or EUR-de-DE string /// Get currency abbreviation and locale from an USD-en-US or EUR-de-DE string
......
...@@ -79,12 +79,14 @@ class SvtSysLocaleOptions_Impl : public utl::ConfigItem ...@@ -79,12 +79,14 @@ class SvtSysLocaleOptions_Impl : public utl::ConfigItem
OUString m_aCurrencyString; // USD-en-US or EUR-de-DE OUString m_aCurrencyString; // USD-en-US or EUR-de-DE
OUString m_aDatePatternsString; // "Y-M-D;M-D" OUString m_aDatePatternsString; // "Y-M-D;M-D"
sal_Bool m_bDecimalSeparator; //use decimal separator same as locale sal_Bool m_bDecimalSeparator; //use decimal separator same as locale
sal_Bool m_bIgnoreLanguageChange; //OS language change doesn't affect LO document language
sal_Bool m_bROLocale; sal_Bool m_bROLocale;
sal_Bool m_bROUILocale; sal_Bool m_bROUILocale;
sal_Bool m_bROCurrency; sal_Bool m_bROCurrency;
sal_Bool m_bRODatePatterns; sal_Bool m_bRODatePatterns;
sal_Bool m_bRODecimalSeparator; sal_Bool m_bRODecimalSeparator;
sal_Bool m_bROIgnoreLanguageChange;
static const Sequence< /* const */ OUString > GetPropertyNames(); static const Sequence< /* const */ OUString > GetPropertyNames();
void MakeRealLocale(); void MakeRealLocale();
...@@ -116,6 +118,9 @@ public: ...@@ -116,6 +118,9 @@ public:
sal_Bool IsDecimalSeparatorAsLocale() const { return m_bDecimalSeparator;} sal_Bool IsDecimalSeparatorAsLocale() const { return m_bDecimalSeparator;}
void SetDecimalSeparatorAsLocale( sal_Bool bSet); void SetDecimalSeparatorAsLocale( sal_Bool bSet);
sal_Bool IsIgnoreLanguageChange() const { return m_bIgnoreLanguageChange;}
void SetIgnoreLanguageChange( sal_Bool bSet);
sal_Bool IsReadOnly( SvtSysLocaleOptions::EOption eOption ) const; sal_Bool IsReadOnly( SvtSysLocaleOptions::EOption eOption ) const;
const Locale& GetRealLocale() { return m_aRealLocale; } const Locale& GetRealLocale() { return m_aRealLocale; }
const Locale& GetRealUILocale() { return m_aRealUILocale; } const Locale& GetRealUILocale() { return m_aRealUILocale; }
...@@ -131,14 +136,17 @@ public: ...@@ -131,14 +136,17 @@ public:
#define PROPERTYNAME_CURRENCY OUString(RTL_CONSTASCII_USTRINGPARAM("ooSetupCurrency")) #define PROPERTYNAME_CURRENCY OUString(RTL_CONSTASCII_USTRINGPARAM("ooSetupCurrency"))
#define PROPERTYNAME_DECIMALSEPARATOR OUString(RTL_CONSTASCII_USTRINGPARAM("DecimalSeparatorAsLocale")) #define PROPERTYNAME_DECIMALSEPARATOR OUString(RTL_CONSTASCII_USTRINGPARAM("DecimalSeparatorAsLocale"))
#define PROPERTYNAME_DATEPATTERNS OUString(RTL_CONSTASCII_USTRINGPARAM("DateAcceptancePatterns")) #define PROPERTYNAME_DATEPATTERNS OUString(RTL_CONSTASCII_USTRINGPARAM("DateAcceptancePatterns"))
#define PROPERTYNAME_IGNORELANGCHANGE OUString(RTL_CONSTASCII_USTRINGPARAM("IgnoreLanguageChange"))
#define PROPERTYHANDLE_LOCALE 0 #define PROPERTYHANDLE_LOCALE 0
#define PROPERTYHANDLE_UILOCALE 1 #define PROPERTYHANDLE_UILOCALE 1
#define PROPERTYHANDLE_CURRENCY 2 #define PROPERTYHANDLE_CURRENCY 2
#define PROPERTYHANDLE_DECIMALSEPARATOR 3 #define PROPERTYHANDLE_DECIMALSEPARATOR 3
#define PROPERTYHANDLE_DATEPATTERNS 4 #define PROPERTYHANDLE_DATEPATTERNS 4
#define PROPERTYHANDLE_IGNORELANGCHANGE 5
#define PROPERTYCOUNT 5 //#define PROPERTYCOUNT 5
#define PROPERTYCOUNT 6
const Sequence< OUString > SvtSysLocaleOptions_Impl::GetPropertyNames() const Sequence< OUString > SvtSysLocaleOptions_Impl::GetPropertyNames()
{ {
...@@ -148,7 +156,8 @@ const Sequence< OUString > SvtSysLocaleOptions_Impl::GetPropertyNames() ...@@ -148,7 +156,8 @@ const Sequence< OUString > SvtSysLocaleOptions_Impl::GetPropertyNames()
PROPERTYNAME_UILOCALE, PROPERTYNAME_UILOCALE,
PROPERTYNAME_CURRENCY, PROPERTYNAME_CURRENCY,
PROPERTYNAME_DECIMALSEPARATOR, PROPERTYNAME_DECIMALSEPARATOR,
PROPERTYNAME_DATEPATTERNS PROPERTYNAME_DATEPATTERNS,
PROPERTYNAME_IGNORELANGCHANGE
}; };
const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT ); const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
return seqPropertyNames; return seqPropertyNames;
...@@ -164,6 +173,7 @@ SvtSysLocaleOptions_Impl::SvtSysLocaleOptions_Impl() ...@@ -164,6 +173,7 @@ SvtSysLocaleOptions_Impl::SvtSysLocaleOptions_Impl()
, m_bROCurrency(CFG_READONLY_DEFAULT) , m_bROCurrency(CFG_READONLY_DEFAULT)
, m_bRODatePatterns(CFG_READONLY_DEFAULT) , m_bRODatePatterns(CFG_READONLY_DEFAULT)
, m_bRODecimalSeparator(sal_False) , m_bRODecimalSeparator(sal_False)
, m_bROIgnoreLanguageChange(sal_False)
{ {
if ( IsValidConfigMgr() ) if ( IsValidConfigMgr() )
...@@ -243,6 +253,18 @@ SvtSysLocaleOptions_Impl::SvtSysLocaleOptions_Impl() ...@@ -243,6 +253,18 @@ SvtSysLocaleOptions_Impl::SvtSysLocaleOptions_Impl()
m_bRODatePatterns = pROStates[nProp]; m_bRODatePatterns = pROStates[nProp];
} }
break; break;
case PROPERTYHANDLE_IGNORELANGCHANGE :
{
sal_Bool bValue = sal_Bool();
if ( pValues[nProp] >>= bValue )
m_bIgnoreLanguageChange = bValue;
else
{
SAL_WARN( "unotools.config", "Wrong property type!" );
}
m_bROIgnoreLanguageChange = pROStates[nProp];
}
break;
default: default:
SAL_WARN( "unotools.config", "Wrong property type!" ); SAL_WARN( "unotools.config", "Wrong property type!" );
} }
...@@ -384,6 +406,14 @@ void SvtSysLocaleOptions_Impl::Commit() ...@@ -384,6 +406,14 @@ void SvtSysLocaleOptions_Impl::Commit()
++nRealCount; ++nRealCount;
} }
break; break;
case PROPERTYHANDLE_IGNORELANGCHANGE :
if (!m_bROIgnoreLanguageChange)
{
pNames[nRealCount] = aOrgNames[nProp];
pValues[nRealCount] <<= m_bIgnoreLanguageChange;
++nRealCount;
}
break;
default: default:
SAL_WARN( "unotools.config", "invalid index to save a path" ); SAL_WARN( "unotools.config", "invalid index to save a path" );
} }
...@@ -454,6 +484,16 @@ void SvtSysLocaleOptions_Impl::SetDecimalSeparatorAsLocale( sal_Bool bSet) ...@@ -454,6 +484,16 @@ void SvtSysLocaleOptions_Impl::SetDecimalSeparatorAsLocale( sal_Bool bSet)
} }
} }
void SvtSysLocaleOptions_Impl::SetIgnoreLanguageChange( sal_Bool bSet)
{
if(bSet != m_bIgnoreLanguageChange)
{
m_bIgnoreLanguageChange = bSet;
SetModified();
NotifyListeners( SYSLOCALEOPTIONS_HINT_IGNORELANG );
}
}
void SvtSysLocaleOptions_Impl::Notify( const Sequence< rtl::OUString >& seqPropertyNames ) void SvtSysLocaleOptions_Impl::Notify( const Sequence< rtl::OUString >& seqPropertyNames )
{ {
sal_uLong nHint = 0; sal_uLong nHint = 0;
...@@ -492,6 +532,11 @@ void SvtSysLocaleOptions_Impl::Notify( const Sequence< rtl::OUString >& seqPrope ...@@ -492,6 +532,11 @@ void SvtSysLocaleOptions_Impl::Notify( const Sequence< rtl::OUString >& seqPrope
seqValues[nProp] >>= m_bDecimalSeparator; seqValues[nProp] >>= m_bDecimalSeparator;
m_bRODecimalSeparator = seqROStates[nProp]; m_bRODecimalSeparator = seqROStates[nProp];
} }
else if( seqPropertyNames[nProp] == PROPERTYNAME_IGNORELANGCHANGE )
{
seqValues[nProp] >>= m_bIgnoreLanguageChange;
m_bROIgnoreLanguageChange = seqROStates[nProp];
}
else if( seqPropertyNames[nProp] == PROPERTYNAME_DATEPATTERNS ) else if( seqPropertyNames[nProp] == PROPERTYNAME_DATEPATTERNS )
{ {
DBG_ASSERT( seqValues[nProp].getValueTypeClass() == TypeClass_STRING, "DatePatterns property type" ); DBG_ASSERT( seqValues[nProp].getValueTypeClass() == TypeClass_STRING, "DatePatterns property type" );
...@@ -628,6 +673,17 @@ void SvtSysLocaleOptions::SetDecimalSeparatorAsLocale( sal_Bool bSet) ...@@ -628,6 +673,17 @@ void SvtSysLocaleOptions::SetDecimalSeparatorAsLocale( sal_Bool bSet)
pOptions->SetDecimalSeparatorAsLocale(bSet); pOptions->SetDecimalSeparatorAsLocale(bSet);
} }
sal_Bool SvtSysLocaleOptions::IsIgnoreLanguageChange() const
{
MutexGuard aGuard( GetMutex() );
return pOptions->IsIgnoreLanguageChange();
}
void SvtSysLocaleOptions::SetIgnoreLanguageChange( sal_Bool bSet)
{
MutexGuard aGuard( GetMutex() );
pOptions->SetIgnoreLanguageChange(bSet);
}
sal_Bool SvtSysLocaleOptions::IsReadOnly( EOption eOption ) const sal_Bool SvtSysLocaleOptions::IsReadOnly( EOption eOption ) const
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment