diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-06-06 09:59:21 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-06-07 15:55:33 +0200 |
commit | b542d90447230e1d6705a665f3a3e524fa966b5d (patch) | |
tree | 0c6a497714dd6c759ea4611528f4b70f11c8bba9 /cui | |
parent | 734d53534a6ca023e9c2eb819cde889b01818f1b (diff) |
tdf#155376 partially convert SvCTLOptions to officecfg
When accessibility is enabled, Calc will add tens of thousands of
listeners.
We then spend a significant chunk of time creating SvCTLOptions objects
(attached to ImpEditEngine) and adding and removing those objects from
the related listener lists.
But the required information is already globally cached by the officecfg
module, so we can avoid that overhead and just fetch it directly from
officecfg.
Change-Id: I7ff55fd7c4926866eb7086812275ba8bd6e84c75
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152645
Tested-by: Jenkins
Reviewed-by: Patrick Luby <plubius@neooffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/optctl.cxx | 12 | ||||
-rw-r--r-- | cui/source/options/optgdlg.cxx | 2 | ||||
-rw-r--r-- | cui/source/options/treeopt.cxx | 5 | ||||
-rw-r--r-- | cui/source/tabpages/autocdlg.cxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/chardlg.cxx | 3 | ||||
-rw-r--r-- | cui/source/tabpages/page.cxx | 3 |
6 files changed, 11 insertions, 16 deletions
diff --git a/cui/source/options/optctl.cxx b/cui/source/options/optctl.cxx index 52bd18fc8788..869879c28525 100644 --- a/cui/source/options/optctl.cxx +++ b/cui/source/options/optctl.cxx @@ -106,13 +106,11 @@ bool SvxCTLOptionsPage::FillItemSet( SfxItemSet* ) void SvxCTLOptionsPage::Reset( const SfxItemSet* ) { - SvtCTLOptions aCTLOptions; - - m_xSequenceCheckingCB->set_active( aCTLOptions.IsCTLSequenceChecking() ); - m_xRestrictedCB->set_active( aCTLOptions.IsCTLSequenceCheckingRestricted() ); - m_xTypeReplaceCB->set_active( aCTLOptions.IsCTLSequenceCheckingTypeAndReplace() ); + m_xSequenceCheckingCB->set_active( SvtCTLOptions::IsCTLSequenceChecking() ); + m_xRestrictedCB->set_active( SvtCTLOptions::IsCTLSequenceCheckingRestricted() ); + m_xTypeReplaceCB->set_active( SvtCTLOptions::IsCTLSequenceCheckingTypeAndReplace() ); - SvtCTLOptions::CursorMovement eMovement = aCTLOptions.GetCTLCursorMovement(); + SvtCTLOptions::CursorMovement eMovement = SvtCTLOptions::GetCTLCursorMovement(); switch ( eMovement ) { case SvtCTLOptions::MOVEMENT_LOGICAL : @@ -127,7 +125,7 @@ void SvxCTLOptionsPage::Reset( const SfxItemSet* ) SAL_WARN( "cui.options", "SvxCTLOptionsPage::Reset(): invalid movement enum" ); } - sal_uInt16 nPos = static_cast<sal_uInt16>(aCTLOptions.GetCTLTextNumerals()); + sal_uInt16 nPos = static_cast<sal_uInt16>(SvtCTLOptions::GetCTLTextNumerals()); DBG_ASSERT( nPos < m_xNumeralsLB->get_count(), "SvxCTLOptionsPage::Reset(): invalid numerals enum" ); m_xNumeralsLB->set_active(nPos); diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 5819171001af..ecd671ef2c31 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -1169,7 +1169,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(weld::Container* pPage, weld::DialogCon m_xAsianSupportCB->set_sensitive(!bReadonly); SupportHdl(*m_xAsianSupportCB); - m_bOldCtl = pLangConfig->aCTLLanguageOptions.IsCTLFontEnabled(); + m_bOldCtl = SvtCTLOptions::IsCTLFontEnabled(); m_xCTLSupportCB->set_active(m_bOldCtl); m_xCTLSupportCB->save_state(); bReadonly = pLangConfig->aCTLLanguageOptions.IsReadOnly(SvtCTLOptions::E_CTLFONT); diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index 98d8a3e77c7d..d3c65eb0c847 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -1369,7 +1369,6 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame ) } // Language options - SvtCTLOptions aCTLLanguageOptions; if ( !lcl_isOptionHidden( SID_LANGUAGE_OPTIONS, aOptionsDlgOpt ) ) { setGroupName(u"LanguageSettings", CuiResId(SID_LANGUAGE_OPTIONS_RES[0].first)); @@ -1389,7 +1388,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame ) if ( ( RID_SVXPAGE_JSEARCH_OPTIONS != nPageId || SvtCJKOptions::IsJapaneseFindEnabled() ) && ( RID_SVXPAGE_ASIAN_LAYOUT != nPageId || SvtCJKOptions::IsAsianTypographyEnabled() ) && - ( RID_SVXPAGE_OPTIONS_CTL != nPageId || aCTLLanguageOptions.IsCTLFontEnabled() ) ) + ( RID_SVXPAGE_OPTIONS_CTL != nPageId || SvtCTLOptions::IsCTLFontEnabled() ) ) AddTabPage(nPageId, CuiResId(SID_LANGUAGE_OPTIONS_RES[i].first), nGroup); } } @@ -1420,7 +1419,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame ) if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) ) continue; if ( ( RID_SW_TP_STD_FONT_CJK != nPageId || SvtCJKOptions::IsCJKFontEnabled() ) && - ( RID_SW_TP_STD_FONT_CTL != nPageId || aCTLLanguageOptions.IsCTLFontEnabled() ) && + ( RID_SW_TP_STD_FONT_CTL != nPageId || SvtCTLOptions::IsCTLFontEnabled() ) && ( RID_SW_TP_MAILCONFIG != nPageId || MailMergeCfgIsEmailSupported() ) ) 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 38a261ad5737..378fb68c4143 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 ) //! will be set to LANGUAGE_UNDETERMINED SvxLanguageListFlags nLangList = SvxLanguageListFlags::WESTERN; - if( SvtCTLOptions().IsCTLFontEnabled() ) + if( SvtCTLOptions::IsCTLFontEnabled() ) nLangList |= SvxLanguageListFlags::CTL; if( SvtCJKOptions::IsCJKFontEnabled() ) nLangList |= SvxLanguageListFlags::CJK; diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index ace220bcc5c0..79cb8d454e39 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -245,9 +245,8 @@ SvxCharNamePage::SvxCharNamePage(weld::Container* pPage, weld::DialogController* m_xEastFontNameLB = std::move(xCJKFontName); m_xCTLFontNameLB = std::move(xCTLFontName); - SvtCTLOptions aCTLLanguageOptions; bool bShowCJK = SvtCJKOptions::IsCJKFontEnabled(); - bool bShowCTL = aCTLLanguageOptions.IsCTLFontEnabled(); + bool bShowCTL = SvtCTLOptions::IsCTLFontEnabled(); bool bShowNonWestern = bShowCJK || bShowCTL; if (!bShowNonWestern) { diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index d40fef92e8f6..d810a9471dce 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -191,9 +191,8 @@ SvxPageDescPage::SvxPageDescPage(weld::Container* pPage, weld::DialogController* // this page needs ExchangeSupport SetExchangeSupport(); - SvtCTLOptions aCTLLanguageOptions; bool bCJK = SvtCJKOptions::IsAsianTypographyEnabled(); - bool bCTL = aCTLLanguageOptions.IsCTLFontEnabled(); + bool bCTL = SvtCTLOptions::IsCTLFontEnabled(); bool bWeb = false; const SfxUInt16Item* pHtmlModeItem = rAttr.GetItemIfSet(SID_HTML_MODE, false); |