diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-02-21 00:30:16 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-03-25 20:14:06 +0200 |
commit | 73629949c1d6245f7fad419b677cf92a49ffd18a (patch) | |
tree | 65b6fab1a7759b3f32cf355a1de868650870e743 /svtools | |
parent | 3ac438cde11c4cbe32a1c09e9fe885a0b0accc2c (diff) |
tdf#115892: properly get the box' saved value
Previously textual value like "10,5 pt" was converted to int as simply
10 (multiplied by 10, it became 100), which compared as different from
unchanged value of 105. This made the fractional values to be treated
as always changed.
This patch uses the same code to convert saved value as is used for
current edit box value.
Reviewed-on: https://gerrit.libreoffice.org/50066
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit f00e891f3369f7b8c2532634d9ff4ab19da17c33)
Change-Id: I09a84a6bf33b17e0192b79b31af21ef14d7e9c63
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/ctrlbox.cxx | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index a4b64f2ef042..5810132ed431 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -1582,23 +1582,17 @@ void FontSizeBox::SetValue( sal_Int64 nNewValue ) SetValue( nNewValue, FUNIT_NONE ); } -sal_Int64 FontSizeBox::GetValue( FieldUnit eOutUnit ) const +sal_Int64 FontSizeBox::GetValueFromStringUnit(const OUString& rStr, FieldUnit eOutUnit) const { if ( !bRelative ) { FontSizeNames aFontSizeNames( GetSettings().GetUILanguageTag().getLanguageType() ); - sal_Int64 nValue = aFontSizeNames.Name2Size( GetText() ); - if ( nValue) + sal_Int64 nValue = aFontSizeNames.Name2Size( rStr ); + if ( nValue ) return MetricField::ConvertValue( nValue, GetBaseValue(), GetDecimalDigits(), GetUnit(), eOutUnit ); } - return MetricBox::GetValue( eOutUnit ); -} - -sal_Int64 FontSizeBox::GetValue() const -{ - // implementation not inline, because it is a virtual function - return GetValue( FUNIT_NONE ); + return MetricBox::GetValueFromStringUnit( rStr, eOutUnit ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |