From d10a49d64469411a23b3660a82106405808da028 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Wed, 31 Mar 2021 20:38:30 +0300 Subject: Use o3tl::convert for conversion to/from EMUs Change-Id: Ifbf762194836a3d05157e98943e65ef8aa2149c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113425 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- include/oox/export/utils.hxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include/oox/export/utils.hxx') diff --git a/include/oox/export/utils.hxx b/include/oox/export/utils.hxx index 510505aa3d84..1a9a790d2182 100644 --- a/include/oox/export/utils.hxx +++ b/include/oox/export/utils.hxx @@ -20,6 +20,9 @@ #ifndef INCLUDED_OOX_EXPORT_UTILS_HXX #define INCLUDED_OOX_EXPORT_UTILS_HXX +#include + +#include #include #include @@ -52,12 +55,12 @@ static constexpr const char* ToPsz10(bool b) static constexpr sal_Int64 PPTtoEMU( sal_Int32 nPPT ) { - return static_cast( static_cast(nPPT) * 1587.5 ); + return o3tl::convert(nPPT, o3tl::Length::master, o3tl::Length::emu); } static constexpr sal_Int64 TwipsToEMU( sal_Int32 nTwips ) { - return sal_Int64( nTwips ) * 635; + return o3tl::convert(nTwips, o3tl::Length::twip, o3tl::Length::emu); } template -- cgit