summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.co.uk>2017-12-19 08:55:46 +0530
committerMichael Meeks <michael.meeks@collabora.com>2017-12-22 11:08:13 +0100
commit670fa15f3d26dc93bd507990f94d14bf93a0c94c (patch)
tree1ee074d5f25e918c7530ae5119d9b9761801d5eb /sc/source/ui
parente518a58dad658cd8aaad10a11816e35ab8bfa07c (diff)
Add UI config option to enable/disable threading.
Clarify that this is experimental. Change-Id: I7a83d80c0db233a48026d1254021b926f28002f3 Reviewed-on: https://gerrit.libreoffice.org/46782 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/46937 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/inc/tpcalc.hxx2
-rw-r--r--sc/source/ui/optdlg/tpcalc.cxx13
2 files changed, 15 insertions, 0 deletions
diff --git a/sc/source/ui/inc/tpcalc.hxx b/sc/source/ui/inc/tpcalc.hxx
index 4cb10646da01..3108604820a9 100644
--- a/sc/source/ui/inc/tpcalc.hxx
+++ b/sc/source/ui/inc/tpcalc.hxx
@@ -68,6 +68,8 @@ private:
VclPtr<FixedText> m_pFtPrec;
VclPtr<NumericField> m_pEdPrec;
+ VclPtr<CheckBox> m_pBtnThread;
+
ScDocOptions* pOldOptions;
ScDocOptions* pLocalOptions;
sal_uInt16 nWhichCalc;
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 ) );