summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-05-14 08:55:58 +0200
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2018-06-04 12:36:28 -0400
commit847cba8a66ad1235d9533ec4d2f573db4ca23a1d (patch)
tree56c83e3cbbaa4bf573842f319eb3f397f2b6a37b
parenta13368fa681910069a49afa76b558bef4b1e796f (diff)
pdfium: update to 3426
Allows dropping the ugly freetype.patch.1. Change-Id: Ifa8a6dac02a49a2c13572e59773261a847efad3f Reviewed-on: https://gerrit.libreoffice.org/54294 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
-rw-r--r--download.lst4
-rw-r--r--external/pdfium/Library_pdfium.mk62
-rw-r--r--external/pdfium/UnpackedTarball_pdfium.mk2
-rw-r--r--external/pdfium/build.patch.1103
-rw-r--r--external/pdfium/freetype.patch.118
-rw-r--r--external/pdfium/icu.patch.113
-rw-r--r--external/pdfium/ubsan.patch19
7 files changed, 152 insertions, 69 deletions
diff --git a/download.lst b/download.lst
index ff3761f43a0d..3481884e0398 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 := 0cd451fb1b301dc1df55f91e644092e505032dcddbdeaf3e2744039377d1bfd0
-export PDFIUM_TARBALL := pdfium-3358.tar.bz2
+export PDFIUM_SHA256SUM := 80331b48166501a192d65476932f17044eeb5f10faa6ea50f4f175169475c957
+export PDFIUM_TARBALL := pdfium-3426.tar.bz2
export PIXMAN_SHA256SUM := 21b6b249b51c6800dc9553b65106e1e37d0e25df942c90531d4c3997aa20a88e
export PIXMAN_TARBALL := e80ebae4da01e77f68744319f01d52a3-pixman-0.34.0.tar.gz
export LIBPNG_SHA256SUM := 2f1e960d92ce3b3abd03d06dfec9637dfbd22febf107a536b44f7a47c60659f6
diff --git a/external/pdfium/Library_pdfium.mk b/external/pdfium/Library_pdfium.mk
index f42f19927637..0019535857a6 100644
--- a/external/pdfium/Library_pdfium.mk
+++ b/external/pdfium/Library_pdfium.mk
@@ -40,7 +40,6 @@ $(eval $(call gb_Library_set_generated_cxx_suffix,pdfium,cpp))
# pdfium
$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
- UnpackedTarball/pdfium/fpdfsdk/cba_annotiterator \
UnpackedTarball/pdfium/fpdfsdk/cfx_systemhandler \
UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_annot \
UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_annothandlermgr \
@@ -61,22 +60,27 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/fpdfsdk/fpdf_structtree \
UnpackedTarball/pdfium/fpdfsdk/fpdf_sysfontinfo \
UnpackedTarball/pdfium/fpdfsdk/fpdf_transformpage \
- UnpackedTarball/pdfium/fpdfsdk/fpdfdoc \
- UnpackedTarball/pdfium/fpdfsdk/fpdfeditimg \
- UnpackedTarball/pdfium/fpdfsdk/fpdfeditpage \
- UnpackedTarball/pdfium/fpdfsdk/fpdfeditpath \
- UnpackedTarball/pdfium/fpdfsdk/fpdfedittext \
- UnpackedTarball/pdfium/fpdfsdk/fpdfformfill \
- UnpackedTarball/pdfium/fpdfsdk/fpdfsave \
- UnpackedTarball/pdfium/fpdfsdk/fpdftext \
- UnpackedTarball/pdfium/fpdfsdk/fpdfview \
- UnpackedTarball/pdfium/fpdfsdk/fsdk_actionhandler \
- UnpackedTarball/pdfium/fpdfsdk/fsdk_pauseadapter \
- UnpackedTarball/pdfium/fpdfsdk/pdfsdk_fieldaction \
- UnpackedTarball/pdfium/fpdfsdk/fsdk_filewriteadapter \
- UnpackedTarball/pdfium/fpdfsdk/fpdfannot \
- UnpackedTarball/pdfium/fpdfsdk/fpdfattachment \
- UnpackedTarball/pdfium/fpdfsdk/fpdfcatalog \
+ UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_actionhandler \
+ UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_annotiterator \
+ UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_customaccess \
+ UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_fieldaction \
+ UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_filewriteadapter \
+ UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_helpers \
+ UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_memoryaccess \
+ UnpackedTarball/pdfium/fpdfsdk/fpdf_annot \
+ UnpackedTarball/pdfium/fpdfsdk/fpdf_attachment \
+ UnpackedTarball/pdfium/fpdfsdk/fpdf_catalog \
+ UnpackedTarball/pdfium/fpdfsdk/fpdf_doc \
+ UnpackedTarball/pdfium/fpdfsdk/fpdf_editimg \
+ UnpackedTarball/pdfium/fpdfsdk/fpdf_editpage \
+ UnpackedTarball/pdfium/fpdfsdk/fpdf_editpath \
+ UnpackedTarball/pdfium/fpdfsdk/fpdf_edittext \
+ UnpackedTarball/pdfium/fpdfsdk/fpdf_formfill \
+ UnpackedTarball/pdfium/fpdfsdk/fpdf_save \
+ UnpackedTarball/pdfium/fpdfsdk/fpdf_text \
+ UnpackedTarball/pdfium/fpdfsdk/fpdf_view \
+ UnpackedTarball/pdfium/fpdfsdk/ipdfsdk_pauseadapter \
+ UnpackedTarball/pdfium/fpdfsdk/cpdf_annotcontext \
))
# fdrm
@@ -356,7 +360,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
# fxcrt
$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
- UnpackedTarball/pdfium/core/fxcrt/cfx_blockbuffer \
UnpackedTarball/pdfium/core/fxcrt/cfx_memorystream \
UnpackedTarball/pdfium/core/fxcrt/cfx_seekablestreamproxy \
UnpackedTarball/pdfium/core/fxcrt/fx_bidi \
@@ -367,13 +370,13 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fxcrt/fx_system \
UnpackedTarball/pdfium/core/fxcrt/fx_ucddata \
UnpackedTarball/pdfium/core/fxcrt/fx_unicode \
- UnpackedTarball/pdfium/core/fxcrt/xml/cxml_attritem \
- UnpackedTarball/pdfium/core/fxcrt/xml/cxml_databufacc \
- UnpackedTarball/pdfium/core/fxcrt/xml/cxml_element \
- UnpackedTarball/pdfium/core/fxcrt/xml/cxml_parser \
- UnpackedTarball/pdfium/core/fxcrt/xml/cxml_content \
- UnpackedTarball/pdfium/core/fxcrt/xml/cxml_object \
- UnpackedTarball/pdfium/core/fxcrt/xml/cfx_saxcontext \
+ UnpackedTarball/pdfium/core/fxcrt/xml/cfx_xmldocument \
+ UnpackedTarball/pdfium/core/fxcrt/xml/cfx_xmlelement \
+ UnpackedTarball/pdfium/core/fxcrt/xml/cfx_xmlparser \
+ UnpackedTarball/pdfium/core/fxcrt/xml/cfx_xmlnode \
+ UnpackedTarball/pdfium/core/fxcrt/xml/cfx_xmlinstruction \
+ UnpackedTarball/pdfium/core/fxcrt/xml/cfx_xmltext \
+ UnpackedTarball/pdfium/core/fxcrt/xml/cfx_xmlchardata \
UnpackedTarball/pdfium/core/fxcrt/css/cfx_csscolorvalue \
UnpackedTarball/pdfium/core/fxcrt/css/cfx_csscomputedstyle \
UnpackedTarball/pdfium/core/fxcrt/css/cfx_csscustomproperty \
@@ -406,6 +409,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fxcrt/widestring \
UnpackedTarball/pdfium/core/fxcrt/cfx_seekablemultistream \
UnpackedTarball/pdfium/core/fxcrt/css/cfx_cssdata \
+ UnpackedTarball/pdfium/core/fxcrt/fx_codepage \
))
# fxge
@@ -439,7 +443,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fxge/fontdata/chromefontdata/FoxitSerifMM \
UnpackedTarball/pdfium/core/fxge/fontdata/chromefontdata/FoxitSymbol \
UnpackedTarball/pdfium/core/fxge/freetype/fx_freetype \
- UnpackedTarball/pdfium/core/fxge/ifx_renderdevicedriver \
+ UnpackedTarball/pdfium/core/fxge/renderdevicedriver_iface \
UnpackedTarball/pdfium/core/fxge/agg/fx_agg_driver \
UnpackedTarball/pdfium/core/fxge/cfx_cliprgn \
UnpackedTarball/pdfium/core/fxge/cfx_color \
@@ -466,6 +470,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/fxjs/cjs_event_context_stub \
UnpackedTarball/pdfium/fxjs/cjs_runtimestub \
+ UnpackedTarball/pdfium/fxjs/ijs_runtime \
))
# pwl
@@ -546,6 +551,8 @@ $(eval $(call gb_Library_use_externals,pdfium,\
libjpeg \
lcms2 \
zlib \
+ icu_headers \
+ icuuc \
))
ifneq (,$(filter LINUX ANDROID,$(OS)))
@@ -579,10 +586,8 @@ $(eval $(call gb_Library_add_generated_cobjects,pdfium,\
UnpackedTarball/pdfium/third_party/freetype/src/src/base/ftbitmap \
UnpackedTarball/pdfium/third_party/freetype/src/src/base/ftglyph \
UnpackedTarball/pdfium/third_party/freetype/src/src/base/ftinit \
- UnpackedTarball/pdfium/third_party/freetype/src/src/base/ftlcdfil \
UnpackedTarball/pdfium/third_party/freetype/src/src/base/ftmm \
UnpackedTarball/pdfium/third_party/freetype/src/src/base/ftsystem \
- UnpackedTarball/pdfium/third_party/freetype/src/src/base/ftfntfmt \
UnpackedTarball/pdfium/third_party/freetype/src/src/cff/cff \
UnpackedTarball/pdfium/third_party/freetype/src/src/cid/type1cid \
UnpackedTarball/pdfium/third_party/freetype/src/src/psaux/psaux \
@@ -603,7 +608,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fxge/win32/cpsoutput \
UnpackedTarball/pdfium/core/fxge/win32/fx_win32_device \
UnpackedTarball/pdfium/core/fxge/win32/fx_win32_dib \
- UnpackedTarball/pdfium/core/fxge/win32/fx_win32_dwrite \
UnpackedTarball/pdfium/core/fxge/win32/fx_win32_gdipext \
UnpackedTarball/pdfium/core/fxge/win32/fx_win32_print \
))
diff --git a/external/pdfium/UnpackedTarball_pdfium.mk b/external/pdfium/UnpackedTarball_pdfium.mk
index c917d63a4cdd..6a20b8f7d590 100644
--- a/external/pdfium/UnpackedTarball_pdfium.mk
+++ b/external/pdfium/UnpackedTarball_pdfium.mk
@@ -10,7 +10,7 @@
pdfium_patches :=
pdfium_patches += visibility.patch.1
pdfium_patches += ubsan.patch
-pdfium_patches += freetype.patch.1
+pdfium_patches += icu.patch.1
# Fixes build on our baseline.
pdfium_patches += build.patch.1
# Adds missing editing API
diff --git a/external/pdfium/build.patch.1 b/external/pdfium/build.patch.1
index b852383ff84b..89d8e5e7d8d0 100644
--- a/external/pdfium/build.patch.1
+++ b/external/pdfium/build.patch.1
@@ -19,3 +19,106 @@ index 8e01127b0..f4ce4d915 100644
if (m_Storer.GetBitmap()->IsAlphaMask()) {
CalcAlpha(cdata);
} else {
+diff --git a/core/fxcrt/string_view_template.h b/core/fxcrt/string_view_template.h
+index 05694cf24..101253814 100644
+--- a/core/fxcrt/string_view_template.h
++++ b/core/fxcrt/string_view_template.h
+@@ -231,9 +231,6 @@ inline bool operator<(const T* lhs, const StringViewTemplate<T>& rhs) {
+ return rhs > lhs;
+ }
+
+-extern template class StringViewTemplate<char>;
+-extern template class StringViewTemplate<wchar_t>;
+-
+ using ByteStringView = StringViewTemplate<char>;
+ using WideStringView = StringViewTemplate<wchar_t>;
+
+diff --git a/core/fpdfdoc/cpdf_metadata.cpp b/core/fpdfdoc/cpdf_metadata.cpp
+index 323de4ffc..f11a0b0ad 100644
+--- a/core/fpdfdoc/cpdf_metadata.cpp
++++ b/core/fpdfdoc/cpdf_metadata.cpp
+@@ -74,7 +74,7 @@ std::vector<UnsupportedFeature> CPDF_Metadata::CheckForSharedForm() const {
+ CFX_XMLParser parser(stream);
+ std::unique_ptr<CFX_XMLDocument> doc = parser.Parse();
+ if (!doc)
+- return {};
++ return std::vector<UnsupportedFeature>();
+
+ std::vector<UnsupportedFeature> unsupported;
+ CheckForSharedFormInternal(doc->GetRoot(), &unsupported);
+diff --git a/fpdfsdk/cpdf_annotcontext.cpp b/fpdfsdk/cpdf_annotcontext.cpp
+index 20c5fc343..a40cd1eae 100644
+--- a/fpdfsdk/cpdf_annotcontext.cpp
++++ b/fpdfsdk/cpdf_annotcontext.cpp
+@@ -16,12 +16,12 @@ CPDF_AnnotContext::CPDF_AnnotContext(CPDF_Dictionary* pAnnotDict,
+ CPDF_Page* pPage,
+ CPDF_Stream* pStream)
+ : m_pAnnotDict(pAnnotDict), m_pPage(pPage) {
+- SetForm(pStream);
++ SetForm_(pStream);
+ }
+
+ CPDF_AnnotContext::~CPDF_AnnotContext() = default;
+
+-void CPDF_AnnotContext::SetForm(CPDF_Stream* pStream) {
++void CPDF_AnnotContext::SetForm_(CPDF_Stream* pStream) {
+ if (!pStream)
+ return;
+
+diff --git a/fpdfsdk/cpdf_annotcontext.h b/fpdfsdk/cpdf_annotcontext.h
+index 38cc91e03..7904ae044 100644
+--- a/fpdfsdk/cpdf_annotcontext.h
++++ b/fpdfsdk/cpdf_annotcontext.h
+@@ -23,7 +23,7 @@ class CPDF_AnnotContext {
+ CPDF_Stream* pStream);
+ ~CPDF_AnnotContext();
+
+- void SetForm(CPDF_Stream* pStream);
++ void SetForm_(CPDF_Stream* pStream);
+ bool HasForm() const { return !!m_pAnnotForm; }
+ CPDF_Form* GetForm() const { return m_pAnnotForm.get(); }
+ CPDF_Dictionary* GetAnnotDict() const { return m_pAnnotDict.Get(); }
+diff --git a/third_party/base/span.h b/third_party/base/span.h
+index 0fb627ba8..f71c362e2 100644
+--- a/third_party/base/span.h
++++ b/third_party/base/span.h
+@@ -214,7 +214,7 @@ class span {
+ // Conversions from spans of compatible types: this allows a span<T> to be
+ // seamlessly used as a span<const T>, but not the other way around.
+ template <typename U, typename = internal::EnableIfLegalSpanConversion<U, T>>
+- constexpr span(const span<U>& other) : span(other.data(), other.size()) {}
++ span(const span<U>& other) : span(other.data(), other.size()) {}
+ span& operator=(const span& other) noexcept = default;
+ ~span() noexcept {
+ if (!size_) {
+diff --git a/fpdfsdk/fpdf_annot.cpp b/fpdfsdk/fpdf_annot.cpp
+index d3bf38d31..e8aea9707 100644
+--- a/fpdfsdk/fpdf_annot.cpp
++++ b/fpdfsdk/fpdf_annot.cpp
+@@ -389,7 +389,7 @@ FPDFAnnot_AppendObject(FPDF_ANNOTATION annot, FPDF_PAGEOBJECT obj) {
+
+ // Get the annotation's corresponding form object for parsing its AP stream.
+ if (!pAnnot->HasForm())
+- pAnnot->SetForm(pStream);
++ pAnnot->SetForm_(pStream);
+
+ // Check that the object did not come from the same annotation. If this check
+ // succeeds, then it is assumed that the object came from
+@@ -425,7 +425,7 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFAnnot_GetObjectCount(FPDF_ANNOTATION annot) {
+ if (!pStream)
+ return 0;
+
+- pAnnot->SetForm(pStream);
++ pAnnot->SetForm_(pStream);
+ }
+ return pdfium::CollectionSize<int>(*pAnnot->GetForm()->GetPageObjectList());
+ }
+@@ -442,7 +442,7 @@ FPDFAnnot_GetObject(FPDF_ANNOTATION annot, int index) {
+ if (!pStream)
+ return nullptr;
+
+- pAnnot->SetForm(pStream);
++ pAnnot->SetForm_(pStream);
+ }
+
+ return FPDFPageObjectFromCPDFPageObject(
diff --git a/external/pdfium/freetype.patch.1 b/external/pdfium/freetype.patch.1
deleted file mode 100644
index 90f230c54e69..000000000000
--- a/external/pdfium/freetype.patch.1
+++ /dev/null
@@ -1,18 +0,0 @@
-Upstream provides this define from the commandline, but while this define is
-needed for fxge, it breaks the build for the bundled freetype. gbuild doesn't
-support having different defines within the same Library, so just patch the
-single translation unit that actually needs the define.
-
-Long-term perhaps the solution is to enable freetype on all platforms inside
-LO, then we don't have to build freetype as part of pdfium, so we can let
-gbuild define this from the commandline.
-
-diff --git a/core/fxge/freetype/fx_freetype.cpp b/core/fxge/freetype/fx_freetype.cpp
-index 0ae207b02..879bf5ab9 100644
---- a/core/fxge/freetype/fx_freetype.cpp
-+++ b/core/fxge/freetype/fx_freetype.cpp
-@@ -1,3 +1,4 @@
-+#define DEFINE_PS_TABLES
- // Copyright 2014 PDFium Authors. All rights reserved.
- // Use of this source code is governed by a BSD-style license that can be
- // found in the LICENSE file.
diff --git a/external/pdfium/icu.patch.1 b/external/pdfium/icu.patch.1
new file mode 100644
index 000000000000..85e837d9b99f
--- /dev/null
+++ b/external/pdfium/icu.patch.1
@@ -0,0 +1,13 @@
+diff --git a/core/fxcrt/fx_extension.h b/core/fxcrt/fx_extension.h
+index ff96de0f7..0195bd06f 100644
+--- a/core/fxcrt/fx_extension.h
++++ b/core/fxcrt/fx_extension.h
+@@ -13,7 +13,7 @@
+
+ #include "core/fxcrt/fx_string.h"
+ #include "third_party/base/span.h"
+-#include "third_party/icu/source/common/unicode/uchar.h"
++#include <unicode/uchar.h>
+
+ #define FX_INVALID_OFFSET static_cast<uint32_t>(-1)
+
diff --git a/external/pdfium/ubsan.patch b/external/pdfium/ubsan.patch
index af39e3d95db3..91428326fc5d 100644
--- a/external/pdfium/ubsan.patch
+++ b/external/pdfium/ubsan.patch
@@ -22,22 +22,3 @@
int rowbytes = std::min(abs(src_pitch), dest_pitch);
for (int row = 0; row < bmheight; row++)
memcpy(pDestBuf + row * dest_pitch, pSrcBuf + row * src_pitch, rowbytes);
---- third_party/agg23/agg_rasterizer_scanline_aa.h
-+++ third_party/agg23/agg_rasterizer_scanline_aa.h
-@@ -349,14 +349,14 @@ public:
- cover += cur_cell->cover;
- }
- if(area) {
-- alpha = calculate_alpha((cover << (poly_base_shift + 1)) - area, no_smooth);
-+ alpha = calculate_alpha(int(unsigned(cover) << (poly_base_shift + 1)) - area, no_smooth);
- if(alpha) {
- sl.add_cell(x, alpha);
- }
- x++;
- }
- if(num_cells && cur_cell->x > x) {
-- alpha = calculate_alpha(cover << (poly_base_shift + 1), no_smooth);
-+ alpha = calculate_alpha(unsigned(cover) << (poly_base_shift + 1), no_smooth);
- if(alpha) {
- sl.add_span(x, cur_cell->x - x, alpha);
- }