summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-08-14 13:43:51 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-08-14 16:46:14 +0200
commitba209b98f99b2b547dc94445efbc7263c47abf16 (patch)
treec3584cb03e85bf22ba46fe7bc705e8e789ab36ca /include
parentabe48a44ce80cd215a9cc18c219daf5e58e1f4e8 (diff)
Resolves: tdf#119251 parse non-default units in user inputted values
Change-Id: I28f8338f5c318f2228b742e2e171d53820cb0cc8 Reviewed-on: https://gerrit.libreoffice.org/58984 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/vcl/field.hxx2
-rw-r--r--include/vcl/weld.hxx2
2 files changed, 4 insertions, 0 deletions
diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx
index ff9eae27377e..1856bcefc649 100644
--- a/include/vcl/field.hxx
+++ b/include/vcl/field.hxx
@@ -241,6 +241,8 @@ public:
void SetCustomConvertHdl( const Link<MetricFormatter&,void>& rLink ) { maCustomConvertLink = rLink; }
static FieldUnit StringToMetric(const OUString &rMetricString);
+ static bool TextToValue(const OUString& rStr, double& rValue, sal_Int64 nBaseValue, sal_uInt16 nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper, FieldUnit eUnit);
+
protected:
sal_Int64 mnBaseValue;
FieldUnit meUnit;
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 443b916b5142..0277b3cfae6f 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -581,6 +581,7 @@ protected:
DECL_LINK(spin_button_value_changed, weld::SpinButton&, void);
DECL_LINK(spin_button_output, weld::SpinButton&, void);
+ DECL_LINK(spin_button_input, int* result, bool);
void signal_value_changed() { m_aValueChangedHdl.Call(*this); }
@@ -595,6 +596,7 @@ public:
{
update_width_chars();
m_xSpinButton->connect_output(LINK(this, MetricSpinButton, spin_button_output));
+ m_xSpinButton->connect_input(LINK(this, MetricSpinButton, spin_button_input));
m_xSpinButton->connect_value_changed(
LINK(this, MetricSpinButton, spin_button_value_changed));
}