sdext/source/pdfimport/inc/pdfihelper.hxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
New commits: commit bcb1620b3e4929df1d06d57b4769650422fff16e Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Jul 14 09:43:22 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Jul 14 18:02:22 2022 +0200 speed up loading PDF file Change-Id: I3d892319f4af0c187455bc9c13b6edb0d52ac023 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137079 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sdext/source/pdfimport/inc/pdfihelper.hxx b/sdext/source/pdfimport/inc/pdfihelper.hxx index 6b663b203e62..c6be1a6ba73e 100644 --- a/sdext/source/pdfimport/inc/pdfihelper.hxx +++ b/sdext/source/pdfimport/inc/pdfihelper.hxx @@ -64,9 +64,12 @@ namespace pdfi return fMM; } + /// round to 2 decimal places inline double convPx2mmPrec2( double fPix ) { - return rtl_math_round( convPx2mm( fPix ), 2, rtl_math_RoundingMode_Floor ); + constexpr double px2mm = 25.4/PDFI_OUTDEV_RESOLUTION; + double mm = fPix * ( px2mm * 100); + return std::floor(mm) / 100; } /// Convert color to "#FEFEFE" color notation