diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-02-03 19:59:25 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-02-04 11:21:00 +0100 |
commit | ea771e85b2302829394df545bb82c02bff2750c2 (patch) | |
tree | 8ff097ea232a02968ee5e1312fb24b3d11507065 /svtools/source/misc | |
parent | f2d62b11cd7d47925fd098b3947726313d6b296e (diff) |
Resolves: tdf#146997 use sal_Int64 instead of sal_Int32 for spinbutton values
for these cases where draw wants to massively scale the units
the underlying "metric conversion" are already using sal_Int64 anyway
Change-Id: I94e120d72644319548f75b2f68cfe60d4829a2e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129356
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools/source/misc')
-rw-r--r-- | svtools/source/misc/unitconv.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/svtools/source/misc/unitconv.cxx b/svtools/source/misc/unitconv.cxx index 5e316c5adf46..395c1b4ac810 100644 --- a/svtools/source/misc/unitconv.cxx +++ b/svtools/source/misc/unitconv.cxx @@ -26,9 +26,9 @@ void SetFieldUnit(weld::MetricSpinButton& rField, FieldUnit eUnit, bool bAll) { - int nMin, nMax; + sal_Int64 nMin, nMax; rField.get_range(nMin, nMax, FieldUnit::TWIP); - int nValue = rField.get_value(FieldUnit::TWIP); + sal_Int64 nValue = rField.get_value(FieldUnit::TWIP); nMin = rField.denormalize(nMin); nMax = rField.denormalize(nMax); nValue = rField.denormalize(nValue); @@ -86,18 +86,18 @@ void SetFieldUnit(weld::MetricSpinButton& rField, FieldUnit eUnit, bool bAll) rField.set_value(rField.normalize(nValue), FieldUnit::TWIP); } -void SetMetricValue(weld::MetricSpinButton& rField, int nCoreValue, MapUnit eUnit) +void SetMetricValue(weld::MetricSpinButton& rField, sal_Int64 nCoreValue, MapUnit eUnit) { - auto nVal = OutputDevice::LogicToLogic(nCoreValue, eUnit, MapUnit::Map100thMM); + sal_Int64 nVal = OutputDevice::LogicToLogic(nCoreValue, eUnit, MapUnit::Map100thMM); nVal = rField.normalize(nVal); rField.set_value(nVal, FieldUnit::MM_100TH); } -int GetCoreValue(const weld::MetricSpinButton& rField, MapUnit eUnit) +sal_Int64 GetCoreValue(const weld::MetricSpinButton& rField, MapUnit eUnit) { - int nVal = rField.get_value(FieldUnit::MM_100TH); + sal_Int64 nVal = rField.get_value(FieldUnit::MM_100TH); // avoid rounding issues - const int nSizeMask = 0xff000000; + const sal_Int64 nSizeMask = 0xffffffffff000000LL; bool bRoundBefore = true; if( nVal >= 0 ) { @@ -111,7 +111,7 @@ int GetCoreValue(const weld::MetricSpinButton& rField, MapUnit eUnit) } if( bRoundBefore ) nVal = rField.denormalize( nVal ); - auto nUnitVal = OutputDevice::LogicToLogic(nVal, MapUnit::Map100thMM, eUnit); + sal_Int64 nUnitVal = OutputDevice::LogicToLogic(nVal, MapUnit::Map100thMM, eUnit); if (!bRoundBefore) nUnitVal = rField.denormalize(nUnitVal); return nUnitVal; |