Use o3tl::convert

Change-Id: Ie877cbee77752aaa30346c78b4f5b836f0ec44d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180161
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Mike Kaganski
2025-01-13 09:56:35 +01:00
parent 444179c7e1
commit bf7b45c2de

View File

@@ -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);