svx/source/svdraw/svdpdf.cxx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
New commits: commit 992fd7689ecac373559750f596f697ce780ff524 Author: Caolán McNamara <[email protected]> AuthorDate: Mon Sep 15 17:09:29 2025 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Thu Oct 2 17:52:16 2025 +0200 scale without adjustment Change-Id: I302687bb7b226d91b5a53781b0e459afd8bc7e50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190986 Reviewed-by: Miklos Vajna <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191774 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Jenkins diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index bb41623618ab..b5cc9ce8ce5d 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -182,20 +182,21 @@ void ImpSdrPdfImport::SetupPageScale(const double dPageWidth, const double dPage mdPageHeightPts = dPageHeight; Size aPageSize(convertPointToMm100(dPageWidth), convertPointToMm100(dPageHeight)); + Size aScaleRectSize = maScaleRect.GetSize(); if (aPageSize.Width() && aPageSize.Height() && (!maScaleRect.IsEmpty())) { maOfs = maScaleRect.TopLeft(); - if (aPageSize.Width() != (maScaleRect.GetWidth() - 1)) + if (aPageSize.Width() != aScaleRectSize.Width()) { - mfScaleX = static_cast<double>(maScaleRect.GetWidth() - 1) + mfScaleX = static_cast<double>(aScaleRectSize.Width()) / static_cast<double>(aPageSize.Width()); } - if (aPageSize.Height() != (maScaleRect.GetHeight() - 1)) + if (aPageSize.Height() != aScaleRectSize.Height()) { - mfScaleY = static_cast<double>(maScaleRect.GetHeight() - 1) + mfScaleY = static_cast<double>(aScaleRectSize.Height()) / static_cast<double>(aPageSize.Height()); } } @@ -205,15 +206,15 @@ void ImpSdrPdfImport::SetupPageScale(const double dPageWidth, const double dPage maScaleX = Fraction(1, 1); maScaleY = Fraction(1, 1); - if (aPageSize.Width() != (maScaleRect.GetWidth() - 1)) + if (aPageSize.Width() != aScaleRectSize.Width()) { - maScaleX = Fraction(maScaleRect.GetWidth() - 1, aPageSize.Width()); + maScaleX = Fraction(aScaleRectSize.Width(), aPageSize.Width()); mbSize = true; } - if (aPageSize.Height() != (maScaleRect.GetHeight() - 1)) + if (aPageSize.Height() != aScaleRectSize.Height()) { - maScaleY = Fraction(maScaleRect.GetHeight() - 1, aPageSize.Height()); + maScaleY = Fraction(aScaleRectSize.Height(), aPageSize.Height()); mbSize = true; } }
