diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-07-14 09:43:22 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-07-14 18:02:22 +0200 |
commit | bcb1620b3e4929df1d06d57b4769650422fff16e (patch) | |
tree | 59bed1c92247a97c0969d924ca42e2d0306c5648 /sdext | |
parent | ff1c5fedc96456a6be12e7e4fd2109ef5beb45c7 (diff) |
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.grandin@collabora.co.uk>
Diffstat (limited to 'sdext')
-rw-r--r-- | sdext/source/pdfimport/inc/pdfihelper.hxx | 5 |
1 files changed, 4 insertions, 1 deletions
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 |