diff options
-rw-r--r-- | cui/source/options/optgdlg.cxx | 4 | ||||
-rw-r--r-- | include/svl/cjkoptions.hxx | 14 | ||||
-rw-r--r-- | svl/source/config/cjkoptions.cxx | 30 |
3 files changed, 11 insertions, 37 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index ecd671ef2c31..64d11a62451b 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -1165,7 +1165,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(weld::Container* pPage, weld::DialogCon m_bOldAsian = SvtCJKOptions::IsAnyEnabled(); m_xAsianSupportCB->set_active(m_bOldAsian); m_xAsianSupportCB->save_state(); - bool bReadonly = SvtCJKOptions::IsReadOnly(SvtCJKOptions::E_ALL); + bool bReadonly = SvtCJKOptions::IsAnyReadOnly(); m_xAsianSupportCB->set_sensitive(!bReadonly); SupportHdl(*m_xAsianSupportCB); @@ -1651,7 +1651,7 @@ IMPL_LINK_NOARG(OfaLanguagesTabPage, LocaleSettingHdl, weld::ComboBox&, void) } // second check if CJK must be enabled // #103299# - if CJK support is not readonly - if(!SvtCJKOptions::IsReadOnly(SvtCJKOptions::E_ALL)) + if(!SvtCJKOptions::IsAnyReadOnly()) { bool bIsCJKFixed = bool(nType & SvtScriptType::ASIAN); lcl_checkLanguageCheckBox(*m_xAsianSupportCB, bIsCJKFixed, m_bOldAsian); diff --git a/include/svl/cjkoptions.hxx b/include/svl/cjkoptions.hxx index 9ac227541b91..cec2f035b780 100644 --- a/include/svl/cjkoptions.hxx +++ b/include/svl/cjkoptions.hxx @@ -22,18 +22,6 @@ namespace SvtCJKOptions { -enum EOption -{ - E_CJKFONT, - E_VERTICALTEXT, - E_ASIANTYPOGRAPHY, - E_JAPANESEFIND, - E_RUBY, - E_CHANGECASEMAP, - E_DOUBLELINES, - E_ALL // special one for IsAnyEnabled()/SetAll() functionality -}; - SVL_DLLPUBLIC bool IsCJKFontEnabled(); SVL_DLLPUBLIC bool IsVerticalTextEnabled(); SVL_DLLPUBLIC bool IsAsianTypographyEnabled(); @@ -44,7 +32,7 @@ SVL_DLLPUBLIC bool IsDoubleLinesEnabled(); SVL_DLLPUBLIC void SetAll(bool bSet); SVL_DLLPUBLIC bool IsAnyEnabled(); -SVL_DLLPUBLIC bool IsReadOnly(EOption eOption); +SVL_DLLPUBLIC bool IsAnyReadOnly(); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/config/cjkoptions.cxx b/svl/source/config/cjkoptions.cxx index 72e5c8ea2a3d..e43d379f7e66 100644 --- a/svl/source/config/cjkoptions.cxx +++ b/svl/source/config/cjkoptions.cxx @@ -105,30 +105,16 @@ bool IsAnyEnabled() IsRubyEnabled() || IsChangeCaseMapEnabled() || IsDoubleLinesEnabled() ; } -bool IsReadOnly(EOption eOption) +bool IsAnyReadOnly() { SvtCJKOptions_Load(); - switch (eOption) - { - case E_CJKFONT: return officecfg::Office::Common::I18N::CJK::CJKFont::isReadOnly(); - case E_VERTICALTEXT: return officecfg::Office::Common::I18N::CJK::VerticalText::isReadOnly(); - case E_ASIANTYPOGRAPHY: return officecfg::Office::Common::I18N::CJK::AsianTypography::isReadOnly(); - case E_JAPANESEFIND: return officecfg::Office::Common::I18N::CJK::JapaneseFind::isReadOnly(); - case E_RUBY: return officecfg::Office::Common::I18N::CJK::Ruby::isReadOnly(); - case E_CHANGECASEMAP: return officecfg::Office::Common::I18N::CJK::ChangeCaseMap::isReadOnly(); - case E_DOUBLELINES: return officecfg::Office::Common::I18N::CJK::DoubleLines::isReadOnly(); - case E_ALL: - return officecfg::Office::Common::I18N::CJK::CJKFont::isReadOnly() - || officecfg::Office::Common::I18N::CJK::VerticalText::isReadOnly() - || officecfg::Office::Common::I18N::CJK::AsianTypography::isReadOnly() - || officecfg::Office::Common::I18N::CJK::JapaneseFind::isReadOnly() - || officecfg::Office::Common::I18N::CJK::Ruby::isReadOnly() - || officecfg::Office::Common::I18N::CJK::ChangeCaseMap::isReadOnly() - || officecfg::Office::Common::I18N::CJK::DoubleLines::isReadOnly(); - default: - assert(false); - } - return false; + return officecfg::Office::Common::I18N::CJK::CJKFont::isReadOnly() + || officecfg::Office::Common::I18N::CJK::VerticalText::isReadOnly() + || officecfg::Office::Common::I18N::CJK::AsianTypography::isReadOnly() + || officecfg::Office::Common::I18N::CJK::JapaneseFind::isReadOnly() + || officecfg::Office::Common::I18N::CJK::Ruby::isReadOnly() + || officecfg::Office::Common::I18N::CJK::ChangeCaseMap::isReadOnly() + || officecfg::Office::Common::I18N::CJK::DoubleLines::isReadOnly(); } } // namespace SvtCJKOptions |