extensions/source/scanner/sane.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
New commits: commit bf7b45c2dea9fda943b3878e25d051ec1c5b19fa Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Mon Jan 13 09:56:35 2025 +0100 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Mon Jan 13 12:07:17 2025 +0100 Use o3tl::convert Change-Id: Ie877cbee77752aaa30346c78b4f5b836f0ec44d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180161 Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> Tested-by: Jenkins 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 <math.h> #include <o3tl/safeint.hxx> +#include <o3tl/unit_conversion.hxx> #include <osl/file.h> #include <sal/log.hxx> #include <tools/stream.hxx> @@ -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<int>((static_cast<double>(nWidth) / fResl) * 25.4); + nWidthMM = o3tl::convert(nWidth / fResl, o3tl::Length::in, o3tl::Length::mm); if( ! nHeightMM ) - nHeightMM = static_cast<int>((static_cast<double>(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);