summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorGabor Kelemen <kelemeng@ubuntu.com>2018-08-02 01:02:56 +0200
committerEike Rathke <erack@redhat.com>2019-10-01 21:56:22 +0200
commitdc1f304de78ccf20b3264cbc904d65f78864ec63 (patch)
tree381e9b511af2c9065295cbb9befcef4fef841b97 /sc
parent357e8bdfc15eea083d8a8699ecc2de9a8a615c23 (diff)
tdf#119021 Support lock down settings of Formula tab page
Change-Id: I3131e8fd98b43cf4073970444589e8fae9553bc1 Reviewed-on: https://gerrit.libreoffice.org/75402 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/oox/workbookfragment.cxx4
-rw-r--r--sc/source/ui/docshell/docsh.cxx4
-rw-r--r--sc/source/ui/optdlg/calcoptionsdlg.cxx5
-rw-r--r--sc/source/ui/optdlg/tpformula.cxx12
4 files changed, 25 insertions, 0 deletions
diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx
index 540c2b3b89de..7e7edc655a59 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -525,6 +525,7 @@ public:
{
}
bool get_active() const { return m_xWarningOnBox->get_active(); }
+ void hide_ask() const { m_xWarningOnBox->set_visible(false); };
};
}
@@ -547,6 +548,9 @@ void WorkbookFragment::recalcFormulaCells()
aQueryBox.set_primary_text(ScResId(STR_QUERY_FORMULA_RECALC_ONLOAD_XLS));
aQueryBox.set_default_response(RET_YES);
+ if ( officecfg::Office::Calc::Formula::Load::OOXMLRecalcMode::isReadOnly() )
+ aQueryBox.hide_ask();
+
bHardRecalc = aQueryBox.run() == RET_YES;
if (aQueryBox.get_active())
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 42b538035405..0fce15e67a72 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -433,6 +433,7 @@ public:
{
}
bool get_active() const { return m_xWarningOnBox->get_active(); }
+ void hide_ask() const { m_xWarningOnBox->set_visible(false); };
};
@@ -511,6 +512,9 @@ bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const css::uno::Reference< css
aQueryBox.set_primary_text(ScResId(STR_QUERY_FORMULA_RECALC_ONLOAD_ODS));
aQueryBox.set_default_response(RET_YES);
+ if ( officecfg::Office::Calc::Formula::Load::OOXMLRecalcMode::isReadOnly() )
+ aQueryBox.hide_ask();
+
bHardRecalc = aQueryBox.run() == RET_YES;
if (aQueryBox.get_active())
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx
index 43533c4df530..a3e9d73935d1 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.cxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx
@@ -9,6 +9,8 @@
#include <sal/config.h>
+#include <officecfg/Office/Calc.hxx>
+
#include <calcconfig.hxx>
#include "calcoptionsdlg.hxx"
@@ -66,13 +68,16 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(weld::Window* pParent, const ScCalcConf
{
mxConversion->set_active(static_cast<int>(rConfig.meStringConversion));
mxConversion->connect_changed(LINK(this, ScCalcOptionsDialog, ConversionModifiedHdl));
+ mxConversion->set_sensitive( !officecfg::Office::Calc::Formula::Syntax::StringConversion::isReadOnly() );
mxEmptyAsZero->set_active(rConfig.mbEmptyStringAsZero);
mxEmptyAsZero->connect_toggled(LINK(this, ScCalcOptionsDialog, AsZeroModifiedHdl));
CoupleEmptyAsZeroToStringConversion();
+ mxEmptyAsZero->set_sensitive ( !officecfg::Office::Calc::Formula::Syntax::EmptyStringAsZero::isReadOnly() );
mxSyntax->set_active(toSelectedItem(rConfig.meStringRefAddressSyntax));
mxSyntax->connect_changed(LINK(this, ScCalcOptionsDialog, SyntaxModifiedHdl));
+ mxSyntax->set_sensitive ( !officecfg::Office::Calc::Formula::Syntax::StringRefAddressSyntax::isReadOnly() );
mxCurrentDocOnly->set_active(!mbWriteConfig);
mxCurrentDocOnly->connect_toggled(LINK(this, ScCalcOptionsDialog, CurrentDocOnlyHdl));
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
index c745d748bfb0..b4825149ae58 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -26,6 +26,7 @@
#include <strings.hrc>
#include <scresid.hxx>
#include <formula/grammar.hxx>
+#include <officecfg/Office/Calc.hxx>
#include "calcoptionsdlg.hxx"
#include <unotools/localedatawrapper.hxx>
@@ -299,18 +300,22 @@ void ScTpFormulaOptions::Reset(const SfxItemSet* rCoreSet)
}
mxLbFormulaSyntax->save_value();
+ mxLbFormulaSyntax->set_sensitive( !officecfg::Office::Calc::Formula::Syntax::Grammar::isReadOnly() );
ScRecalcOptions eOOXMLRecalc = aOpt.GetOOXMLRecalcOptions();
mxLbOOXMLRecalcOptions->set_active(static_cast<sal_uInt16>(eOOXMLRecalc));
mxLbOOXMLRecalcOptions->save_value();
+ mxLbOOXMLRecalcOptions->set_sensitive( !officecfg::Office::Calc::Formula::Load::OOXMLRecalcMode::isReadOnly() );
ScRecalcOptions eODFRecalc = aOpt.GetODFRecalcOptions();
mxLbODFRecalcOptions->set_active(static_cast<sal_uInt16>(eODFRecalc));
mxLbODFRecalcOptions->save_value();
+ mxLbODFRecalcOptions->set_sensitive( !officecfg::Office::Calc::Formula::Load::ODFRecalcMode::isReadOnly() );
// english function name.
mxCbEnglishFuncName->set_active( aOpt.GetUseEnglishFuncName() );
mxCbEnglishFuncName->save_state();
+ mxCbEnglishFuncName->set_sensitive( !officecfg::Office::Calc::Formula::Syntax::EnglishFunctionName::isReadOnly() );
// Separators
OUString aSep = aOpt.GetFormulaSepArg();
@@ -331,6 +336,13 @@ void ScTpFormulaOptions::Reset(const SfxItemSet* rCoreSet)
else
ResetSeparators();
+ mxEdSepFuncArg->set_sensitive( !officecfg::Office::Calc::Formula::Syntax::SeparatorArg::isReadOnly() );
+ mxEdSepArrayCol->set_sensitive( !officecfg::Office::Calc::Formula::Syntax::SeparatorArrayCol::isReadOnly() );
+ mxEdSepArrayRow->set_sensitive( !officecfg::Office::Calc::Formula::Syntax::SeparatorArrayRow::isReadOnly() );
+ mxBtnSepReset->set_sensitive ( !officecfg::Office::Calc::Formula::Syntax::SeparatorArg::isReadOnly() &&
+ !officecfg::Office::Calc::Formula::Syntax::SeparatorArrayCol::isReadOnly() &&
+ !officecfg::Office::Calc::Formula::Syntax::SeparatorArrayRow::isReadOnly() );
+
// detailed calc settings.
ScFormulaOptions aDefaults;