diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-26 14:45:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-28 08:38:52 +0200 |
commit | d8fec570c21c5e45ba593ee96cc1ba5d45d77fc8 (patch) | |
tree | da5f5eed2c066325c409e64366b4569a54fb1791 /cui | |
parent | 3808418e38fe9540a286ad48f1c3eaed2706f78c (diff) |
use officecfg for SvtCJKOptions
and remove some unused options
Change-Id: I487a233de4f7414012e5405f2c2e1f9c8b8fb4f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119554
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/cuifmsearch.cxx | 9 | ||||
-rw-r--r-- | cui/source/dialogs/srchxtra.cxx | 5 | ||||
-rw-r--r-- | cui/source/options/optgdlg.cxx | 11 | ||||
-rw-r--r-- | cui/source/options/treeopt.cxx | 7 | ||||
-rw-r--r-- | cui/source/tabpages/align.cxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/autocdlg.cxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/chardlg.cxx | 5 | ||||
-rw-r--r-- | cui/source/tabpages/page.cxx | 3 | ||||
-rw-r--r-- | cui/source/tabpages/paragrph.cxx | 9 | ||||
-rw-r--r-- | cui/source/tabpages/tabstpge.cxx | 5 |
10 files changed, 23 insertions, 35 deletions
diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx index 050dc31dc14b..d6e223dc0d19 100644 --- a/cui/source/dialogs/cuifmsearch.cxx +++ b/cui/source/dialogs/cuifmsearch.cxx @@ -47,15 +47,14 @@ void FmSearchDialog::initCommon( const Reference< XResultSet >& _rxCursor ) m_pSearchEngine->SetProgressHandler(LINK(this, FmSearchDialog, OnSearchProgress)); // some layout changes according to available CJK options - SvtCJKOptions aCJKOptions; - if (!aCJKOptions.IsJapaneseFindEnabled()) + if (!SvtCJKOptions::IsJapaneseFindEnabled()) { // hide the options for the japanese search m_pSoundsLikeCJK->hide(); m_pSoundsLikeCJKSettings->hide(); } - if (!aCJKOptions.IsCJKFontEnabled()) + if (!SvtCJKOptions::IsCJKFontEnabled()) { m_pHalfFullFormsCJK->hide(); @@ -442,7 +441,7 @@ IMPL_LINK(FmSearchDialog, OnCheckBoxToggled, weld::Toggleable&, rBox, void) bool bEnable = ( m_prbSearchForText->get_active() && !m_pSoundsLikeCJK->get_active() ) - || !SvtCJKOptions().IsJapaneseFindEnabled(); + || !SvtCJKOptions::IsJapaneseFindEnabled(); m_pcbCase->set_sensitive(bEnable); m_pHalfFullFormsCJK->set_sensitive(bEnable); @@ -536,7 +535,7 @@ void FmSearchDialog::EnableSearchForDependees(bool bEnable) bEnable = bEnable && bSearchingForText; - bool bEnableRedundants = !m_pSoundsLikeCJK->get_active() || !SvtCJKOptions().IsJapaneseFindEnabled(); + bool bEnableRedundants = !m_pSoundsLikeCJK->get_active() || !SvtCJKOptions::IsJapaneseFindEnabled(); m_pcmbSearchText->set_sensitive(bEnable); m_pftPosition->set_sensitive(bEnable && !m_pcbWildCard->get_active()); diff --git a/cui/source/dialogs/srchxtra.cxx b/cui/source/dialogs/srchxtra.cxx index 384acbc1d566..d857f77c42df 100644 --- a/cui/source/dialogs/srchxtra.cxx +++ b/cui/source/dialogs/srchxtra.cxx @@ -49,10 +49,9 @@ SvxSearchFormatDialog::SvxSearchFormatDialog(weld::Window* pParent, const SfxIte AddTabPage("background", SvxBkgTabPage::Create, nullptr); // remove asian tabpages if necessary - SvtCJKOptions aCJKOptions; - if ( !aCJKOptions.IsDoubleLinesEnabled() ) + if ( !SvtCJKOptions::IsDoubleLinesEnabled() ) RemoveTabPage("asianlayout"); - if ( !aCJKOptions.IsAsianTypographyEnabled() ) + if ( !SvtCJKOptions::IsAsianTypographyEnabled() ) RemoveTabPage("labelTP_PARA_ASIAN"); } diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index ba3d77e88da5..b1c2ac5b4adc 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -987,7 +987,6 @@ void OfaViewTabPage::UpdateHardwareAccelStatus() struct LanguageConfig_Impl { - SvtCJKOptions aCJKLanguageOptions; SvtCTLOptions aCTLLanguageOptions; SvtSysLocaleOptions aSysLocaleOptions; SvtLinguConfig aLinguConfig; @@ -1186,10 +1185,10 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(weld::Container* pPage, weld::DialogCon m_xAsianSupportCB->connect_toggled( aLink ); m_xCTLSupportCB->connect_toggled( aLink ); - m_bOldAsian = pLangConfig->aCJKLanguageOptions.IsAnyEnabled(); + m_bOldAsian = SvtCJKOptions::IsAnyEnabled(); m_xAsianSupportCB->set_active(m_bOldAsian); m_xAsianSupportCB->save_state(); - bool bReadonly = pLangConfig->aCJKLanguageOptions.IsReadOnly(SvtCJKOptions::E_ALL); + bool bReadonly = SvtCJKOptions::IsReadOnly(SvtCJKOptions::E_ALL); m_xAsianSupportCB->set_sensitive(!bReadonly); SupportHdl(*m_xAsianSupportCB); @@ -1235,7 +1234,6 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet ) // lock configuration broadcasters so that we can coordinate the notifications pLangConfig->aSysLocaleOptions.BlockBroadcasts( true ); pLangConfig->aCTLLanguageOptions.BlockBroadcasts( true ); - pLangConfig->aCJKLanguageOptions.BlockBroadcasts( true ); pLangConfig->aLinguConfig.BlockBroadcasts( true ); /* @@ -1425,7 +1423,7 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet ) if(m_xAsianSupportCB->get_state_changed_from_saved() ) { bool bChecked = m_xAsianSupportCB->get_active(); - pLangConfig->aCJKLanguageOptions.SetAll(bChecked); + SvtCJKOptions::SetAll(bChecked); //iterate over all bindings to invalidate vertical text direction const sal_uInt16 STATE_COUNT = 2; @@ -1464,7 +1462,6 @@ 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->aCJKLanguageOptions.BlockBroadcasts( false ); pLangConfig->aCTLLanguageOptions.BlockBroadcasts( false ); pLangConfig->aLinguConfig.BlockBroadcasts( false ); @@ -1672,7 +1669,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->aCJKLanguageOptions.IsReadOnly(SvtCJKOptions::E_ALL)) + if(!SvtCJKOptions::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 14263c10a782..38cbe4952de5 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -1418,7 +1418,6 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame ) } // Language options - SvtCJKOptions aCJKLanguageOptions; SvtCTLOptions aCTLLanguageOptions; if ( !lcl_isOptionHidden( SID_LANGUAGE_OPTIONS, aOptionsDlgOpt ) ) { @@ -1429,8 +1428,8 @@ 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 || aCJKLanguageOptions.IsJapaneseFindEnabled() ) && - ( RID_SVXPAGE_ASIAN_LAYOUT != nPageId || aCJKLanguageOptions.IsAsianTypographyEnabled() ) && + if ( ( RID_SVXPAGE_JSEARCH_OPTIONS != nPageId || SvtCJKOptions::IsJapaneseFindEnabled() ) && + ( RID_SVXPAGE_ASIAN_LAYOUT != nPageId || SvtCJKOptions::IsAsianTypographyEnabled() ) && ( RID_SVXPAGE_OPTIONS_CTL != nPageId || aCTLLanguageOptions.IsCTLFontEnabled() ) ) AddTabPage(nPageId, CuiResId(SID_LANGUAGE_OPTIONS_RES[i].first), nGroup); } @@ -1461,7 +1460,7 @@ 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 || aCJKLanguageOptions.IsCJKFontEnabled() ) && + if ( ( RID_SW_TP_STD_FONT_CJK != nPageId || SvtCJKOptions::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/align.cxx b/cui/source/tabpages/align.cxx index a49a115a13b5..a57abd2b949e 100644 --- a/cui/source/tabpages/align.cxx +++ b/cui/source/tabpages/align.cxx @@ -150,7 +150,7 @@ AlignmentTabPage::AlignmentTabPage(weld::Container* pPage, weld::DialogControlle m_xBtnShrink->connect_toggled(LINK(this, AlignmentTabPage, ShrinkClickHdl)); // Asian vertical mode - m_xCbAsianMode->set_visible(SvtCJKOptions().IsVerticalTextEnabled()); + m_xCbAsianMode->set_visible(SvtCJKOptions::IsVerticalTextEnabled()); m_xLbFrameDir->append(SvxFrameDirection::Horizontal_LR_TB, SvxResId(RID_SVXSTR_FRAMEDIR_LTR)); m_xLbFrameDir->append(SvxFrameDirection::Horizontal_RL_TB, SvxResId(RID_SVXSTR_FRAMEDIR_RTL)); diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 3eadffd81c65..e632a1b3be49 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -107,7 +107,7 @@ OfaAutoCorrDlg::OfaAutoCorrDlg(weld::Window* pParent, const SfxItemSet* _pSet ) if( SvtCTLOptions().IsCTLFontEnabled() ) nLangList |= SvxLanguageListFlags::CTL; - if( SvtCJKOptions().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 051ede05495e..c0794c0bec03 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -220,9 +220,8 @@ SvxCharNamePage::SvxCharNamePage(weld::Container* pPage, weld::DialogController* #endif m_pImpl->m_aNoStyleText = CuiResId( RID_SVXSTR_CHARNAME_NOSTYLE ); - SvtCJKOptions aCJKLanguageOptions; SvtCTLOptions aCTLLanguageOptions; - bool bShowCJK = aCJKLanguageOptions.IsCJKFontEnabled(); + bool bShowCJK = SvtCJKOptions::IsCJKFontEnabled(); bool bShowCTL = aCTLLanguageOptions.IsCTLFontEnabled(); bool bShowNonWestern = bShowCJK || bShowCTL; @@ -1418,7 +1417,7 @@ void SvxCharEffectsPage::Initialize() m_xOutlineBtn->connect_toggled(LINK(this, SvxCharEffectsPage, OutlineBtnClickHdl)); m_xShadowBtn->connect_toggled(LINK(this, SvxCharEffectsPage, ShadowBtnClickHdl)); - if ( !SvtCJKOptions().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 f3d0bfe79987..29d8f85b918a 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -193,8 +193,7 @@ SvxPageDescPage::SvxPageDescPage(weld::Container* pPage, weld::DialogController* SetExchangeSupport(); SvtCTLOptions aCTLLanguageOptions; - SvtCJKOptions aCJKLanguageOptions; - bool bCJK = aCJKLanguageOptions.IsAsianTypographyEnabled(); + bool bCJK = SvtCJKOptions::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 d91507c81208..6726da03961d 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -409,8 +409,7 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* rSet ) bool bApplyCharUnit = GetApplyCharUnit( *rSet ); - SvtCJKOptions aCJKOptions; - if(aCJKOptions.IsAsianTypographyEnabled() && bApplyCharUnit ) + if(SvtCJKOptions::IsAsianTypographyEnabled() && bApplyCharUnit ) eFUnit = FieldUnit::CHAR; m_xLeftIndent->SetFieldUnit(eFUnit); @@ -994,10 +993,9 @@ SvxParaAlignTabPage::SvxParaAlignTabPage(weld::Container* pPage, weld::DialogCon { SetExchangeSupport(); - SvtCJKOptions aCJKLanguageOptions; sal_uInt16 nLastLinePos = LASTLINEPOS_DEFAULT; - if ( aCJKLanguageOptions.IsAsianTypographyEnabled() ) + if ( SvtCJKOptions::IsAsianTypographyEnabled() ) { m_xLeft->set_label(m_xLeftBottom->get_label()); m_xRight->set_label(m_xRightTop->get_label()); @@ -1326,8 +1324,7 @@ void SvxParaAlignTabPage::EnableJustifyExt() m_xLastLineFT->show(); m_xLastLineLB->show(); m_xExpandCB->show(); - SvtCJKOptions aCJKOptions; - if (aCJKOptions.IsAsianTypographyEnabled()) + if (SvtCJKOptions::IsAsianTypographyEnabled()) m_xSnapToGridCB->show(); } diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx index 762e3ab92baa..7a4beeb8437e 100644 --- a/cui/source/tabpages/tabstpge.cxx +++ b/cui/source/tabpages/tabstpge.cxx @@ -90,9 +90,8 @@ SvxTabulatorTabPage::SvxTabulatorTabPage(weld::Container* pPage, weld::DialogCon m_aCenterWin.SetTabStyle(sal_uInt16(RULER_TAB_CENTER|WB_HORZ)); m_aDezWin.SetTabStyle(sal_uInt16(RULER_TAB_DECIMAL|WB_HORZ)); //upper radiobuttons - SvtCJKOptions aCJKOptions; - m_xLeftTab = m_xBuilder->weld_radio_button(aCJKOptions.IsAsianTypographyEnabled() ? "radiobuttonST_LEFTTAB_ASIAN" : "radiobuttonBTN_TABTYPE_LEFT"); - m_xRightTab = m_xBuilder->weld_radio_button(aCJKOptions.IsAsianTypographyEnabled() ? "radiobuttonST_RIGHTTAB_ASIAN" : "radiobuttonBTN_TABTYPE_RIGHT"); + m_xLeftTab = m_xBuilder->weld_radio_button(SvtCJKOptions::IsAsianTypographyEnabled() ? "radiobuttonST_LEFTTAB_ASIAN" : "radiobuttonBTN_TABTYPE_LEFT"); + m_xRightTab = m_xBuilder->weld_radio_button(SvtCJKOptions::IsAsianTypographyEnabled() ? "radiobuttonST_RIGHTTAB_ASIAN" : "radiobuttonBTN_TABTYPE_RIGHT"); m_xLeftTab->show(); m_xRightTab->show(); |