summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-07-26 13:51:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-27 11:58:23 +0200
commit5db72ef0b381671b7867bda759098a92909e06d8 (patch)
tree986bc625c30f226a2498791ed4a6463f2b6fd913 /cui
parentf8ddaaf0f5e1fb61e0d4404ea28757bc652ae4be (diff)
drop SvtLanguageOptions class
since it is just a wrapper over SvtCJKOptions and SvtCTLOptions. Later I will replace those two with the equivalent officecfg calls Change-Id: I61c5667a05f75d42643175f2c28c29d7a590b15c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119516 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/options/optgdlg.cxx33
-rw-r--r--cui/source/options/treeopt.cxx15
-rw-r--r--cui/source/tabpages/autocdlg.cxx6
-rw-r--r--cui/source/tabpages/chardlg.cxx11
-rw-r--r--cui/source/tabpages/page.cxx9
-rw-r--r--cui/source/tabpages/paragrph.cxx6
6 files changed, 48 insertions, 32 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index e55eca6dcf09..ba3d77e88da5 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -31,6 +31,8 @@
#include <i18nlangtag/languagetag.hxx>
#include <unotools/compatibility.hxx>
#include <svl/languageoptions.hxx>
+#include <svl/cjkoptions.hxx>
+#include <svl/ctloptions.hxx>
#include <svtools/miscopt.hxx>
#include <unotools/syslocaleoptions.hxx>
#include <sfx2/objsh.hxx>
@@ -985,7 +987,8 @@ void OfaViewTabPage::UpdateHardwareAccelStatus()
struct LanguageConfig_Impl
{
- SvtLanguageOptions aLanguageOptions;
+ SvtCJKOptions aCJKLanguageOptions;
+ SvtCTLOptions aCTLLanguageOptions;
SvtSysLocaleOptions aSysLocaleOptions;
SvtLinguConfig aLinguConfig;
};
@@ -1183,17 +1186,17 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(weld::Container* pPage, weld::DialogCon
m_xAsianSupportCB->connect_toggled( aLink );
m_xCTLSupportCB->connect_toggled( aLink );
- m_bOldAsian = pLangConfig->aLanguageOptions.IsAnyEnabled();
+ m_bOldAsian = pLangConfig->aCJKLanguageOptions.IsAnyEnabled();
m_xAsianSupportCB->set_active(m_bOldAsian);
m_xAsianSupportCB->save_state();
- bool bReadonly = pLangConfig->aLanguageOptions.IsReadOnly(SvtLanguageOptions::E_ALLCJK);
+ bool bReadonly = pLangConfig->aCJKLanguageOptions.IsReadOnly(SvtCJKOptions::E_ALL);
m_xAsianSupportCB->set_sensitive(!bReadonly);
SupportHdl(*m_xAsianSupportCB);
- m_bOldCtl = pLangConfig->aLanguageOptions.IsCTLFontEnabled();
+ m_bOldCtl = pLangConfig->aCTLLanguageOptions.IsCTLFontEnabled();
m_xCTLSupportCB->set_active(m_bOldCtl);
m_xCTLSupportCB->save_state();
- bReadonly = pLangConfig->aLanguageOptions.IsReadOnly(SvtLanguageOptions::E_CTLFONT);
+ bReadonly = pLangConfig->aCTLLanguageOptions.IsReadOnly(SvtCTLOptions::E_CTLFONT);
m_xCTLSupportCB->set_sensitive(!bReadonly);
SupportHdl(*m_xCTLSupportCB);
@@ -1231,7 +1234,8 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet )
{
// lock configuration broadcasters so that we can coordinate the notifications
pLangConfig->aSysLocaleOptions.BlockBroadcasts( true );
- pLangConfig->aLanguageOptions.BlockBroadcasts( true );
+ pLangConfig->aCTLLanguageOptions.BlockBroadcasts( true );
+ pLangConfig->aCJKLanguageOptions.BlockBroadcasts( true );
pLangConfig->aLinguConfig.BlockBroadcasts( true );
/*
@@ -1250,9 +1254,9 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet )
//sequence checking has to be switched on depending on the selected CTL language
LanguageType eCTLLang = m_xComplexLanguageLB->get_active_id();
bool bOn = MsLangId::needsSequenceChecking( eCTLLang);
- pLangConfig->aLanguageOptions.SetCTLSequenceCheckingRestricted(bOn);
- pLangConfig->aLanguageOptions.SetCTLSequenceChecking(bOn);
- pLangConfig->aLanguageOptions.SetCTLSequenceCheckingTypeAndReplace(bOn);
+ pLangConfig->aCTLLanguageOptions.SetCTLSequenceCheckingRestricted(bOn);
+ pLangConfig->aCTLLanguageOptions.SetCTLSequenceChecking(bOn);
+ pLangConfig->aCTLLanguageOptions.SetCTLSequenceCheckingTypeAndReplace(bOn);
}
try
{
@@ -1421,7 +1425,7 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet )
if(m_xAsianSupportCB->get_state_changed_from_saved() )
{
bool bChecked = m_xAsianSupportCB->get_active();
- pLangConfig->aLanguageOptions.SetAll(bChecked);
+ pLangConfig->aCJKLanguageOptions.SetAll(bChecked);
//iterate over all bindings to invalidate vertical text direction
const sal_uInt16 STATE_COUNT = 2;
@@ -1443,7 +1447,7 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet )
aOpt.SetIgnoreDiacritics_CTL(true);
aOpt.SetIgnoreKashida_CTL(true);
aOpt.Commit();
- pLangConfig->aLanguageOptions.SetCTLFontEnabled( m_xCTLSupportCB->get_active() );
+ pLangConfig->aCTLLanguageOptions.SetCTLFontEnabled( m_xCTLSupportCB->get_active() );
const sal_uInt16 STATE_COUNT = 1;
std::unique_ptr<SfxBoolItem> pBoolItems[STATE_COUNT];
@@ -1460,7 +1464,8 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet )
// it seems that our code relies on the fact that before other changes like e.g. currency
// are broadcasted locale changes have been done
pLangConfig->aSysLocaleOptions.BlockBroadcasts( false );
- pLangConfig->aLanguageOptions.BlockBroadcasts( false );
+ pLangConfig->aCJKLanguageOptions.BlockBroadcasts( false );
+ pLangConfig->aCTLLanguageOptions.BlockBroadcasts( false );
pLangConfig->aLinguConfig.BlockBroadcasts( false );
return false;
@@ -1659,7 +1664,7 @@ IMPL_LINK_NOARG(OfaLanguagesTabPage, LocaleSettingHdl, weld::ComboBox&, void)
SvtScriptType nType = SvtLanguageOptions::GetScriptTypeOfLanguage(eLang);
// first check if CTL must be enabled
// #103299# - if CTL font setting is not readonly
- if(!pLangConfig->aLanguageOptions.IsReadOnly(SvtLanguageOptions::E_CTLFONT))
+ if(!pLangConfig->aCTLLanguageOptions.IsReadOnly(SvtCTLOptions::E_CTLFONT))
{
bool bIsCTLFixed = bool(nType & SvtScriptType::COMPLEX);
lcl_checkLanguageCheckBox(*m_xCTLSupportCB, bIsCTLFixed, m_bOldCtl);
@@ -1667,7 +1672,7 @@ IMPL_LINK_NOARG(OfaLanguagesTabPage, LocaleSettingHdl, weld::ComboBox&, void)
}
// second check if CJK must be enabled
// #103299# - if CJK support is not readonly
- if(!pLangConfig->aLanguageOptions.IsReadOnly(SvtLanguageOptions::E_ALLCJK))
+ if(!pLangConfig->aCJKLanguageOptions.IsReadOnly(SvtCJKOptions::E_ALL))
{
bool bIsCJKFixed = bool(nType & SvtScriptType::ASIAN);
lcl_checkLanguageCheckBox(*m_xAsianSupportCB, bIsCJKFixed, m_bOldAsian);
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 0d617a8d3552..14263c10a782 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -90,6 +90,8 @@
#include <svl/flagitem.hxx>
#include <svl/intitem.hxx>
#include <svl/languageoptions.hxx>
+#include <svl/cjkoptions.hxx>
+#include <svl/ctloptions.hxx>
#include <svx/databaseregistrationui.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/urlobj.hxx>
@@ -1416,7 +1418,8 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
}
// Language options
- SvtLanguageOptions aLanguageOptions;
+ SvtCJKOptions aCJKLanguageOptions;
+ SvtCTLOptions aCTLLanguageOptions;
if ( !lcl_isOptionHidden( SID_LANGUAGE_OPTIONS, aOptionsDlgOpt ) )
{
setGroupName(u"LanguageSettings", CuiResId(SID_LANGUAGE_OPTIONS_RES[0].first));
@@ -1426,9 +1429,9 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
nPageId = static_cast<sal_uInt16>(SID_LANGUAGE_OPTIONS_RES[i].second);
if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
continue;
- if ( ( RID_SVXPAGE_JSEARCH_OPTIONS != nPageId || aLanguageOptions.IsJapaneseFindEnabled() ) &&
- ( RID_SVXPAGE_ASIAN_LAYOUT != nPageId || aLanguageOptions.IsAsianTypographyEnabled() ) &&
- ( RID_SVXPAGE_OPTIONS_CTL != nPageId || aLanguageOptions.IsCTLFontEnabled() ) )
+ if ( ( RID_SVXPAGE_JSEARCH_OPTIONS != nPageId || aCJKLanguageOptions.IsJapaneseFindEnabled() ) &&
+ ( RID_SVXPAGE_ASIAN_LAYOUT != nPageId || aCJKLanguageOptions.IsAsianTypographyEnabled() ) &&
+ ( RID_SVXPAGE_OPTIONS_CTL != nPageId || aCTLLanguageOptions.IsCTLFontEnabled() ) )
AddTabPage(nPageId, CuiResId(SID_LANGUAGE_OPTIONS_RES[i].first), nGroup);
}
}
@@ -1458,8 +1461,8 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
nPageId = static_cast<sal_uInt16>(SID_SW_EDITOPTIONS_RES[i].second);
if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
continue;
- if ( ( RID_SW_TP_STD_FONT_CJK != nPageId || aLanguageOptions.IsCJKFontEnabled() ) &&
- ( RID_SW_TP_STD_FONT_CTL != nPageId || aLanguageOptions.IsCTLFontEnabled() ) &&
+ if ( ( RID_SW_TP_STD_FONT_CJK != nPageId || aCJKLanguageOptions.IsCJKFontEnabled() ) &&
+ ( RID_SW_TP_STD_FONT_CTL != nPageId || aCTLLanguageOptions.IsCTLFontEnabled() ) &&
( RID_SW_TP_MAILCONFIG != nPageId || MailMergeCfg_Impl().IsEmailSupported() ) )
AddTabPage( nPageId, CuiResId(SID_SW_EDITOPTIONS_RES[i].first), nGroup );
}
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 42619a063d98..3eadffd81c65 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -33,6 +33,8 @@
#include <sfx2/module.hxx>
#include <svl/eitem.hxx>
#include <svl/languageoptions.hxx>
+#include <svl/cjkoptions.hxx>
+#include <svl/ctloptions.hxx>
#include <svx/SmartTagMgr.hxx>
#include <com/sun/star/smarttags/XSmartTagRecognizer.hpp>
#include <rtl/strbuf.hxx>
@@ -103,9 +105,9 @@ OfaAutoCorrDlg::OfaAutoCorrDlg(weld::Window* pParent, const SfxItemSet* _pSet )
//! will be set to LANGUAGE_UNDETERMINED
SvxLanguageListFlags nLangList = SvxLanguageListFlags::WESTERN;
- if( SvtLanguageOptions().IsCTLFontEnabled() )
+ if( SvtCTLOptions().IsCTLFontEnabled() )
nLangList |= SvxLanguageListFlags::CTL;
- if( SvtLanguageOptions().IsCJKFontEnabled() )
+ if( SvtCJKOptions().IsCJKFontEnabled() )
nLangList |= SvxLanguageListFlags::CJK;
m_xLanguageLB->SetLanguageList( nLangList, true, true );
m_xLanguageLB->set_active_id( LANGUAGE_NONE );
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 821dac2bad05..051ede05495e 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -24,6 +24,8 @@
#include <svx/svxids.hrc>
#include <svtools/unitconv.hxx>
#include <svl/languageoptions.hxx>
+#include <svl/cjkoptions.hxx>
+#include <svl/ctloptions.hxx>
#include <chardlg.hxx>
#include <editeng/fontitem.hxx>
#include <editeng/postitem.hxx>
@@ -218,9 +220,10 @@ SvxCharNamePage::SvxCharNamePage(weld::Container* pPage, weld::DialogController*
#endif
m_pImpl->m_aNoStyleText = CuiResId( RID_SVXSTR_CHARNAME_NOSTYLE );
- SvtLanguageOptions aLanguageOptions;
- bool bShowCJK = aLanguageOptions.IsCJKFontEnabled();
- bool bShowCTL = aLanguageOptions.IsCTLFontEnabled();
+ SvtCJKOptions aCJKLanguageOptions;
+ SvtCTLOptions aCTLLanguageOptions;
+ bool bShowCJK = aCJKLanguageOptions.IsCJKFontEnabled();
+ bool bShowCTL = aCTLLanguageOptions.IsCTLFontEnabled();
bool bShowNonWestern = bShowCJK || bShowCTL;
if (bShowNonWestern)
@@ -1415,7 +1418,7 @@ void SvxCharEffectsPage::Initialize()
m_xOutlineBtn->connect_toggled(LINK(this, SvxCharEffectsPage, OutlineBtnClickHdl));
m_xShadowBtn->connect_toggled(LINK(this, SvxCharEffectsPage, ShadowBtnClickHdl));
- if ( !SvtLanguageOptions().IsAsianTypographyEnabled() )
+ if ( !SvtCJKOptions().IsAsianTypographyEnabled() )
{
m_xEmphasisFT->hide();
m_xEmphasisLB->hide();
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index 44f29780904c..f3d0bfe79987 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -22,6 +22,8 @@
#include <sfx2/printer.hxx>
#include <sfx2/viewsh.hxx>
#include <svl/languageoptions.hxx>
+#include <svl/cjkoptions.hxx>
+#include <svl/ctloptions.hxx>
#include <svtools/unitconv.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
@@ -190,9 +192,10 @@ SvxPageDescPage::SvxPageDescPage(weld::Container* pPage, weld::DialogController*
// this page needs ExchangeSupport
SetExchangeSupport();
- SvtLanguageOptions aLangOptions;
- bool bCJK = aLangOptions.IsAsianTypographyEnabled();
- bool bCTL = aLangOptions.IsCTLFontEnabled();
+ SvtCTLOptions aCTLLanguageOptions;
+ SvtCJKOptions aCJKLanguageOptions;
+ bool bCJK = aCJKLanguageOptions.IsAsianTypographyEnabled();
+ bool bCTL = aCTLLanguageOptions.IsCTLFontEnabled();
bool bWeb = false;
const SfxPoolItem* pItem;
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 015853180882..d91507c81208 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -994,10 +994,10 @@ SvxParaAlignTabPage::SvxParaAlignTabPage(weld::Container* pPage, weld::DialogCon
{
SetExchangeSupport();
- SvtLanguageOptions aLangOptions;
+ SvtCJKOptions aCJKLanguageOptions;
sal_uInt16 nLastLinePos = LASTLINEPOS_DEFAULT;
- if ( aLangOptions.IsAsianTypographyEnabled() )
+ if ( aCJKLanguageOptions.IsAsianTypographyEnabled() )
{
m_xLeft->set_label(m_xLeftBottom->get_label());
m_xRight->set_label(m_xRightTop->get_label());
@@ -1326,7 +1326,7 @@ void SvxParaAlignTabPage::EnableJustifyExt()
m_xLastLineFT->show();
m_xLastLineLB->show();
m_xExpandCB->show();
- SvtLanguageOptions aCJKOptions;
+ SvtCJKOptions aCJKOptions;
if (aCJKOptions.IsAsianTypographyEnabled())
m_xSnapToGridCB->show();