diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-01-14 21:34:52 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-01-15 12:21:31 +0100 |
commit | 1cb70721ba00dd6c6958f0a10e39aa5c1866ec96 (patch) | |
tree | 91492d2689fc3e599024fd5aaa6d99c01aef0593 | |
parent | 891e89004b227326b6fae4c4a2a90dce741dc7aa (diff) |
external: update pdfium to 4021
Change-Id: I1c3280e811bf65641bf559e3f01bc62e609548f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86811
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
-rw-r--r-- | download.lst | 4 | ||||
-rw-r--r-- | external/pdfium/Library_pdfium.mk | 2 | ||||
-rw-r--r-- | external/pdfium/UnpackedTarball_pdfium.mk | 1 | ||||
-rw-r--r-- | external/pdfium/build.patch.1 | 35 | ||||
-rw-r--r-- | external/pdfium/visibility.patch.1 | 10 | ||||
-rw-r--r-- | solenv/flatpak-manifest.in | 6 | ||||
-rw-r--r-- | svx/source/svdraw/svdpdf.cxx | 21 | ||||
-rw-r--r-- | vcl/qa/cppunit/pdfexport/pdfexport.cxx | 11 |
8 files changed, 41 insertions, 49 deletions
diff --git a/download.lst b/download.lst index 0fdcf72b1b87..18830d01861c 100644 --- a/download.lst +++ b/download.lst @@ -202,8 +202,8 @@ export OWNCLOUD_ANDROID_LIB_SHA256SUM := b18b3e3ef7fae6a79b62f2bb43cc47a5346b633 export OWNCLOUD_ANDROID_LIB_TARBALL := owncloud-android-library-0.9.4-no-binary-deps.tar.gz export PAGEMAKER_SHA256SUM := 66adacd705a7d19895e08eac46d1e851332adf2e736c566bef1164e7a442519d export PAGEMAKER_TARBALL := libpagemaker-0.0.4.tar.xz -export PDFIUM_SHA256SUM := 80d4d6bd8faec226936fcde5521c6e92c0c645126ac3ae72dd2c160ca1749895 -export PDFIUM_TARBALL := pdfium-3963.tar.bz2 +export PDFIUM_SHA256SUM := 55d642468718c45fc8409537a3e8badd7e7e7be18c6e1c4be90eb278d1f1e04a +export PDFIUM_TARBALL := pdfium-4021.tar.bz2 export PIXMAN_SHA256SUM := 21b6b249b51c6800dc9553b65106e1e37d0e25df942c90531d4c3997aa20a88e export PIXMAN_TARBALL := e80ebae4da01e77f68744319f01d52a3-pixman-0.34.0.tar.gz export LIBPNG_SHA256SUM := 505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca diff --git a/external/pdfium/Library_pdfium.mk b/external/pdfium/Library_pdfium.mk index f98a2d11269b..e7618791bcb8 100644 --- a/external/pdfium/Library_pdfium.mk +++ b/external/pdfium/Library_pdfium.mk @@ -315,6 +315,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fpdfdoc/cpdf_structtree \ UnpackedTarball/pdfium/core/fpdfdoc/cba_fontmap \ UnpackedTarball/pdfium/core/fpdfdoc/cpdf_color_utils \ + UnpackedTarball/pdfium/core/fpdfdoc/cpdf_icon \ )) # fpdftext @@ -552,6 +553,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ 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 \ )) # skia_shared diff --git a/external/pdfium/UnpackedTarball_pdfium.mk b/external/pdfium/UnpackedTarball_pdfium.mk index 8f493ea3a0d6..2874bd72719f 100644 --- a/external/pdfium/UnpackedTarball_pdfium.mk +++ b/external/pdfium/UnpackedTarball_pdfium.mk @@ -44,6 +44,7 @@ $(eval $(call gb_UnpackedTarball_set_post_action,pdfium,\ 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/win/win_util.cc third_party/base/win/win_util.cpp \ )) diff --git a/external/pdfium/build.patch.1 b/external/pdfium/build.patch.1 index 47316fe235a1..729d87f5ee8e 100644 --- a/external/pdfium/build.patch.1 +++ b/external/pdfium/build.patch.1 @@ -1,24 +1,3 @@ -diff --git a/core/fxge/dib/cfx_imagetransformer.cpp b/core/fxge/dib/cfx_imagetransformer.cpp -index 8e01127b0..f4ce4d915 100644 ---- a/core/fxge/dib/cfx_imagetransformer.cpp -+++ b/core/fxge/dib/cfx_imagetransformer.cpp -@@ -315,14 +315,14 @@ bool CFX_ImageTransformer::Continue(IFX_PauseIndicator* pPause) { - } else if (pDestMask) { - CalcData cdata = { - pDestMask.Get(), result2stretch, pSrcMaskBuf, -- m_Storer.GetBitmap()->m_pAlphaMask->GetPitch(), -+ static_cast<uint32_t>(m_Storer.GetBitmap()->m_pAlphaMask->GetPitch()), - }; - CalcMask(cdata); - } - - CalcData cdata = {pTransformed.Get(), result2stretch, - m_Storer.GetBitmap()->GetBuffer(), -- m_Storer.GetBitmap()->GetPitch()}; -+ static_cast<uint32_t>(m_Storer.GetBitmap()->GetPitch())}; - if (m_Storer.GetBitmap()->IsAlphaMask()) { - CalcAlpha(cdata); - } else { diff --git a/core/fpdfdoc/cpdf_metadata.cpp b/core/fpdfdoc/cpdf_metadata.cpp index 323de4ffc..f11a0b0ad 100644 --- a/core/fpdfdoc/cpdf_metadata.cpp @@ -58,3 +37,17 @@ index 0fb627ba8..dda1fc8bc 100644 : span(container.data(), container.size()) {} template < typename Container, +--- a/core/fxcrt/fx_memory_wrappers.h.orig 2020-01-15 11:16:03.848760100 +0100 ++++ b/core/fxcrt/fx_memory_wrappers.h 2020-01-15 11:16:44.050531200 +0100 +@@ -23,8 +23,11 @@ + template <class T> + struct FxAllocAllocator { + public: ++#ifndef _WIN32 ++ // MSVC thinks uint8_t is not an arithmetic type. + static_assert(std::is_arithmetic<T>::value, + "Only numeric types allowed in this partition"); ++#endif + + using value_type = T; + using pointer = T*; diff --git a/external/pdfium/visibility.patch.1 b/external/pdfium/visibility.patch.1 index 835528794f4b..14a380bbfa16 100644 --- a/external/pdfium/visibility.patch.1 +++ b/external/pdfium/visibility.patch.1 @@ -1,16 +1,16 @@ diff --git a/public/fpdfview.h b/public/fpdfview.h -index 2b84f07ba..b6c0a356b 100644 +index 0542b0541..2c9a37b4a 100644 --- a/public/fpdfview.h +++ b/public/fpdfview.h -@@ -168,7 +168,6 @@ typedef int FPDF_OBJECT_TYPE; - // Text object enums. - typedef int FPDF_TEXT_RENDERMODE; +@@ -175,7 +175,6 @@ typedef int FPDF_ANNOT_APPEARANCEMODE; + // Dictionary value types. + typedef int FPDF_OBJECT_TYPE; -#if defined(COMPONENT_BUILD) // FPDF_EXPORT should be consistent with |export| in the pdfium_fuzzer // template in testing/fuzzers/BUILD.gn. #if defined(WIN32) -@@ -184,9 +183,6 @@ typedef int FPDF_TEXT_RENDERMODE; +@@ -191,9 +190,6 @@ typedef int FPDF_OBJECT_TYPE; #define FPDF_EXPORT #endif // defined(FPDF_IMPLEMENTATION) #endif // defined(WIN32) diff --git a/solenv/flatpak-manifest.in b/solenv/flatpak-manifest.in index a6243d3aeb95..aea3cbf1b16b 100644 --- a/solenv/flatpak-manifest.in +++ b/solenv/flatpak-manifest.in @@ -69,10 +69,10 @@ "type": "shell" }, { - "url": "https://dev-www.libreoffice.org/src/pdfium-3963.tar.bz2", - "sha256": "80d4d6bd8faec226936fcde5521c6e92c0c645126ac3ae72dd2c160ca1749895", + "url": "https://dev-www.libreoffice.org/src/pdfium-4021.tar.bz2", + "sha256": "55d642468718c45fc8409537a3e8badd7e7e7be18c6e1c4be90eb278d1f1e04a", "type": "file", - "dest-filename": "external/tarballs/pdfium-3963.tar.bz2" + "dest-filename": "external/tarballs/pdfium-4021.tar.bz2" }, { "url": "https://dev-www.libreoffice.org/src/0168229624cfac409e766913506961a8-ucpp-1.3.2.tar.gz", diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index dee1f97d0223..d9d2bde7c476 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -770,9 +770,9 @@ void ImpSdrPdfImport::ImportForm(FPDF_PAGEOBJECT pPageObject, FPDF_TEXTPAGE pTex // Get the form matrix to perform correct translation/scaling of the form sub-objects. const Matrix aOldMatrix = mCurMatrix; - double a, b, c, d, e, f; - FPDFFormObj_GetMatrix(pPageObject, &a, &b, &c, &d, &e, &f); - mCurMatrix = Matrix(a, b, c, d, e, f); + FS_MATRIX matrix; + FPDFFormObj_GetMatrix(pPageObject, &matrix); + mCurMatrix = Matrix(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f); const int nCount = FPDFFormObj_CountObjects(pPageObject); for (int nIndex = 0; nIndex < nCount; ++nIndex) @@ -800,8 +800,8 @@ void ImpSdrPdfImport::ImportText(FPDF_PAGEOBJECT pPageObject, FPDF_TEXTPAGE pTex if (left == right || top == bottom) return; - double a, b, c, d, e, f; - FPDFTextObj_GetMatrix(pPageObject, &a, &b, &c, &d, &e, &f); + FS_MATRIX matrix; + FPDFTextObj_GetMatrix(pPageObject, &matrix); Matrix aTextMatrix(mCurMatrix); aTextMatrix.Transform(left, right, top, bottom); @@ -819,8 +819,8 @@ void ImpSdrPdfImport::ImportText(FPDF_PAGEOBJECT pPageObject, FPDF_TEXTPAGE pTex OUString sText(pText.get(), nActualChars); const double dFontSize = FPDFTextObj_GetFontSize(pPageObject); - double dFontSizeH = fabs(sqrt2(a, c) * dFontSize); - double dFontSizeV = fabs(sqrt2(b, d) * dFontSize); + double dFontSizeH = fabs(sqrt2(matrix.a, matrix.c) * dFontSize); + double dFontSizeV = fabs(sqrt2(matrix.b, matrix.d) * dFontSize); dFontSizeH = lcl_PointToPixel(dFontSizeH); dFontSizeV = lcl_PointToPixel(dFontSizeV); dFontSizeH = lcl_ToLogic(dFontSizeH); @@ -863,6 +863,7 @@ void ImpSdrPdfImport::ImportText(FPDF_PAGEOBJECT pPageObject, FPDF_TEXTPAGE pTex break; case FPDF_TEXTRENDERMODE_STROKE: case FPDF_TEXTRENDERMODE_STROKE_CLIP: + case FPDF_TEXTRENDERMODE_UNKNOWN: break; case FPDF_TEXTRENDERMODE_INVISIBLE: case FPDF_TEXTRENDERMODE_CLIP: @@ -1035,9 +1036,9 @@ void ImpSdrPdfImport::ImportImage(FPDF_PAGEOBJECT pPageObject, int /*nPageObject void ImpSdrPdfImport::ImportPath(FPDF_PAGEOBJECT pPageObject, int /*nPageObjectIndex*/) { - double a, b, c, d, e, f; - FPDFPath_GetMatrix(pPageObject, &a, &b, &c, &d, &e, &f); - Matrix aPathMatrix(a, b, c, d, e, f); + FS_MATRIX matrix; + FPDFPath_GetMatrix(pPageObject, &matrix); + Matrix aPathMatrix(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f); aPathMatrix.Concatinate(mCurMatrix); basegfx::B2DPolyPolygon aPolyPoly; diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx index d6ab844e5bdb..80d88a84adf1 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx @@ -1923,14 +1923,9 @@ void PdfExportTest::testPdfImageResourceInlineXObjectRef() CPPUNIT_ASSERT_EQUAL(1, FPDFFormObj_CountObjects(pInnerFormObject)); FPDF_PAGEOBJECT pImage = FPDFFormObj_GetObject(pInnerFormObject, 0); CPPUNIT_ASSERT_EQUAL(FPDF_PAGEOBJ_IMAGE, FPDFPageObj_GetType(pImage)); - double fA = 0; - double fB = 0; - double fC = 0; - double fD = 0; - double fE = 0; - double fF = 0; - FPDFFormObj_GetMatrix(pInnerFormObject, &fA, &fB, &fC, &fD, &fE, &fF); - basegfx::B2DHomMatrix aMat{ fA, fC, fE, fB, fD, fF }; + FS_MATRIX aMatrix; + FPDFFormObj_GetMatrix(pInnerFormObject, &aMatrix); + basegfx::B2DHomMatrix aMat{ aMatrix.a, aMatrix.c, aMatrix.e, aMatrix.b, aMatrix.d, aMatrix.f }; basegfx::B2DTuple aScale; basegfx::B2DTuple aTranslate; double fRotate = 0; |