From bf7b45c2dea9fda943b3878e25d051ec1c5b19fa Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Mon, 13 Jan 2025 09:56:35 +0100 Subject: [PATCH] Use o3tl::convert Change-Id: Ie877cbee77752aaa30346c78b4f5b836f0ec44d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180161 Reviewed-by: Mike Kaganski Tested-by: Jenkins --- extensions/source/scanner/sane.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/source/scanner/sane.cxx b/extensions/source/scanner/sane.cxx index e1fde5e5213c..22bada4517c6 100644 --- a/extensions/source/scanner/sane.cxx +++ b/extensions/source/scanner/sane.cxx @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -747,9 +748,9 @@ bool Sane::Start( BitmapTransporter& rBitmap ) if( ! fResl ) fResl = 300; // if all else fails that's a good guess if( ! nWidthMM ) - nWidthMM = static_cast((static_cast(nWidth) / fResl) * 25.4); + nWidthMM = o3tl::convert(nWidth / fResl, o3tl::Length::in, o3tl::Length::mm); if( ! nHeightMM ) - nHeightMM = static_cast((static_cast(nHeight) / fResl) * 25.4); + nHeightMM = o3tl::convert(nHeight / fResl, o3tl::Length::in, o3tl::Length::mm); SAL_INFO("extensions.scanner", "set dimensions to(" << nWidth << ", " << nHeight << ") Pixel, (" << nWidthMM << ", " << nHeightMM << ") mm, resolution is " << fResl);