diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-03-31 20:38:30 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-04-01 06:16:04 +0200 |
commit | d10a49d64469411a23b3660a82106405808da028 (patch) | |
tree | 362c806d9da89f5febd2f4849fa3a5950aa9242d /include/oox/export/utils.hxx | |
parent | 83a7f7a9bc47c64c23d64b24e5d03499a3eede84 (diff) |
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 <mike.kaganski@collabora.com>
Diffstat (limited to 'include/oox/export/utils.hxx')
-rw-r--r-- | include/oox/export/utils.hxx | 7 |
1 files changed, 5 insertions, 2 deletions
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 <sal/config.h> + +#include <o3tl/unit_conversion.hxx> #include <rtl/string.hxx> #include <sal/types.h> @@ -52,12 +55,12 @@ static constexpr const char* ToPsz10(bool b) static constexpr sal_Int64 PPTtoEMU( sal_Int32 nPPT ) { - return static_cast<sal_Int64>( static_cast<double>(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 <typename T> |