From 0ee0ca3036629b69bf20b448d74991fd133f08ac Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 16 Jul 2019 23:32:31 +0200 Subject: [PATCH] external: update pdfium to 3849 Change-Id: I616f57bd9de72b078500a290bf9ff89c71773f26 Reviewed-on: https://gerrit.libreoffice.org/75736 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- download.lst | 4 +- external/pdfium/Library_pdfium.mk | 41 +++++++------ .../pdfium/inc/pch/precompiled_pdfium.hxx | 46 +++++++------- external/pdfium/ubsan.patch | 6 +- external/pdfium/windows7.patch.1 | 60 +++++++++---------- svx/source/svdraw/svdpdf.cxx | 4 +- vcl/qa/cppunit/pdfexport/pdfexport.cxx | 6 +- 7 files changed, 89 insertions(+), 78 deletions(-) diff --git a/download.lst b/download.lst index 8888d6e4716f..a5edc192b64d 100644 --- a/download.lst +++ b/download.lst @@ -200,8 +200,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 := e3faddcf741336c64ca2e6f72b23e9e60979969b2cf67c878c9a5bc38328cfc4 -export PDFIUM_TARBALL := pdfium-3794.tar.bz2 +export PDFIUM_SHA256SUM := 43ef702b65a21d66fc580b1b9c77893e33fe07dd764a17c2aac08ecec534c8ad +export PDFIUM_TARBALL := pdfium-3849.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 c24894304078..34c2e9a3fd43 100644 --- a/external/pdfium/Library_pdfium.mk +++ b/external/pdfium/Library_pdfium.mk @@ -87,7 +87,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ # formfiller $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ - UnpackedTarball/pdfium/fpdfsdk/formfiller/cba_fontmap \ UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_checkbox \ UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_combobox \ UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_formfiller \ @@ -165,7 +164,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fpdfapi/cmaps/Korea1/cmaps_korea1 \ UnpackedTarball/pdfium/core/fpdfapi/cmaps/fpdf_cmaps \ UnpackedTarball/pdfium/core/fpdfapi/cpdf_modulemgr \ - UnpackedTarball/pdfium/core/fpdfapi/cpdf_pagerendercontext \ + UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_pagerendercontext \ UnpackedTarball/pdfium/core/fpdfapi/edit/cpdf_pagecontentgenerator \ UnpackedTarball/pdfium/core/fpdfapi/font/cpdf_cidfont \ UnpackedTarball/pdfium/core/fpdfapi/font/cpdf_font \ @@ -272,11 +271,13 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fpdfapi/parser/cpdf_page_object_avail \ UnpackedTarball/pdfium/core/fpdfapi/parser/cpdf_cross_ref_avail \ UnpackedTarball/pdfium/core/fpdfapi/edit/cpdf_pagecontentmanager \ - UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_transparency \ + UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_transparency \ UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_dibbase \ UnpackedTarball/pdfium/core/fpdfapi/parser/cpdf_object_stream \ UnpackedTarball/pdfium/core/fpdfapi/parser/cpdf_cross_ref_table \ UnpackedTarball/pdfium/core/fpdfapi/edit/cpdf_stringarchivestream \ + UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_occontext \ + UnpackedTarball/pdfium/core/fpdfapi/edit/cpdf_contentstream_write_utils \ )) # fpdfdoc @@ -303,7 +304,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fpdfdoc/cpdf_metadata \ UnpackedTarball/pdfium/core/fpdfdoc/cpdf_nametree \ UnpackedTarball/pdfium/core/fpdfdoc/cpdf_numbertree \ - UnpackedTarball/pdfium/core/fpdfdoc/cpdf_occontext \ UnpackedTarball/pdfium/core/fpdfdoc/cpdf_pagelabel \ UnpackedTarball/pdfium/core/fpdfdoc/cpdf_variabletext \ UnpackedTarball/pdfium/core/fpdfdoc/cpdf_viewerpreferences \ @@ -314,6 +314,8 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fpdfdoc/ctypeset \ UnpackedTarball/pdfium/core/fpdfdoc/cpdf_structelement \ UnpackedTarball/pdfium/core/fpdfdoc/cpdf_structtree \ + UnpackedTarball/pdfium/core/fpdfdoc/cba_fontmap \ + UnpackedTarball/pdfium/core/fpdfdoc/cpdf_color_utils \ )) # fpdftext @@ -326,7 +328,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ # fxcodec $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ - UnpackedTarball/pdfium/core/fxcodec/codec/fx_codec \ + UnpackedTarball/pdfium/core/fxcodec/fx_codec \ UnpackedTarball/pdfium/core/fxcodec/jbig2/JBig2_ArithDecoder \ UnpackedTarball/pdfium/core/fxcodec/jbig2/JBig2_ArithIntDecoder \ UnpackedTarball/pdfium/core/fxcodec/jbig2/JBig2_BitStream \ @@ -343,18 +345,21 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fxcodec/jbig2/JBig2_Segment \ UnpackedTarball/pdfium/core/fxcodec/jbig2/JBig2_SymbolDict \ UnpackedTarball/pdfium/core/fxcodec/jbig2/JBig2_TrdProc \ - UnpackedTarball/pdfium/core/fxcodec/bmp/fx_bmp \ - UnpackedTarball/pdfium/core/fxcodec/codec/ccodec_scanlinedecoder \ UnpackedTarball/pdfium/core/fxcodec/gif/cfx_gif \ UnpackedTarball/pdfium/core/fxcodec/gif/cfx_gifcontext \ UnpackedTarball/pdfium/core/fxcodec/gif/cfx_lzwdecompressor \ - UnpackedTarball/pdfium/core/fxcodec/codec/cfx_codec_memory \ - UnpackedTarball/pdfium/core/fxcodec/codec/ccodec_faxmodule \ - UnpackedTarball/pdfium/core/fxcodec/codec/ccodec_iccmodule \ - UnpackedTarball/pdfium/core/fxcodec/codec/ccodec_jbig2module \ - UnpackedTarball/pdfium/core/fxcodec/codec/ccodec_jpxmodule \ - UnpackedTarball/pdfium/core/fxcodec/codec/ccodec_jpegmodule \ - UnpackedTarball/pdfium/core/fxcodec/codec/ccodec_flatemodule \ + UnpackedTarball/pdfium/core/fxcodec/cfx_codec_memory \ + UnpackedTarball/pdfium/core/fxcodec/fax/faxmodule \ + UnpackedTarball/pdfium/core/fxcodec/scanlinedecoder \ + UnpackedTarball/pdfium/core/fxcodec/jbig2/jbig2module \ + UnpackedTarball/pdfium/core/fxcodec/jpeg/jpegmodule \ + UnpackedTarball/pdfium/core/fxcodec/jpx/cjpx_decoder \ + UnpackedTarball/pdfium/core/fxcodec/jpx/jpx_decode_utils \ + UnpackedTarball/pdfium/core/fxcodec/jbig2/JBig2_DocumentContext \ + UnpackedTarball/pdfium/core/fxcodec/basic/basicmodule \ + UnpackedTarball/pdfium/core/fxcodec/jpx/jpxmodule \ + UnpackedTarball/pdfium/core/fxcodec/flate/flatemodule \ + UnpackedTarball/pdfium/core/fxcodec/icc/iccmodule \ )) # fxcrt @@ -403,12 +408,12 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fxcrt/fx_random \ UnpackedTarball/pdfium/core/fxcrt/fx_string \ UnpackedTarball/pdfium/core/fxcrt/widestring \ - UnpackedTarball/pdfium/core/fxcrt/cfx_seekablemultistream \ UnpackedTarball/pdfium/core/fxcrt/css/cfx_cssdata \ UnpackedTarball/pdfium/core/fxcrt/fx_codepage \ UnpackedTarball/pdfium/core/fxcrt/fx_number \ UnpackedTarball/pdfium/core/fxcrt/cfx_utf8encoder \ UnpackedTarball/pdfium/core/fxcrt/cfx_readonlymemorystream \ + UnpackedTarball/pdfium/core/fxcrt/observed_ptr \ )) # fxge @@ -445,7 +450,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fxge/agg/fx_agg_driver \ UnpackedTarball/pdfium/core/fxge/cfx_cliprgn \ UnpackedTarball/pdfium/core/fxge/cfx_color \ - UnpackedTarball/pdfium/core/fxge/cfx_facecache \ + UnpackedTarball/pdfium/core/fxge/cfx_glyphcache \ UnpackedTarball/pdfium/core/fxge/cfx_folderfontinfo \ UnpackedTarball/pdfium/core/fxge/cfx_font \ UnpackedTarball/pdfium/core/fxge/cfx_fontcache \ @@ -458,7 +463,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fxge/cfx_renderdevice \ UnpackedTarball/pdfium/core/fxge/cfx_substfont \ UnpackedTarball/pdfium/core/fxge/cfx_unicodeencoding \ - UnpackedTarball/pdfium/core/fxge/cttfontdesc \ UnpackedTarball/pdfium/core/fxge/fx_ge_fontmap \ UnpackedTarball/pdfium/core/fxge/fx_ge_linux \ UnpackedTarball/pdfium/core/fxge/cfx_glyphbitmap \ @@ -466,6 +470,9 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\ UnpackedTarball/pdfium/core/fxge/text_glyph_pos \ UnpackedTarball/pdfium/core/fxge/fx_font \ UnpackedTarball/pdfium/core/fxge/dib/cfx_dibbase \ + UnpackedTarball/pdfium/core/fxge/dib/cfx_cmyk_to_srgb \ + UnpackedTarball/pdfium/core/fxge/text_char_pos \ + UnpackedTarball/pdfium/core/fxge/cfx_face \ )) # javascript, build with pdf_enable_v8 disabled. diff --git a/external/pdfium/inc/pch/precompiled_pdfium.hxx b/external/pdfium/inc/pch/precompiled_pdfium.hxx index c70c4d16a101..ad1239d5bb28 100644 --- a/external/pdfium/inc/pch/precompiled_pdfium.hxx +++ b/external/pdfium/inc/pch/precompiled_pdfium.hxx @@ -79,7 +79,7 @@ #include #include #include -#include +#include #include #include #include @@ -120,10 +120,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -139,6 +141,7 @@ #include #include #include +#include #include #include #include @@ -188,9 +191,9 @@ #include #include #include -#include #include #include +#include #include #include #include @@ -200,6 +203,7 @@ #include #include #include +#include #include #include #include @@ -213,7 +217,6 @@ #include #include #include -#include #include #include #include @@ -230,29 +233,22 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include #include +#include +#include #include #include #include #include #include +#include #include #include #include @@ -265,6 +261,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include #include #include #include @@ -273,7 +275,6 @@ #include #include #include -#include #include #include #include @@ -313,6 +314,7 @@ #include #include #include +#include #include #include #include @@ -329,7 +331,7 @@ #include #include #include -#include +#include #include #include #include @@ -337,15 +339,16 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include +#include #include #include #include @@ -360,9 +363,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -382,7 +387,6 @@ #include #include #include -#include #include #include #include diff --git a/external/pdfium/ubsan.patch b/external/pdfium/ubsan.patch index 9939b6e9e4b6..1d03c28a4d15 100644 --- a/external/pdfium/ubsan.patch +++ b/external/pdfium/ubsan.patch @@ -10,9 +10,9 @@ m_String[offset + nLen] = 0; } ---- core/fxge/cfx_facecache.cpp -+++ core/fxge/cfx_facecache.cpp -@@ -183,7 +183,8 @@ std::unique_ptr CFX_FaceCache::RenderGlyph( +--- core/fxge/cfx_glyphcache.cpp ++++ core/fxge/cfx_glyphcache.cpp +@@ -183,7 +183,8 @@ std::unique_ptr CFX_GlyphCache::RenderGlyph( } } } else { diff --git a/external/pdfium/windows7.patch.1 b/external/pdfium/windows7.patch.1 index 00603c0570cb..d33f273ff4ca 100644 --- a/external/pdfium/windows7.patch.1 +++ b/external/pdfium/windows7.patch.1 @@ -1,34 +1,34 @@ diff --git a/third_party/base/win/win_util.cc b/third_party/base/win/win_util.cc -index 9c90b9d62..356eca74d 100644 +index ae2dba84d..7a3718848 100644 --- a/third_party/base/win/win_util.cc +++ b/third_party/base/win/win_util.cc @@ -12,28 +12,7 @@ namespace base { - namespace win { - - bool IsUser32AndGdi32Available() { -- static auto is_user32_and_gdi32_available = []() { -- // If win32k syscalls aren't disabled, then user32 and gdi32 are available. -- -- typedef decltype( -- GetProcessMitigationPolicy)* GetProcessMitigationPolicyType; -- GetProcessMitigationPolicyType get_process_mitigation_policy_func = -- reinterpret_cast(GetProcAddress( -- GetModuleHandle(L"kernel32.dll"), "GetProcessMitigationPolicy")); -- -- if (!get_process_mitigation_policy_func) -- return true; -- -- PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY policy = {}; -- if (get_process_mitigation_policy_func(GetCurrentProcess(), -- ProcessSystemCallDisablePolicy, -- &policy, sizeof(policy))) { -- return policy.DisallowWin32kSystemCalls == 0; -- } -- -- return true; -- }(); -- return is_user32_and_gdi32_available; -+ return true; - } - - } // namespace win + namespace win { + + bool IsUser32AndGdi32Available() { +- static auto is_user32_and_gdi32_available = []() { +- // If win32k syscalls aren't disabled, then user32 and gdi32 are available. +- +- typedef decltype( +- GetProcessMitigationPolicy)* GetProcessMitigationPolicyType; +- GetProcessMitigationPolicyType get_process_mitigation_policy_func = +- reinterpret_cast(GetProcAddress( +- GetModuleHandle(L"kernel32.dll"), "GetProcessMitigationPolicy")); +- +- if (!get_process_mitigation_policy_func) +- return true; +- +- PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY policy = {}; +- if (get_process_mitigation_policy_func(GetCurrentProcess(), +- ProcessSystemCallDisablePolicy, +- &policy, sizeof(policy))) { +- return policy.DisallowWin32kSystemCalls == 0; +- } +- +- return true; +- }(); +- return is_user32_and_gdi32_available; ++ return true; + } + + } // namespace win diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index 552575442039..7bcb2cae241d 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -1140,12 +1140,12 @@ void ImpSdrPdfImport::ImportPath(FPDF_PAGEOBJECT pPageObject, int /*nPageObjectI unsigned int nG; unsigned int nB; unsigned int nA; - FPDFPath_GetFillColor(pPageObject, &nR, &nG, &nB, &nA); + FPDFPageObj_GetFillColor(pPageObject, &nR, &nG, &nB, &nA); mpVD->SetFillColor(Color(nR, nG, nB)); if (bStroke) { - FPDFPath_GetStrokeColor(pPageObject, &nR, &nG, &nB, &nA); + FPDFPageObj_GetStrokeColor(pPageObject, &nR, &nG, &nB, &nA); mpVD->SetLineColor(Color(nR, nG, nB)); } else diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx index 8f82c8c3528b..6b958683d143 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx @@ -351,7 +351,7 @@ void PdfExportTest::testTdf105461() continue; unsigned int nRed = 0, nGreen = 0, nBlue = 0, nAlpha = 0; - FPDFPath_GetFillColor(pPdfPageObject, &nRed, &nGreen, &nBlue, &nAlpha); + FPDFPageObj_GetFillColor(pPdfPageObject, &nRed, &nGreen, &nBlue, &nAlpha); if (Color(nRed, nGreen, nBlue) == COL_YELLOW) ++nYellowPathCount; } @@ -406,7 +406,7 @@ void PdfExportTest::testTdf107868() continue; unsigned int nRed = 0, nGreen = 0, nBlue = 0, nAlpha = 0; - FPDFPath_GetFillColor(pPdfPageObject, &nRed, &nGreen, &nBlue, &nAlpha); + FPDFPageObj_GetFillColor(pPdfPageObject, &nRed, &nGreen, &nBlue, &nAlpha); if (Color(nRed, nGreen, nBlue) == COL_WHITE) ++nWhitePathCount; } @@ -902,7 +902,7 @@ void PdfExportTest::testTdf108963() continue; unsigned int nRed = 0, nGreen = 0, nBlue = 0, nAlpha = 0; - FPDFPath_GetFillColor(pPdfPageObject, &nRed, &nGreen, &nBlue, &nAlpha); + FPDFPageObj_GetFillColor(pPdfPageObject, &nRed, &nGreen, &nBlue, &nAlpha); if (Color(nRed, nGreen, nBlue) == COL_YELLOW) { ++nYellowPathCount;