diff options
author | Dennis Francis <dennis.francis@collabora.co.uk> | 2017-12-19 08:55:46 +0530 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-12-19 20:33:31 +0100 |
commit | c7f528bbc8ad70fb869736ea810534e8210284b5 (patch) | |
tree | cc5c1b99b0f7d7ebb3954cd9ef6686d4c919fb18 /sc/source/ui/optdlg/tpcalc.cxx | |
parent | 7978eb8f6efa64fb0d5fba993f029793672a78ba (diff) |
Add UI config option to enable/disable threading
Change-Id: I7a83d80c0db233a48026d1254021b926f28002f3
Reviewed-on: https://gerrit.libreoffice.org/46782
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sc/source/ui/optdlg/tpcalc.cxx')
-rw-r--r-- | sc/source/ui/optdlg/tpcalc.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx index 541a63096e1b..4ec601a23ac6 100644 --- a/sc/source/ui/optdlg/tpcalc.cxx +++ b/sc/source/ui/optdlg/tpcalc.cxx @@ -63,6 +63,7 @@ ScTpCalcOptions::ScTpCalcOptions(vcl::Window* pParent, const SfxItemSet& rCoreAt get(m_pBtnGeneralPrec, "generalprec"); get(m_pFtPrec, "precft"); get(m_pEdPrec, "prec"); + get(m_pBtnThread, "threadingenabled"); Init(); SetExchangeSupport(); } @@ -94,6 +95,7 @@ void ScTpCalcOptions::dispose() m_pBtnGeneralPrec.clear(); m_pFtPrec.clear(); m_pEdPrec.clear(); + m_pBtnThread.clear(); SfxTabPage::dispose(); } @@ -104,6 +106,7 @@ void ScTpCalcOptions::Init() m_pBtnDateStd->SetClickHdl( LINK( this, ScTpCalcOptions, RadioClickHdl ) ); m_pBtnDateSc10->SetClickHdl( LINK( this, ScTpCalcOptions, RadioClickHdl ) ); m_pBtnDate1904->SetClickHdl( LINK( this, ScTpCalcOptions, RadioClickHdl ) ); + m_pBtnThread->SetClickHdl( LINK( this, ScTpCalcOptions, CheckClickHdl ) ); } VclPtr<SfxTabPage> ScTpCalcOptions::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ) @@ -180,6 +183,9 @@ void ScTpCalcOptions::Reset( const SfxItemSet* /* rCoreAttrs */ ) m_pEdPrec->SetValue(nPrec); } + m_pBtnThread->Enable(); + m_pBtnThread->Check( officecfg::Office::Calc::Formula::Calculation::UseThreadedCalculationForFormulaGroups::get() ); + CheckClickHdl(m_pBtnIterate); } @@ -200,6 +206,13 @@ bool ScTpCalcOptions::FillItemSet( SfxItemSet* rCoreAttrs ) else pLocalOptions->SetStdPrecision( SvNumberFormatter::UNLIMITED_PRECISION ); + bool bShouldEnableThreading = m_pBtnThread->IsChecked(); + if (bShouldEnableThreading != officecfg::Office::Calc::Formula::Calculation::UseThreadedCalculationForFormulaGroups::get()) + { + std::shared_ptr<comphelper::ConfigurationChanges> xBatch(comphelper::ConfigurationChanges::create()); + officecfg::Office::Calc::Formula::Calculation::UseThreadedCalculationForFormulaGroups::set(bShouldEnableThreading, xBatch); + xBatch->commit(); + } if ( *pLocalOptions != *pOldOptions ) { rCoreAttrs->Put( ScTpCalcItem( nWhichCalc, *pLocalOptions ) ); |