convert SvtSysLocaleOptions::EOption to scoped enum

and drop unused E_UILOCALE enumerator

Change-Id: Ic9bdac91fab15af45e7dbd613e6e44b73b5cf9de
Reviewed-on: https://gerrit.libreoffice.org/34066
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2017-02-09 10:11:36 +02:00
parent 7cf66202f2
commit 29eb1ceeae
3 changed files with 10 additions and 16 deletions

View File

@@ -1573,7 +1573,7 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet* rSet )
m_pLocaleSettingLB->SelectLanguage( LANGUAGE_USER_SYSTEM_CONFIG );
else
m_pLocaleSettingLB->SelectLanguage( aLanguageTag.makeFallback().getLanguageType());
bool bReadonly = pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::E_LOCALE);
bool bReadonly = pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::EOption::Locale);
m_pLocaleSettingLB->Enable(!bReadonly);
m_pLocaleSettingFT->Enable(!bReadonly);
@@ -1602,7 +1602,7 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet* rSet )
// if pCurr==NULL the SYSTEM entry is selected
const sal_Int32 nPos = m_pCurrencyLB->GetEntryPos( static_cast<void const *>(pCurr) );
m_pCurrencyLB->SelectEntryPos( nPos );
bReadonly = pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::E_CURRENCY);
bReadonly = pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::EOption::Currency);
m_pCurrencyLB->Enable(!bReadonly);
m_pCurrencyFT->Enable(!bReadonly);
@@ -1616,7 +1616,7 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet* rSet )
// Let's assume patterns are valid at this point.
m_bDatePatternsValid = true;
m_pDatePatternsED->SetText( aDatePatternsString);
bReadonly = pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::E_DATEPATTERNS);
bReadonly = pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::EOption::DatePatterns);
m_pDatePatternsED->Enable(!bReadonly);
m_pDatePatternsFT->Enable(!bReadonly);
m_pDatePatternsED->SaveValue();

View File

@@ -42,12 +42,11 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtSysLocaleOptions : public utl::detai
public:
enum EOption
enum class EOption
{
E_LOCALE,
E_UILOCALE,
E_CURRENCY,
E_DATEPATTERNS
Locale,
Currency,
DatePatterns
};
SvtSysLocaleOptions();
virtual ~SvtSysLocaleOptions() override;

View File

@@ -283,22 +283,17 @@ bool SvtSysLocaleOptions_Impl::IsReadOnly( SvtSysLocaleOptions::EOption eOption
bool bReadOnly = CFG_READONLY_DEFAULT;
switch(eOption)
{
case SvtSysLocaleOptions::E_LOCALE :
case SvtSysLocaleOptions::EOption::Locale :
{
bReadOnly = m_bROLocale;
break;
}
case SvtSysLocaleOptions::E_UILOCALE :
{
bReadOnly = m_bROUILocale;
break;
}
case SvtSysLocaleOptions::E_CURRENCY :
case SvtSysLocaleOptions::EOption::Currency :
{
bReadOnly = m_bROCurrency;
break;
}
case SvtSysLocaleOptions::E_DATEPATTERNS :
case SvtSysLocaleOptions::EOption::DatePatterns :
{
bReadOnly = m_bRODatePatterns;
break;