[Libreoffice-commits] core.git: cui/source include/unotools unotools/source

Noel Grandin noel.grandin at collabora.co.uk
Fri Feb 10 06:06:03 UTC 2017


 cui/source/options/optgdlg.cxx              |    6 +++---
 include/unotools/syslocaleoptions.hxx       |    9 ++++-----
 unotools/source/config/syslocaleoptions.cxx |   11 +++--------
 3 files changed, 10 insertions(+), 16 deletions(-)

New commits:
commit 29eb1ceeae4a3108ce134b45e77a37ade7d7a4f8
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Feb 9 10:11:36 2017 +0200

    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 at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 3e14eea..607b140 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -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();
diff --git a/include/unotools/syslocaleoptions.hxx b/include/unotools/syslocaleoptions.hxx
index bb86e64..68af7dc 100644
--- a/include/unotools/syslocaleoptions.hxx
+++ b/include/unotools/syslocaleoptions.hxx
@@ -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;
diff --git a/unotools/source/config/syslocaleoptions.cxx b/unotools/source/config/syslocaleoptions.cxx
index eb3cccd..08a1e7b 100644
--- a/unotools/source/config/syslocaleoptions.cxx
+++ b/unotools/source/config/syslocaleoptions.cxx
@@ -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;


More information about the Libreoffice-commits mailing list