From 516eabccbad4f937a96c7deca023b76dc43ad6c7 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 12 Oct 2022 20:10:45 +0200 Subject: Update pdfium to 5408 - drop cg-instead-of-carbon.patch.1, no longer needed after https://pdfium-review.googlesource.com/c/pdfium/+/99753 - drop AndroidNDK19.patch.1, no longer needed after https://pdfium-review.googlesource.com/c/pdfium/+/96530 - drop gcc-c++20-comparison.patch, no longer needed after "Fix interaction between RetainPtr and transparent comparisons" since chromium/5321 Change-Id: I1f861dd8a3d490400bb39c108bd4e767a2f45d30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142474 Tested-by: Jenkins Reviewed-by: Miklos Vajna (cherry picked from commit 5a69fd3052bb638857f30a4cfd5913634275d23d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154140 Tested-by: Jenkins CollaboraOffice --- download.lst | 4 +-- external/pdfium/AndroidNDK19.patch.1 | 16 --------- external/pdfium/Library_pdfium.mk | 14 ++------ external/pdfium/UnpackedTarball_pdfium.mk | 26 +++------------ external/pdfium/annot-alternate-name.patch.1 | 40 ----------------------- external/pdfium/annot.patch.1 | 45 -------------------------- external/pdfium/build.patch.1 | 13 -------- external/pdfium/cg-instead-of-carbon.patch.1 | 23 ------------- external/pdfium/constexpr-template.patch | 12 +++++++ external/pdfium/gcc-c++20-comparison.patch | 18 ----------- external/pdfium/inc/pch/precompiled_pdfium.hxx | 25 +++----------- include/vcl/filter/PDFiumLibrary.hxx | 4 ++- sw/qa/core/text/text.cxx | 3 +- vcl/source/pdf/PDFiumLibrary.cxx | 14 ++++++-- 14 files changed, 42 insertions(+), 215 deletions(-) delete mode 100644 external/pdfium/AndroidNDK19.patch.1 delete mode 100644 external/pdfium/annot-alternate-name.patch.1 delete mode 100644 external/pdfium/annot.patch.1 delete mode 100644 external/pdfium/cg-instead-of-carbon.patch.1 create mode 100644 external/pdfium/constexpr-template.patch delete mode 100644 external/pdfium/gcc-c++20-comparison.patch diff --git a/download.lst b/download.lst index 4fc4aad6587a..ab3bf1a5ce88 100644 --- a/download.lst +++ b/download.lst @@ -234,8 +234,8 @@ export ORCUS_SHA256SUM := 2a86c405a5929f749b27637509596421d46805753364ab258b035f export ORCUS_TARBALL := liborcus-0.17.2.tar.bz2 export PAGEMAKER_SHA256SUM := 66adacd705a7d19895e08eac46d1e851332adf2e736c566bef1164e7a442519d export PAGEMAKER_TARBALL := libpagemaker-0.0.4.tar.xz -export PDFIUM_SHA256SUM := ecb9c2a0d777196949994946e3f24ed251ae5d3db8a9fa1e2827ef857151db13 -export PDFIUM_TARBALL := pdfium-5298.tar.bz2 +export PDFIUM_SHA256SUM := 7db59b1e91f2bc0ab4c5e19d1a4f881e6a47dbb0d3b7e980a7358225b12a0f35 +export PDFIUM_TARBALL := pdfium-5408.tar.bz2 export PIXMAN_SHA256SUM := ea1480efada2fd948bc75366f7c349e1c96d3297d09a3fe62626e38e234a625e export PIXMAN_TARBALL := pixman-0.42.2.tar.gz export LIBPNG_SHA256SUM := 1f4696ce70b4ee5f85f1e1623dc1229b210029fa4b7aee573df3e2ba7b036937 diff --git a/external/pdfium/AndroidNDK19.patch.1 b/external/pdfium/AndroidNDK19.patch.1 deleted file mode 100644 index f0d926f555d8..000000000000 --- a/external/pdfium/AndroidNDK19.patch.1 +++ /dev/null @@ -1,16 +0,0 @@ -diff -Naur pdfium.org/third_party/base/allocator/partition_allocator/page_allocator_internals_posix.h pdfium/third_party/base/allocator/partition_allocator/page_allocator_internals_posix.h ---- pdfium.org/third_party/base/allocator/partition_allocator/page_allocator_internals_posix.h 2021-05-05 23:01:25.705057178 +0200 -+++ pdfium/third_party/base/allocator/partition_allocator/page_allocator_internals_posix.h 2021-05-05 23:06:52.194081762 +0200 -@@ -15,6 +15,12 @@ - #endif - #if BUILDFLAG(IS_ANDROID) - #include -+#ifndef PR_SET_VMA -+#define PR_SET_VMA 0x53564d41 -+#endif -+#ifndef PR_SET_VMA_ANON_NAME -+#define PR_SET_VMA_ANON_NAME 0 -+#endif - #endif - #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) - #include diff --git a/external/pdfium/Library_pdfium.mk b/external/pdfium/Library_pdfium.mk index c8ee10fe2c04..a9eef6762436 100644 --- a/external/pdfium/Library_pdfium.mk +++ b/external/pdfium/Library_pdfium.mk @@ -244,9 +244,9 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fpdfapi/render/charposlist \ UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_devicebuffer \ UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_docrenderdata \ - UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_imageloader \ + UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_imageloader \ UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_imagerenderer \ - UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_pagerendercache \ + UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_pageimagecache \ UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_progressiverenderer \ UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_rendercontext \ UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_renderoptions \ @@ -566,17 +566,7 @@ endif # pdfium_base $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ - UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/address_space_randomization \ - UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/page_allocator \ - UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/spin_lock \ - UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/partition_alloc \ UnpackedTarball/pdfium/third_party/base/debug/alias \ - UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/oom_callback \ - UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/partition_bucket \ - UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/partition_oom \ - UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/partition_page \ - UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/partition_root_base \ - UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/random \ UnpackedTarball/pdfium/third_party/base/memory/aligned_memory \ )) diff --git a/external/pdfium/UnpackedTarball_pdfium.mk b/external/pdfium/UnpackedTarball_pdfium.mk index 4c9f483f8ed7..46c7a45ee798 100644 --- a/external/pdfium/UnpackedTarball_pdfium.mk +++ b/external/pdfium/UnpackedTarball_pdfium.mk @@ -14,22 +14,16 @@ pdfium_patches += build.patch.1 # Avoids Windows 8 build dependency. pdfium_patches += windows7.patch.1 pdfium_patches += c++20-comparison.patch -# Use CoreGraphics.h instead of Carbon.h -pdfium_patches += cg-instead-of-carbon.patch.1 -# Android NDK 19 - that is known to work well - does not have 2 defines -pdfium_patches += AndroidNDK19.patch.1 - -# Work around "c++20 rewritten operator== -# recursive call mixing friend and external operators for template class" in GCC with -# --with-latest-c++: -pdfium_patches += gcc-c++20-comparison.patch +# Use CoreGraphics.h instead of Carbon.h -- https://pdfium-review.googlesource.com/c/pdfium/+/99753 +# pdfium_patches += cg-instead-of-carbon.patch.1 +# Android NDK 19 - that is known to work well - does not have 2 defines -- https://pdfium-review.googlesource.com/c/pdfium/+/96530 +# pdfium_patches += AndroidNDK19.patch.1 pdfium_patches += include.patch pdfium_patches += abseil-trivial.patch -pdfium_patches += annot.patch.1 -pdfium_patches += annot-alternate-name.patch.1 +pdfium_patches += constexpr-template.patch $(eval $(call gb_UnpackedTarball_UnpackedTarball,pdfium)) @@ -46,17 +40,7 @@ $(eval $(call gb_UnpackedTarball_set_post_action,pdfium,\ mv third_party/bigint/BigIntegerUtils.cc third_party/bigint/BigIntegerUtils.cpp && \ mv third_party/bigint/BigUnsigned.cc third_party/bigint/BigUnsigned.cpp && \ mv third_party/bigint/BigUnsignedInABase.cc third_party/bigint/BigUnsignedInABase.cpp && \ - mv third_party/base/allocator/partition_allocator/address_space_randomization.cc third_party/base/allocator/partition_allocator/address_space_randomization.cpp && \ - mv third_party/base/allocator/partition_allocator/page_allocator.cc third_party/base/allocator/partition_allocator/page_allocator.cpp && \ - mv third_party/base/allocator/partition_allocator/partition_alloc.cc third_party/base/allocator/partition_allocator/partition_alloc.cpp && \ - mv third_party/base/allocator/partition_allocator/spin_lock.cc third_party/base/allocator/partition_allocator/spin_lock.cpp && \ mv third_party/base/debug/alias.cc third_party/base/debug/alias.cpp && \ - mv third_party/base/allocator/partition_allocator/oom_callback.cc third_party/base/allocator/partition_allocator/oom_callback.cpp && \ - mv third_party/base/allocator/partition_allocator/partition_bucket.cc third_party/base/allocator/partition_allocator/partition_bucket.cpp && \ - mv third_party/base/allocator/partition_allocator/partition_oom.cc third_party/base/allocator/partition_allocator/partition_oom.cpp && \ - mv third_party/base/allocator/partition_allocator/partition_page.cc third_party/base/allocator/partition_allocator/partition_page.cpp && \ - mv third_party/base/allocator/partition_allocator/partition_root_base.cc third_party/base/allocator/partition_allocator/partition_root_base.cpp && \ - mv third_party/base/allocator/partition_allocator/random.cc third_party/base/allocator/partition_allocator/random.cpp && \ mv third_party/base/memory/aligned_memory.cc third_party/base/memory/aligned_memory.cpp && \ mv third_party/base/win/win_util.cc third_party/base/win/win_util.cpp && \ mv third_party/libopenjpeg/opj_malloc.cc third_party/libopenjpeg/opj_malloc.cpp && \ diff --git a/external/pdfium/annot-alternate-name.patch.1 b/external/pdfium/annot-alternate-name.patch.1 deleted file mode 100644 index 6ed619c8ec45..000000000000 --- a/external/pdfium/annot-alternate-name.patch.1 +++ /dev/null @@ -1,40 +0,0 @@ -diff --git a/fpdfsdk/fpdf_annot.cpp b/fpdfsdk/fpdf_annot.cpp -index 05ec46f01..2aa1ce912 100644 ---- a/fpdfsdk/fpdf_annot.cpp -+++ b/fpdfsdk/fpdf_annot.cpp -@@ -1289,6 +1289,18 @@ FPDFAnnot_GetFormFieldName(FPDF_FORMHANDLE hHandle, - buflen); - } - -+FPDF_EXPORT unsigned long FPDF_CALLCONV -+FPDFAnnot_GetFormFieldAlternateName(FPDF_FORMHANDLE hHandle, -+ FPDF_ANNOTATION annot, -+ FPDF_WCHAR* buffer, -+ unsigned long buflen) { -+ const CPDF_FormField* pFormField = GetFormField(hHandle, annot); -+ if (!pFormField) -+ return 0; -+ return Utf16EncodeMaybeCopyAndReturnLength(pFormField->GetAlternateName(), buffer, -+ buflen); -+} -+ - FPDF_EXPORT int FPDF_CALLCONV - FPDFAnnot_GetFormFieldType(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot) { - const CPDF_FormField* pFormField = GetFormField(hHandle, annot); -diff --git a/public/fpdf_annot.h b/public/fpdf_annot.h -index e4217056b..7ce6f3caf 100644 ---- a/public/fpdf_annot.h -+++ b/public/fpdf_annot.h -@@ -735,6 +735,12 @@ FPDFAnnot_GetFormFieldName(FPDF_FORMHANDLE hHandle, - FPDF_WCHAR* buffer, - unsigned long buflen); - -+FPDF_EXPORT unsigned long FPDF_CALLCONV -+FPDFAnnot_GetFormFieldAlternateName(FPDF_FORMHANDLE hHandle, -+ FPDF_ANNOTATION annot, -+ FPDF_WCHAR* buffer, -+ unsigned long buflen); -+ - // Experimental API. - // Gets the form field type of |annot|, which is an interactive form annotation. - // diff --git a/external/pdfium/annot.patch.1 b/external/pdfium/annot.patch.1 deleted file mode 100644 index 542cb9766ff7..000000000000 --- a/external/pdfium/annot.patch.1 +++ /dev/null @@ -1,45 +0,0 @@ -diff --git a/fpdfsdk/fpdf_annot.cpp b/fpdfsdk/fpdf_annot.cpp -index 349348583..54e139645 100644 ---- a/fpdfsdk/fpdf_annot.cpp -+++ b/fpdfsdk/fpdf_annot.cpp -@@ -1223,6 +1223,26 @@ FPDFAnnot_GetFormFieldType(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot) { - return pFormField ? static_cast(pFormField->GetFieldType()) : -1; - } - -+FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV -+FPDFAnnot_GetFormFontSize(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot, float* value) { -+ const CPDF_FormField* pFormField = GetFormField(hHandle, annot); -+ if (!pFormField) { -+ return false; -+ } -+ -+ if (!value) { -+ return false; -+ } -+ -+ ByteString DA; -+ if (const CPDF_Object* pObj = pFormField->GetFieldAttr(pFormField->GetDict(), "DA")) -+ DA = pObj->GetString(); -+ -+ CPDF_DefaultAppearance appearance(DA); -+ appearance.GetFont(value); -+ return true; -+} -+ - FPDF_EXPORT unsigned long FPDF_CALLCONV - FPDFAnnot_GetFormFieldValue(FPDF_FORMHANDLE hHandle, - FPDF_ANNOTATION annot, -diff --git a/public/fpdf_annot.h b/public/fpdf_annot.h -index ccfbb0f1c..3c96b99a0 100644 ---- a/public/fpdf_annot.h -+++ b/public/fpdf_annot.h -@@ -699,6 +699,9 @@ FPDFAnnot_GetFormFieldName(FPDF_FORMHANDLE hHandle, - FPDF_EXPORT int FPDF_CALLCONV - FPDFAnnot_GetFormFieldType(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot); - -+FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV -+FPDFAnnot_GetFormFontSize(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot, float* value); -+ - // Experimental API. - // Gets the value of |annot|, which is an interactive form annotation. - // |buffer| is only modified if |buflen| is longer than the length of contents. diff --git a/external/pdfium/build.patch.1 b/external/pdfium/build.patch.1 index 35073e2c94d3..6f6a53a44ef3 100644 --- a/external/pdfium/build.patch.1 +++ b/external/pdfium/build.patch.1 @@ -158,16 +158,3 @@ index 29d3ee528..d5c7a1bc9 100644 OPJ_BOOL strict) { if (p_codec) { -diff --git a/core/fpdfapi/parser/cpdf_data_avail.cpp b/core/fpdfapi/parser/cpdf_data_avail.cpp -index a17ec0353..3b024ac91 100644 ---- a/core/fpdfapi/parser/cpdf_data_avail.cpp -+++ b/core/fpdfapi/parser/cpdf_data_avail.cpp -@@ -902,7 +902,7 @@ CPDF_DataAvail::DocAvailStatus CPDF_DataAvail::CheckResources( - CPDF_PageObjectAvail* resource_avail = - m_PagesResourcesAvail - .insert(std::make_pair( -- resources, -+ resources.Get(), - std::make_unique( - GetValidator(), m_pDocument.Get(), resources.Get()))) - .first->second.get(); diff --git a/external/pdfium/cg-instead-of-carbon.patch.1 b/external/pdfium/cg-instead-of-carbon.patch.1 deleted file mode 100644 index 055eac735307..000000000000 --- a/external/pdfium/cg-instead-of-carbon.patch.1 +++ /dev/null @@ -1,23 +0,0 @@ --*- Mode: Diff -*- ---- a/core/fxge/apple/fx_quartz_device.h -+++ b/core/fxge/apple/fx_quartz_device.h -@@ -7,7 +7,7 @@ - #ifndef CORE_FXGE_APPLE_FX_QUARTZ_DEVICE_H_ - #define CORE_FXGE_APPLE_FX_QUARTZ_DEVICE_H_ - --#include -+#include - #include - - #include "core/fxcrt/retain_ptr.h" ---- a/core/fpdfapi/font/cpdf_type1font.cpp -+++ b/core/fpdfapi/font/cpdf_type1font.cpp -@@ -19,7 +19,7 @@ - #include "core/fxge/fx_font.h" - - #if BUILDFLAG(IS_APPLE) --#include -+#include - #endif // BUILDFLAG(IS_APPLE) - - namespace { diff --git a/external/pdfium/constexpr-template.patch b/external/pdfium/constexpr-template.patch new file mode 100644 index 000000000000..b83b9f106a32 --- /dev/null +++ b/external/pdfium/constexpr-template.patch @@ -0,0 +1,12 @@ +--- core/fxcodec/jbig2/JBig2_SymbolDict.h ++++ core/fxcodec/jbig2/JBig2_SymbolDict.h +@@ -12,8 +12,7 @@ + #include + + #include "core/fxcodec/jbig2/JBig2_ArithDecoder.h" +- +-class CJBig2_Image; ++#include "core/fxcodec/jbig2/JBig2_Image.h" + + class CJBig2_SymbolDict { + public: diff --git a/external/pdfium/gcc-c++20-comparison.patch b/external/pdfium/gcc-c++20-comparison.patch deleted file mode 100644 index 0895ea8b5f9d..000000000000 --- a/external/pdfium/gcc-c++20-comparison.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- core/fxcrt/retain_ptr.h -+++ core/fxcrt/retain_ptr.h -@@ -135,6 +135,7 @@ - mutable intptr_t m_nRefCount = 0; - }; - -+#if __cplusplus < 202002L - template - inline bool operator==(const U* lhs, const RetainPtr& rhs) { - return rhs == lhs; -@@ -144,6 +144,7 @@ - inline bool operator!=(const U* lhs, const RetainPtr& rhs) { - return rhs != lhs; - } -+#endif - - } // namespace fxcrt - diff --git a/external/pdfium/inc/pch/precompiled_pdfium.hxx b/external/pdfium/inc/pch/precompiled_pdfium.hxx index 21bc61f05fb3..315b5d81ec12 100644 --- a/external/pdfium/inc/pch/precompiled_pdfium.hxx +++ b/external/pdfium/inc/pch/precompiled_pdfium.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-09-21 15:21:21 using: + Generated on 2022-11-08 17:05:53 using: ./bin/update_pch external/pdfium pdfium --cutoff=1 --exclude:system --include:module --include:local If after updating build fails, use the following command to locate conflicting headers: @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -127,11 +126,13 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -189,9 +190,7 @@ #include #include #include -#include #include -#include #include #include #include @@ -309,6 +308,8 @@ #include #include #include +#include +#include #include #include #include @@ -461,22 +462,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include #include diff --git a/include/vcl/filter/PDFiumLibrary.hxx b/include/vcl/filter/PDFiumLibrary.hxx index 0c694d643205..a0da94ab49f2 100644 --- a/include/vcl/filter/PDFiumLibrary.hxx +++ b/include/vcl/filter/PDFiumLibrary.hxx @@ -103,7 +103,7 @@ public: virtual std::vector getAttachmentPoints(size_t nIndex) = 0; virtual std::vector getLineGeometry() = 0; virtual PDFFormFieldType getFormFieldType(PDFiumDocument* pDoc) = 0; - virtual float getFormFontSize(PDFiumDocument* pDoc) = 0; + virtual float getFontSize(PDFiumDocument* pDoc) = 0; virtual OUString getFormFieldAlternateName(PDFiumDocument* pDoc) = 0; virtual int getFormFieldFlags(PDFiumDocument* pDoc) = 0; }; @@ -195,6 +195,8 @@ public: virtual bool hasTransparency() = 0; virtual bool hasLinks() = 0; + + virtual void onAfterLoadPage(PDFiumDocument* pDoc) = 0; }; /// Represents one digital signature, as exposed by PDFium. diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx index 38f984661ec5..de15cadd4c36 100644 --- a/sw/qa/core/text/text.cxx +++ b/sw/qa/core/text/text.cxx @@ -667,13 +667,14 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testContentControlPDFFont) // Then make sure that the widget in the PDF result has that custom font size: std::unique_ptr pPdfDocument = LoadPdfFromTempFile(); std::unique_ptr pPage = pPdfDocument->openPage(0); + pPage->onAfterLoadPage(pPdfDocument.get()); CPPUNIT_ASSERT_EQUAL(1, pPage->getAnnotationCount()); std::unique_ptr pAnnotation = pPage->getAnnotation(0); // Without the accompanying fix in place, this test would have failed with: // - Expected: 24 // - Actual : 8 // i.e. i.e. the font size was some default, not the 24pt specified in the model. - CPPUNIT_ASSERT_EQUAL(24.0f, pAnnotation->getFormFontSize(pPdfDocument.get())); + CPPUNIT_ASSERT_EQUAL(24.0f, pAnnotation->getFontSize(pPdfDocument.get())); } CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testComboContentControlPDF) diff --git a/vcl/source/pdf/PDFiumLibrary.cxx b/vcl/source/pdf/PDFiumLibrary.cxx index c5219ec9f7bc..c6781bca2f26 100644 --- a/vcl/source/pdf/PDFiumLibrary.cxx +++ b/vcl/source/pdf/PDFiumLibrary.cxx @@ -250,7 +250,7 @@ public: std::vector getAttachmentPoints(size_t nIndex) override; std::vector getLineGeometry() override; PDFFormFieldType getFormFieldType(PDFiumDocument* pDoc) override; - float getFormFontSize(PDFiumDocument* pDoc) override; + float getFontSize(PDFiumDocument* pDoc) override; OUString getFormFieldAlternateName(PDFiumDocument* pDoc) override; int getFormFieldFlags(PDFiumDocument* pDoc) override; }; @@ -388,6 +388,8 @@ public: bool hasTransparency() override; bool hasLinks() override; + + void onAfterLoadPage(PDFiumDocument* pDoc) override; }; /// Wrapper around FPDF_FORMHANDLE. @@ -780,6 +782,12 @@ bool PDFiumPageImpl::hasLinks() return FPDFLink_Enumerate(mpPage, &nStartPos, &pLinkAnnot); } +void PDFiumPageImpl::onAfterLoadPage(PDFiumDocument* pDoc) +{ + auto pDocImpl = static_cast(pDoc); + FORM_OnAfterLoadPage(mpPage, pDocImpl->getFormHandlePointer()); +} + PDFiumPageObjectImpl::PDFiumPageObjectImpl(FPDF_PAGEOBJECT pPageObject) : mpPageObject(pPageObject) { @@ -1180,11 +1188,11 @@ int PDFiumAnnotationImpl::getFormFieldFlags(PDFiumDocument* pDoc) return FPDFAnnot_GetFormFieldFlags(pDocImpl->getFormHandlePointer(), mpAnnotation); } -float PDFiumAnnotationImpl::getFormFontSize(PDFiumDocument* pDoc) +float PDFiumAnnotationImpl::getFontSize(PDFiumDocument* pDoc) { auto pDocImpl = static_cast(pDoc); float fRet{}; - if (!FPDFAnnot_GetFormFontSize(pDocImpl->getFormHandlePointer(), mpAnnotation, &fRet)) + if (!FPDFAnnot_GetFontSize(pDocImpl->getFormHandlePointer(), mpAnnotation, &fRet)) { return 0.0f; } -- cgit