diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-08-23 16:28:10 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-08-24 10:37:21 +0200 |
commit | ae04cfdbad1f4c09b06cd2cee9d89e9909181acc (patch) | |
tree | 1dec02c9c1258ddeb7f21a103483fec70d47e008 /include/oox | |
parent | d21a9968728295736e63bfc53eb83ee162dafae7 (diff) |
Introduce convertNarrowing to return smaller integer types
It will use compile-type constants to clamp input value, instead of
clamping more expensive pre-sanitized output value.
Change-Id: If78f8b1b4c99bd2f16b1d8a71872e89a0dddd8d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120874
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'include/oox')
-rw-r--r-- | include/oox/drawingml/drawingmltypes.hxx | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/include/oox/drawingml/drawingmltypes.hxx b/include/oox/drawingml/drawingmltypes.hxx index 05d218fa882e..4350b8d033a7 100644 --- a/include/oox/drawingml/drawingmltypes.hxx +++ b/include/oox/drawingml/drawingmltypes.hxx @@ -180,9 +180,7 @@ inline sal_Int64 convertHmmToEmu( sal_Int32 nValue ) /** Converts the passed 64-bit integer value from EMUs to 1/100 mm. */ inline sal_Int32 convertEmuToHmm( sal_Int64 nValue ) { - return getLimitedValue<sal_Int32, sal_Int64>( - o3tl::convertSaturate(nValue, o3tl::Length::emu, o3tl::Length::mm100), SAL_MIN_INT32, - SAL_MAX_INT32); + return o3tl::convertNarrowing<sal_Int32, o3tl::Length::emu, o3tl::Length::mm100>(nValue); } /** Converts the passed 64-bit integer value from EMUs to Points. */ |