[Libreoffice-commits] core.git: include/vcl vcl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Nov 15 17:15:00 UTC 2018
include/vcl/weld.hxx | 6 +-----
vcl/source/window/builder.cxx | 12 ++++++++++++
2 files changed, 13 insertions(+), 5 deletions(-)
New commits:
commit 9e0a099fb66c303bec0489198ba7cfe770b28684
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Nov 15 14:34:28 2018 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Nov 15 18:14:34 2018 +0100
reformat when the unit changes
Change-Id: I2252a5bc4c3b495c35b9d5672a272362646ebbe8
Reviewed-on: https://gerrit.libreoffice.org/63426
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 9d78f808d6cc..df4dcc5aeba0 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -824,11 +824,7 @@ public:
FieldUnit get_unit() const { return m_eSrcUnit; }
- void set_unit(FieldUnit eUnit)
- {
- m_eSrcUnit = eUnit;
- update_width_chars();
- }
+ void set_unit(FieldUnit eUnit);
int convert_value_to(int nValue, FieldUnit eValueUnit) const
{
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 270fef7c4aaf..e022ab0d7ef1 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -250,6 +250,18 @@ namespace weld
m_xSpinButton->set_digits(digits);
set_increments(step, page, m_eSrcUnit);
set_value(value, m_eSrcUnit);
+ update_width_chars();
+ }
+
+ void MetricSpinButton::set_unit(FieldUnit eUnit)
+ {
+ int step, page;
+ get_increments(step, page, m_eSrcUnit);
+ int value = get_value(m_eSrcUnit);
+ m_eSrcUnit = eUnit;
+ set_increments(step, page, m_eSrcUnit);
+ set_value(value, m_eSrcUnit);
+ update_width_chars();
}
int MetricSpinButton::ConvertValue(int nValue, FieldUnit eInUnit, FieldUnit eOutUnit) const
More information about the Libreoffice-commits
mailing list