[Libreoffice-commits] core.git: vcl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Nov 15 20:56:20 UTC 2018
vcl/source/window/builder.cxx | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
New commits:
commit 973a3dd9623107c18c6765d0b247aa34018a0447
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Nov 15 17:16:19 2018 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Nov 15 21:55:51 2018 +0100
force rerender on unit change
Change-Id: I7a64b2e200bf0c50ea636be8aac1249713044103
Reviewed-on: https://gerrit.libreoffice.org/63438
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 95a1fb996cd4..b2dbeba41233 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -256,13 +256,17 @@ namespace weld
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();
+ if (eUnit != m_eSrcUnit)
+ {
+ 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);
+ spin_button_output(*m_xSpinButton);
+ update_width_chars();
+ }
}
int MetricSpinButton::ConvertValue(int nValue, FieldUnit eInUnit, FieldUnit eOutUnit) const
More information about the Libreoffice-commits
mailing list