summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-08-09 12:18:53 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-08-09 14:24:48 +0200
commitc060e063467555b69c55ba214b400bfc68c67c3e (patch)
treea37d6810cb465c19beae578c4504dba78b2b3aa9 /cui/source
parent6daaa1f1f7e675c142fb497711f907ccdcab2a8e (diff)
Resolves: tdf#126736 change range on change of unit
and make the max % 800 instead of 500 while we're at it (0.15cm is considered 100% FWIW) when flipping from measurement unit to % Change-Id: Ia1b15559f3db0d1e11d4563ad7c6aacc3f9ba32d Reviewed-on: https://gerrit.libreoffice.org/77192 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/tabpages/tplnedef.cxx15
1 files changed, 12 insertions, 3 deletions
diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx
index 40b89648cb6b..2325ac2f9a46 100644
--- a/cui/source/tabpages/tplnedef.cxx
+++ b/cui/source/tabpages/tplnedef.cxx
@@ -414,6 +414,11 @@ void SvxLineDefTabPage::ChangeMetricHdl_Impl(const weld::ToggleButton* p)
m_xMtrLength2->set_unit(eFUnit);
m_xMtrDistance->set_unit(eFUnit);
+ // tdf#126736 max 5cm
+ m_xMtrLength1->set_range(0, 500, FieldUnit::CM);
+ m_xMtrLength2->set_range(0, 500, FieldUnit::CM);
+ m_xMtrDistance->set_range(0, 500, FieldUnit::CM);
+
SetMetricValue( *m_xMtrLength1, nTmp1, ePoolUnit );
SetMetricValue( *m_xMtrLength2, nTmp2, ePoolUnit );
SetMetricValue( *m_xMtrDistance, nTmp3, ePoolUnit );
@@ -444,10 +449,14 @@ void SvxLineDefTabPage::ChangeMetricHdl_Impl(const weld::ToggleButton* p)
m_xMtrLength2->set_unit(FieldUnit::PERCENT);
m_xMtrDistance->set_unit(FieldUnit::PERCENT);
- SetMetricValue( *m_xMtrLength1, nTmp1, ePoolUnit );
- SetMetricValue( *m_xMtrLength2, nTmp2, ePoolUnit );
- SetMetricValue( *m_xMtrDistance, nTmp3, ePoolUnit );
+ // tdf#126736 800%
+ m_xMtrLength1->set_range(0, 800, FieldUnit::PERCENT);
+ m_xMtrLength2->set_range(0, 800, FieldUnit::PERCENT);
+ m_xMtrDistance->set_range(0, 800, FieldUnit::PERCENT);
+ m_xMtrLength1->set_value(nTmp1, FieldUnit::PERCENT);
+ m_xMtrLength2->set_value(nTmp2, FieldUnit::PERCENT);
+ m_xMtrDistance->set_value(nTmp3, FieldUnit::PERCENT);
}
SelectTypeHdl_Impl( nullptr );
}