vcl/qa/cppunit/pdfexport/pdfexport.cxx | 3 --- vcl/source/gdi/pdfwriter_impl.cxx | 10 ++++++++++ 2 files changed, 10 insertions(+), 3 deletions(-)
New commits: commit c2d7c8e5c616980d5fa77ac48babbf27342b2f0a Author: Patrick Luby <plub...@neooffice.org> AuthorDate: Tue Sep 19 16:43:46 2023 -0400 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Wed Sep 20 08:14:19 2023 +0200 tdf#156842 increase scale for external PDF data For some unknown reason, the scale is 8 times larger than for non-external PDF XObjects. This fix also allows the CppunitTest_vcl_pdfexport to run successfully on macOS. Change-Id: I166914e6ac575c50985efba3fb7a38ec758dea1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157090 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx index b26176c1aa0d..a07ceeb53eae 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx @@ -5290,10 +5290,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testPdfImageHyperlink) // - Expected: 0.0012626264 // - Actual : 0.00126 // i.e. the rounded reciprocal was 794 points, not the original 792. - // FIXME macOS actual value is 0.0001578282, for unknown reasons. -#if !defined MACOSX CPPUNIT_ASSERT_EQUAL(0.0012626264, rtl::math::round(aScale.getY(), 10)); -#endif } CPPUNIT_TEST_FIXTURE(PdfExportTest, testURIs) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 64dfc809fccc..8d4082b1c227 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -9125,6 +9125,16 @@ void PDFWriterImpl::writeReferenceXObject(const ReferenceXObjectEmit& rEmit) sal_Int32 nWrappedFormObject = 0; if (!m_aContext.UseReferenceXObject) { +#ifdef MACOSX + // tdf#156842 increase scale for external PDF data + // For some unknown reason, the scale is 8 times larger than for + // non-external PDF XObjects. + // This fix also allows the CppunitTest_vcl_pdfexport to run + // successfully on macOS. + fScaleX = 8.0 / aSize.Width(); + fScaleY = 8.0 / aSize.Height(); +#endif + // Parse the PDF data, we need that to write the PDF dictionary of our // object. if (rEmit.m_nExternalPDFDataIndex < 0)