Simplify conversion, and fix a comment
Change-Id: I0a952b26e486dcfdedf586e33afa6771b480ac65
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155540
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
diff --git a/vcl/inc/pdf/pdfcompat.hxx b/vcl/inc/pdf/pdfcompat.hxx
index 8f629b3..5d6d623 100644
--- a/vcl/inc/pdf/pdfcompat.hxx
+++ b/vcl/inc/pdf/pdfcompat.hxx
@@ -17,7 +17,7 @@
namespace vcl::pdf
{
/// Convert to inch, then assume 96 DPI.
/// Convert to inch, then apply custom resolution.
inline double pointToPixel(const double fPoint, const double fResolutionDPI)
{
return o3tl::convert(fPoint, o3tl::Length::pt, o3tl::Length::in) * fResolutionDPI;
diff --git a/vcl/source/filter/ipdf/pdfread.cxx b/vcl/source/filter/ipdf/pdfread.cxx
index 18f8c4d..8dc4c96 100644
--- a/vcl/source/filter/ipdf/pdfread.cxx
+++ b/vcl/source/filter/ipdf/pdfread.cxx
@@ -368,14 +368,10 @@ size_t ImportPDFUnloaded(const OUString& rURL, std::vector<PDFGraphicResult>& rG
if (aPageSize.getWidth() <= 0.0 || aPageSize.getHeight() <= 0.0)
continue;
// Returned unit is points, convert that to twip
// 1 pt = 20 twips
constexpr double pointToTwipconversionRatio = 20;
// Returned unit is points
tools::Long nPageWidth
= convertTwipToMm100(aPageSize.getWidth() * pointToTwipconversionRatio);
tools::Long nPageHeight
= convertTwipToMm100(aPageSize.getHeight() * pointToTwipconversionRatio);
tools::Long nPageWidth = std::round(convertPointToMm100(aPageSize.getWidth()));
tools::Long nPageHeight = std::round(convertPointToMm100(aPageSize.getHeight()));
// Create the Graphic with the VectorGraphicDataPtr and link the original PDF stream.
// We swap out this Graphic as soon as possible, and a later swap in