summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-06-06 09:59:21 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-06-07 15:55:33 +0200
commitb542d90447230e1d6705a665f3a3e524fa966b5d (patch)
tree0c6a497714dd6c759ea4611528f4b70f11c8bba9 /svl
parent734d53534a6ca023e9c2eb819cde889b01818f1b (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 'svl')
-rw-r--r--svl/source/config/ctloptions.cxx39
1 files changed, 13 insertions, 26 deletions
diff --git a/svl/source/config/ctloptions.cxx b/svl/source/config/ctloptions.cxx
index 288761bd9394..eb636e0b4009 100644
--- a/svl/source/config/ctloptions.cxx
+++ b/svl/source/config/ctloptions.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <osl/mutex.hxx>
#include "itemholder2.hxx"
+#include <officecfg/Office/Common.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -60,24 +61,16 @@ public:
bool IsLoaded() const { return m_bIsLoaded; }
void SetCTLFontEnabled( bool _bEnabled );
- bool IsCTLFontEnabled() const { return m_bCTLFontEnabled; }
void SetCTLSequenceChecking( bool _bEnabled );
- bool IsCTLSequenceChecking() const { return m_bCTLSequenceChecking;}
void SetCTLSequenceCheckingRestricted( bool _bEnable );
- bool IsCTLSequenceCheckingRestricted() const { return m_bCTLRestricted; }
void SetCTLSequenceCheckingTypeAndReplace( bool _bEnable );
- bool IsCTLSequenceCheckingTypeAndReplace() const { return m_bCTLTypeAndReplace; }
void SetCTLCursorMovement( SvtCTLOptions::CursorMovement _eMovement );
- SvtCTLOptions::CursorMovement
- GetCTLCursorMovement() const { return m_eCTLCursorMovement; }
void SetCTLTextNumerals( SvtCTLOptions::TextNumerals _eNumerals );
- SvtCTLOptions::TextNumerals
- GetCTLTextNumerals() const { return m_eCTLTextNumerals; }
bool IsReadOnly(SvtCTLOptions::EOption eOption) const;
};
@@ -380,10 +373,9 @@ void SvtCTLOptions::SetCTLFontEnabled( bool _bEnabled )
m_pImpl->SetCTLFontEnabled( _bEnabled );
}
-bool SvtCTLOptions::IsCTLFontEnabled() const
+bool SvtCTLOptions::IsCTLFontEnabled()
{
- assert(m_pImpl->IsLoaded());
- return m_pImpl->IsCTLFontEnabled();
+ return officecfg::Office::Common::I18N::CTL::CTLFont::get();
}
void SvtCTLOptions::SetCTLSequenceChecking( bool _bEnabled )
@@ -392,10 +384,9 @@ void SvtCTLOptions::SetCTLSequenceChecking( bool _bEnabled )
m_pImpl->SetCTLSequenceChecking(_bEnabled);
}
-bool SvtCTLOptions::IsCTLSequenceChecking() const
+bool SvtCTLOptions::IsCTLSequenceChecking()
{
- assert(m_pImpl->IsLoaded());
- return m_pImpl->IsCTLSequenceChecking();
+ return officecfg::Office::Common::I18N::CTL::CTLSequenceChecking::get();
}
void SvtCTLOptions::SetCTLSequenceCheckingRestricted( bool _bEnable )
@@ -404,10 +395,9 @@ void SvtCTLOptions::SetCTLSequenceCheckingRestricted( bool _bEnable )
m_pImpl->SetCTLSequenceCheckingRestricted(_bEnable);
}
-bool SvtCTLOptions::IsCTLSequenceCheckingRestricted() const
+bool SvtCTLOptions::IsCTLSequenceCheckingRestricted()
{
- assert(m_pImpl->IsLoaded());
- return m_pImpl->IsCTLSequenceCheckingRestricted();
+ return officecfg::Office::Common::I18N::CTL::CTLSequenceCheckingRestricted::get();
}
void SvtCTLOptions::SetCTLSequenceCheckingTypeAndReplace( bool _bEnable )
@@ -416,10 +406,9 @@ void SvtCTLOptions::SetCTLSequenceCheckingTypeAndReplace( bool _bEnable )
m_pImpl->SetCTLSequenceCheckingTypeAndReplace(_bEnable);
}
-bool SvtCTLOptions::IsCTLSequenceCheckingTypeAndReplace() const
+bool SvtCTLOptions::IsCTLSequenceCheckingTypeAndReplace()
{
- assert(m_pImpl->IsLoaded());
- return m_pImpl->IsCTLSequenceCheckingTypeAndReplace();
+ return officecfg::Office::Common::I18N::CTL::CTLSequenceCheckingTypeAndReplace::get();
}
void SvtCTLOptions::SetCTLCursorMovement( SvtCTLOptions::CursorMovement _eMovement )
@@ -428,10 +417,9 @@ void SvtCTLOptions::SetCTLCursorMovement( SvtCTLOptions::CursorMovement _eMoveme
m_pImpl->SetCTLCursorMovement( _eMovement );
}
-SvtCTLOptions::CursorMovement SvtCTLOptions::GetCTLCursorMovement() const
+SvtCTLOptions::CursorMovement SvtCTLOptions::GetCTLCursorMovement()
{
- assert(m_pImpl->IsLoaded());
- return m_pImpl->GetCTLCursorMovement();
+ return static_cast<SvtCTLOptions::CursorMovement>(officecfg::Office::Common::I18N::CTL::CTLCursorMovement::get());
}
void SvtCTLOptions::SetCTLTextNumerals( SvtCTLOptions::TextNumerals _eNumerals )
@@ -440,10 +428,9 @@ void SvtCTLOptions::SetCTLTextNumerals( SvtCTLOptions::TextNumerals _eNumerals )
m_pImpl->SetCTLTextNumerals( _eNumerals );
}
-SvtCTLOptions::TextNumerals SvtCTLOptions::GetCTLTextNumerals() const
+SvtCTLOptions::TextNumerals SvtCTLOptions::GetCTLTextNumerals()
{
- assert(m_pImpl->IsLoaded());
- return m_pImpl->GetCTLTextNumerals();
+ return static_cast<SvtCTLOptions::TextNumerals>(officecfg::Office::Common::I18N::CTL::CTLTextNumerals::get());
}
bool SvtCTLOptions::IsReadOnly(EOption eOption) const