summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-06-24 19:55:47 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-06-24 21:57:23 +0200
commit56b6013c9588f870ddc02c82ae1bbcbf856cb8c5 (patch)
tree55e3095628f9f1f64e95561b7843a7ff8c7f73c6 /sc
parentbcec35810326c09dccac168e0411c5bb42475732 (diff)
tdf#134280 set legal range for Epsilon level
Change-Id: If544da13913ab6ce84e934e351e4e2d78b6e1466 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97051 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/inc/solveroptions.hxx1
-rw-r--r--sc/source/ui/miscdlgs/solveroptions.cxx7
2 files changed, 8 insertions, 0 deletions
diff --git a/sc/source/ui/inc/solveroptions.hxx b/sc/source/ui/inc/solveroptions.hxx
index d58244eb27aa..48c58a6e628f 100644
--- a/sc/source/ui/inc/solveroptions.hxx
+++ b/sc/source/ui/inc/solveroptions.hxx
@@ -103,6 +103,7 @@ public:
void SetOptionName( const OUString& rName );
void SetValue( sal_Int32 nValue );
+ void SetMax( sal_Int32 nValue );
sal_Int32 GetValue() const;
};
diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx
index e22647b3d5f9..0a70023950ea 100644
--- a/sc/source/ui/miscdlgs/solveroptions.cxx
+++ b/sc/source/ui/miscdlgs/solveroptions.cxx
@@ -270,6 +270,8 @@ void ScSolverOptionsDialog::EditOption()
{
m_xIntDialog = std::make_shared<ScSolverIntegerDialog>(m_xDialog.get());
m_xIntDialog->SetOptionName( pStringItem->GetText() );
+ if (maProperties[nEntry].Name == "EpsilonLevel")
+ m_xIntDialog->SetMax(3);
m_xIntDialog->SetValue( pStringItem->GetIntValue() );
weld::DialogController::runAsync(m_xIntDialog, [nEntry, pStringItem, this](sal_Int32 nResult){
if (nResult == RET_OK)
@@ -349,6 +351,11 @@ void ScSolverIntegerDialog::SetValue( sal_Int32 nValue )
m_xNfValue->set_value( nValue );
}
+void ScSolverIntegerDialog::SetMax( sal_Int32 nMax )
+{
+ m_xNfValue->set_range(0, nMax);
+}
+
sal_Int32 ScSolverIntegerDialog::GetValue() const
{
return m_xNfValue->get_value();