svtools/source/misc/unitconv.cxx | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
New commits: commit c1df669df72836eb6a5c5069077bda100d4506a1 Author: Caolán McNamara <[email protected]> AuthorDate: Sat Nov 29 19:17:04 2025 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Sun Nov 30 12:51:53 2025 +0100 condense this a bit Change-Id: Ia9f9549336adcd2e10d09310cc5bd448e7d23137 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194830 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/svtools/source/misc/unitconv.cxx b/svtools/source/misc/unitconv.cxx index cb4fdf6901dd..ca0657be9935 100644 --- a/svtools/source/misc/unitconv.cxx +++ b/svtools/source/misc/unitconv.cxx @@ -98,17 +98,7 @@ sal_Int64 GetCoreValue(const weld::MetricSpinButton& rField, MapUnit eUnit) sal_Int64 nVal = rField.get_value(FieldUnit::MM_100TH); // avoid rounding issues const sal_Int64 nSizeMask = 0xffffffffff000000LL; - bool bRoundBefore = true; - if( nVal >= 0 ) - { - if( (nVal & nSizeMask) == 0 ) - bRoundBefore = false; - } - else - { - if( ((-nVal) & nSizeMask ) == 0 ) - bRoundBefore = false; - } + const bool bRoundBefore = (std::abs(nVal) & nSizeMask) != 0; if( bRoundBefore ) nVal = rField.denormalize( nVal ); sal_Int64 nUnitVal = OutputDevice::LogicToLogic(nVal, MapUnit::Map100thMM, eUnit);
