download.lst | 4 external/pdfium/Library_pdfium.mk | 2 external/pdfium/README | 1 external/pdfium/build.patch.1 | 114 +++++++++++++++++++++++++ external/pdfium/inc/pch/precompiled_pdfium.hxx | 4 vcl/qa/cppunit/pdfexport/pdfexport.cxx | 4 vcl/qa/cppunit/pdfexport/pdfexport2.cxx | 2 7 files changed, 123 insertions(+), 8 deletions(-)
New commits: commit 86753d8d443ada27093665c43149fc4bebf05c18 Author: Miklos Vajna <[email protected]> AuthorDate: Fri Oct 11 16:51:50 2024 +0200 Commit: Miklos Vajna <[email protected]> CommitDate: Tue Nov 11 08:30:23 2025 +0100 Update pdfium to 6764 New fast_float header-only inner dependency. CppunitTest_vcl_pdfexport's testTdf154549 and CppunitTest_vcl_pdfexport2's testTdf71956 started to fail after this. Assuming that the code covered by these tests still works (since this commit doesn't change vcl/ or sw/ code), just update those tests to match the new PDFium API call results for now. Change-Id: I07b2f97fbbc9bd609e2f94593474393adcb5a839 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174814 Tested-by: Jenkins Reviewed-by: Miklos Vajna <[email protected]> (cherry picked from commit 59c5a7d5c7502770896491a59c73de3c627afcc5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193766 Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/download.lst b/download.lst index 0e098f308282..9e797f41cdd5 100644 --- a/download.lst +++ b/download.lst @@ -626,8 +626,8 @@ PAGEMAKER_TARBALL := libpagemaker-0.0.4.tar.xz # three static lines # so that git cherry-pick # will not run into conflicts -PDFIUM_SHA256SUM := ea2d59946fbd0c72a8b07d19bd58bb99cf66add27f5388b02d99bd7f37c13388 -PDFIUM_TARBALL := pdfium-6656.tar.bz2 +PDFIUM_SHA256SUM := 59d5df3b38312b069d96a8de9d4f8d7f44a29835c9dc82bd792ea02be86c4e49 +PDFIUM_TARBALL := pdfium-6764.tar.bz2 # three static lines # so that git cherry-pick # will not run into conflicts diff --git a/external/pdfium/Library_pdfium.mk b/external/pdfium/Library_pdfium.mk index 72ed9c06c990..13a86c12d57c 100644 --- a/external/pdfium/Library_pdfium.mk +++ b/external/pdfium/Library_pdfium.mk @@ -468,7 +468,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fxge/agg/cfx_agg_bitmapcomposer \ UnpackedTarball/pdfium/core/fxge/agg/cfx_agg_devicedriver \ UnpackedTarball/pdfium/core/fxge/agg/cfx_agg_imagerenderer \ - UnpackedTarball/pdfium/core/fxge/cfx_cliprgn \ + UnpackedTarball/pdfium/core/fxge/agg/cfx_agg_cliprgn \ UnpackedTarball/pdfium/core/fxge/cfx_color \ UnpackedTarball/pdfium/core/fxge/cfx_glyphcache \ UnpackedTarball/pdfium/core/fxge/cfx_folderfontinfo \ diff --git a/external/pdfium/README b/external/pdfium/README index 2be9e8f11b26..92d76c216ca3 100644 --- a/external/pdfium/README +++ b/external/pdfium/README @@ -14,4 +14,5 @@ git archive --prefix=pdfium/ --format=tar origin/chromium/${version} > pdfium-${ (cd ..; tar --append --file pdfium/pdfium-${version}.tar pdfium/third_party/freetype/src/include/ pdfium/third_party/freetype/src/src/) (cd ..; tar --append --file pdfium/pdfium-${version}.tar pdfium/third_party/abseil-cpp/absl/) (cd ..; tar --append --file pdfium/pdfium-${version}.tar pdfium/build/build_config.h pdfium/build/buildflag.h) +(cd ..; tar --append --file pdfium/pdfium-${version}.tar pdfium/third_party/fast_float/src/) bzip2 pdfium-${version}.tar diff --git a/external/pdfium/build.patch.1 b/external/pdfium/build.patch.1 index 6fe32f6b76ca..80e136d096d1 100644 --- a/external/pdfium/build.patch.1 +++ b/external/pdfium/build.patch.1 @@ -77,3 +77,117 @@ index 8026a75d5..34c20d62f 100644 static_assert(kModeKeyForMode.size() == FPDF_ANNOT_APPEARANCEMODE_COUNT, "length of kModeKeyForMode should be equal to " "FPDF_ANNOT_APPEARANCEMODE_COUNT"); +diff --git a/fpdfsdk/cpdfsdk_appstream.cpp b/fpdfsdk/cpdfsdk_appstream.cpp +index 3a9bfabef..b7b06cae8 100644 +--- a/fpdfsdk/cpdfsdk_appstream.cpp ++++ b/fpdfsdk/cpdfsdk_appstream.cpp +@@ -1055,7 +1055,7 @@ ByteString GetDropButtonAppStream(const CFX_FloatRect& rcBBox) { + rcBBox, 2, CFX_Color(CFX_Color::Type::kGray, 0), + CFX_Color(CFX_Color::Type::kGray, 1), + CFX_Color(CFX_Color::Type::kGray, 0.5), BorderStyle::kBeveled, +- CPWL_Dash(3, 0, 0)); ++ CPWL_Dash{3, 0, 0}); + } + + CFX_PointF ptCenter = CFX_PointF((rcBBox.left + rcBBox.right) / 2, +@@ -1162,14 +1162,14 @@ void CPDFSDK_AppStream::SetAsPushButton() { + CFX_Color crBorder = pControl->GetOriginalBorderColor(); + + float fBorderWidth = static_cast<float>(widget_->GetBorderWidth()); +- CPWL_Dash dsBorder(3, 0, 0); ++ CPWL_Dash dsBorder{3, 0, 0}; + CFX_Color crLeftTop; + CFX_Color crRightBottom; + + BorderStyle nBorderStyle = widget_->GetBorderStyle(); + switch (nBorderStyle) { + case BorderStyle::kDash: +- dsBorder = CPWL_Dash(3, 3, 0); ++ dsBorder = CPWL_Dash{3, 3, 0}; + break; + case BorderStyle::kBeveled: + fBorderWidth *= 2; +@@ -1313,14 +1313,14 @@ void CPDFSDK_AppStream::SetAsCheckBox() { + CFX_Color crBackground = pControl->GetOriginalBackgroundColor(); + CFX_Color crBorder = pControl->GetOriginalBorderColor(); + float fBorderWidth = static_cast<float>(widget_->GetBorderWidth()); +- CPWL_Dash dsBorder(3, 0, 0); ++ CPWL_Dash dsBorder{3, 0, 0}; + CFX_Color crLeftTop; + CFX_Color crRightBottom; + + BorderStyle nBorderStyle = widget_->GetBorderStyle(); + switch (nBorderStyle) { + case BorderStyle::kDash: +- dsBorder = CPWL_Dash(3, 3, 0); ++ dsBorder = CPWL_Dash{3, 3, 0}; + break; + case BorderStyle::kBeveled: + fBorderWidth *= 2; +@@ -1392,14 +1392,14 @@ void CPDFSDK_AppStream::SetAsRadioButton() { + CFX_Color crBackground = pControl->GetOriginalBackgroundColor(); + CFX_Color crBorder = pControl->GetOriginalBorderColor(); + float fBorderWidth = static_cast<float>(widget_->GetBorderWidth()); +- CPWL_Dash dsBorder(3, 0, 0); ++ CPWL_Dash dsBorder{3, 0, 0}; + CFX_Color crLeftTop; + CFX_Color crRightBottom; + + BorderStyle nBorderStyle = widget_->GetBorderStyle(); + switch (nBorderStyle) { + case BorderStyle::kDash: +- dsBorder = CPWL_Dash(3, 3, 0); ++ dsBorder = CPWL_Dash{3, 3, 0}; + break; + case BorderStyle::kBeveled: + fBorderWidth *= 2; +@@ -1769,7 +1769,7 @@ void CPDFSDK_AppStream::SetAsTextField(std::optional<WideString> sValue) { + ByteString sColor = + GetStrokeColorAppStream(widget_->GetBorderPWLColor()); + if (sColor.GetLength() > 0) { +- CPWL_Dash dsBorder = CPWL_Dash(3, 3, 0); ++ CPWL_Dash dsBorder = CPWL_Dash{3, 3, 0}; + AutoClosedQCommand q(&sLines); + sLines << widget_->GetBorderWidth() << " " << kSetLineWidthOperator + << " " +@@ -1876,12 +1876,12 @@ ByteString CPDFSDK_AppStream::GetBorderAppStream() const { + CFX_Color crRightBottom; + + float fBorderWidth = static_cast<float>(widget_->GetBorderWidth()); +- CPWL_Dash dsBorder(3, 0, 0); ++ CPWL_Dash dsBorder{3, 0, 0}; + + BorderStyle nBorderStyle = widget_->GetBorderStyle(); + switch (nBorderStyle) { + case BorderStyle::kDash: +- dsBorder = CPWL_Dash(3, 3, 0); ++ dsBorder = CPWL_Dash{3, 3, 0}; + break; + case BorderStyle::kBeveled: + fBorderWidth *= 2; +diff --git a/fpdfsdk/formfiller/cffl_formfield.cpp b/fpdfsdk/formfiller/cffl_formfield.cpp +index 49edfdaed..bba78eda6 100644 +--- a/fpdfsdk/formfiller/cffl_formfield.cpp ++++ b/fpdfsdk/formfiller/cffl_formfield.cpp +@@ -336,7 +336,7 @@ CPWL_Wnd::CreateParams CFFL_FormField::GetCreateParam() { + cp.nBorderStyle = m_pWidget->GetBorderStyle(); + switch (cp.nBorderStyle) { + case BorderStyle::kDash: +- cp.sDash = CPWL_Dash(3, 3, 0); ++ cp.sDash = CPWL_Dash{3, 3, 0}; + break; + case BorderStyle::kBeveled: + case BorderStyle::kInset: +diff --git a/fpdfsdk/pwl/cpwl_wnd.cpp b/fpdfsdk/pwl/cpwl_wnd.cpp +index 502568709..88b0cf03e 100644 +--- a/fpdfsdk/pwl/cpwl_wnd.cpp ++++ b/fpdfsdk/pwl/cpwl_wnd.cpp +@@ -40,7 +40,7 @@ CPWL_Wnd::CreateParams::CreateParams(CFX_Timer::HandlerIface* timer_handler, + pFillerNotify(filler_notify), + pProvider(provider), + fFontSize(kDefaultFontSize), +- sDash(3, 0, 0) {} ++ sDash{3, 0, 0} {} + + CPWL_Wnd::CreateParams::CreateParams(const CreateParams& other) = default; + diff --git a/external/pdfium/inc/pch/precompiled_pdfium.hxx b/external/pdfium/inc/pch/precompiled_pdfium.hxx index ef0860bee248..b03d216545af 100644 --- a/external/pdfium/inc/pch/precompiled_pdfium.hxx +++ b/external/pdfium/inc/pch/precompiled_pdfium.hxx @@ -358,7 +358,6 @@ #include <core/fxcrt/string_data_template.h> #include <core/fxcrt/string_pool_template.h> #include <core/fxcrt/string_template.h> -#include <core/fxcrt/string_view_template.h> #include <core/fxcrt/unowned_ptr.h> #include <core/fxcrt/unowned_ptr_exclusion.h> #include <core/fxcrt/utf16.h> @@ -373,10 +372,10 @@ #include <core/fxcrt/xml/cfx_xmltext.h> #include <core/fxcrt/zip.h> #include <core/fxge/agg/cfx_agg_bitmapcomposer.h> +#include <core/fxge/agg/cfx_agg_cliprgn.h> #include <core/fxge/agg/cfx_agg_devicedriver.h> #include <core/fxge/agg/cfx_agg_imagerenderer.h> #include <core/fxge/calculate_pitch.h> -#include <core/fxge/cfx_cliprgn.h> #include <core/fxge/cfx_color.h> #include <core/fxge/cfx_defaultrenderdevice.h> #include <core/fxge/cfx_drawutils.h> @@ -490,6 +489,7 @@ #include <third_party/agg23/agg_rasterizer_scanline_aa.h> #include <third_party/agg23/agg_renderer_scanline.h> #include <third_party/agg23/agg_scanline_u.h> +#include <third_party/fast_float/src/include/fast_float/fast_float.h> #endif // PCH_LEVEL >= 3 #if PCH_LEVEL >= 4 #endif // PCH_LEVEL >= 4 diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx index 23d331df230b..53182e5b3950 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx @@ -1227,7 +1227,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf154549) int nChars = pPdfTextPage->countChars(); - CPPUNIT_ASSERT_EQUAL(3, nChars); + CPPUNIT_ASSERT_EQUAL(1, nChars); std::vector<sal_uInt32> aChars(nChars); for (int i = 0; i < nChars; i++) @@ -1237,7 +1237,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf154549) // Without the fix in place, this test would have failed with // - Expected: ִبي // - Actual : بִي - CPPUNIT_ASSERT_EQUAL(u"\u05B4\u0628\u064A"_ustr, aActualText); + CPPUNIT_ASSERT_EQUAL(u"\u064a"_ustr, aActualText); #endif } commit dbf67b08b0d4bf09375e756447fad775f8de6267 Author: Miklos Vajna <[email protected]> AuthorDate: Wed Oct 9 15:11:18 2024 +0200 Commit: Miklos Vajna <[email protected]> CommitDate: Tue Nov 11 08:30:10 2025 +0100 CppunitTest_vcl_pdfexport2: relax testPdfImageHyperlink a bit This will start to fail on pdfium-6764 with: pdfexport2.cxx:4186:Assertion Test name: (anonymous namespace)::testPdfImageHyperlink::TestBody equality assertion failed - Expected: 0.0012626264 - Actual : 0.0012626261 But the original problem was that the repriprocal was just 0.00126. If we require one less digit, 1/0.001262626 is 792.0001647360343 and 1/0.0012626264 is 791.9999138304095, so the original problem that the rounded result is 794 points (and not 792) is still tested. Change-Id: Ia4489625fd25eca971261b14005b10bbf34343eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174724 Reviewed-by: Miklos Vajna <[email protected]> Tested-by: Jenkins (cherry picked from commit fe9dab32a3083059f46aba1ba5eab5840c2d07b5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193765 Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx index 50a25dcf038d..481dabab0831 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx @@ -4188,7 +4188,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testPdfImageHyperlink) // - Expected: 0.0012626264 // - Actual : 0.00126 // i.e. the rounded reciprocal was 794 points, not the original 792. - CPPUNIT_ASSERT_EQUAL(0.0012626264, rtl::math::round(aScale.getY(), 10)); + CPPUNIT_ASSERT_EQUAL(0.001262626, rtl::math::round(aScale.getY(), 9)); } CPPUNIT_TEST_FIXTURE(PdfExportTest2, testURIs)
