download.lst                                   |    4 +--
 external/pdfium/Library_pdfium.mk              |   11 +++++---
 external/pdfium/UnpackedTarball_pdfium.mk      |    5 +++-
 external/pdfium/abseil-trivial.patch           |   31 +++++++++++++++++++++++++
 external/pdfium/build.patch.1                  |   10 ++++----
 external/pdfium/c++20-comparison.patch         |    2 -
 external/pdfium/inc/pch/precompiled_pdfium.hxx |   13 ++++++----
 7 files changed, 58 insertions(+), 18 deletions(-)

New commits:
commit fca8af1e2f75689b2ffb09a4d5216a3c4b9d22b3
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Tue Sep 13 20:26:53 2022 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Mon Sep 19 08:44:34 2022 +0200

    external: update pdfium to 5298
    
    pdfium_arm64.patch.1 is now upstreamed as
    <https://pdfium-review.googlesource.com/c/pdfium/+/96010>.
    
    (cherry picked from commit c97c60f70e9e6de594f7e0e0b85f17944c640dcf)
    
    Change-Id: Iafb1ba480161429094db5446ab50314068ae4cfc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140074
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/download.lst b/download.lst
index 0de3e9498867..6f20cb9db0b5 100644
--- a/download.lst
+++ b/download.lst
@@ -232,8 +232,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 := 
04e0e3f90589250c1fa97cec543af6f5e6c8c2daa377d614ec1f04b061b86651
-export PDFIUM_TARBALL := pdfium-5187.tar.bz2
+export PDFIUM_SHA256SUM := 
ecb9c2a0d777196949994946e3f24ed251ae5d3db8a9fa1e2827ef857151db13
+export PDFIUM_TARBALL := pdfium-5298.tar.bz2
 export PIXMAN_SHA256SUM := 
6d200dec3740d9ec4ec8d1180e25779c00bc749f94278c8b9021f5534db223fc
 export PIXMAN_TARBALL := pixman-0.40.0.tar.gz
 export LIBPNG_SHA256SUM := 
505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca
diff --git a/external/pdfium/Library_pdfium.mk 
b/external/pdfium/Library_pdfium.mk
index 9ae166889b2c..c00a5f8f89e3 100644
--- a/external/pdfium/Library_pdfium.mk
+++ b/external/pdfium/Library_pdfium.mk
@@ -244,7 +244,6 @@ $(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_imagecacheentry \
     UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_imageloader \
     UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_imagerenderer \
     UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_pagerendercache \
@@ -413,10 +412,8 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
     UnpackedTarball/pdfium/core/fxcrt/css/cfx_cssoutputtextbuf \
     UnpackedTarball/pdfium/core/fxcrt/cfx_datetime \
     UnpackedTarball/pdfium/core/fxcrt/bytestring \
-    UnpackedTarball/pdfium/core/fxcrt/cfx_binarybuf \
     UnpackedTarball/pdfium/core/fxcrt/cfx_bitstream \
     UnpackedTarball/pdfium/core/fxcrt/cfx_utf8decoder \
-    UnpackedTarball/pdfium/core/fxcrt/cfx_widetextbuf \
     UnpackedTarball/pdfium/core/fxcrt/fx_random \
     UnpackedTarball/pdfium/core/fxcrt/fx_string \
     UnpackedTarball/pdfium/core/fxcrt/widestring \
@@ -424,9 +421,14 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
     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 \
     UnpackedTarball/pdfium/core/fxcrt/string_data_template \
+    UnpackedTarball/pdfium/core/fxcrt/binary_buffer \
+    UnpackedTarball/pdfium/core/fxcrt/cfx_read_only_span_stream \
+    UnpackedTarball/pdfium/core/fxcrt/cfx_read_only_string_stream \
+    UnpackedTarball/pdfium/core/fxcrt/cfx_read_only_vector_stream \
+    UnpackedTarball/pdfium/core/fxcrt/fx_memory_malloc \
+    UnpackedTarball/pdfium/core/fxcrt/widetext_buffer \
 ))
 
 # fxge
@@ -527,6 +529,7 @@ ifneq ($(SYSTEM_ABSEIL),TRUE)
 # third_party/abseil-cpp
 $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
     
UnpackedTarball/pdfium/third_party/abseil-cpp/absl/types/bad_optional_access \
+    
UnpackedTarball/pdfium/third_party/abseil-cpp/absl/types/bad_variant_access \
 ))
 endif
 
diff --git a/external/pdfium/UnpackedTarball_pdfium.mk 
b/external/pdfium/UnpackedTarball_pdfium.mk
index 01bd6c74c42d..c1791ed8e823 100644
--- a/external/pdfium/UnpackedTarball_pdfium.mk
+++ b/external/pdfium/UnpackedTarball_pdfium.mk
@@ -57,7 +57,8 @@ $(eval $(call gb_UnpackedTarball_set_post_action,pdfium,\
     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 && \
-    mv third_party/abseil-cpp/absl/types/bad_optional_access.cc 
third_party/abseil-cpp/absl/types/bad_optional_access.cpp \
+    mv third_party/abseil-cpp/absl/types/bad_optional_access.cc 
third_party/abseil-cpp/absl/types/bad_optional_access.cpp && \
+    mv third_party/abseil-cpp/absl/types/bad_variant_access.cc 
third_party/abseil-cpp/absl/types/bad_variant_access.cpp \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/pdfium/abseil-trivial.patch 
b/external/pdfium/abseil-trivial.patch
index f3e929a5843a..fa91fa6bbba9 100644
--- a/external/pdfium/abseil-trivial.patch
+++ b/external/pdfium/abseil-trivial.patch
@@ -1,13 +1,17 @@
 --- third_party/abseil-cpp/absl/meta/type_traits.h
 +++ third_party/abseil-cpp/absl/meta/type_traits.h
-@@ -489,23 +489,7 @@
+@@ -501,27 +501,7 @@ struct is_trivially_move_assignable
  // operation that is not trivial. `is_trivially_copy_assignable<T>` is simply
  // `is_trivially_assignable<T&, const T&>`.
  template <typename T>
 -struct is_trivially_copy_assignable
+-#ifdef ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE
+-    : std::is_trivially_copy_assignable<T> {
+-#else
 -    : std::integral_constant<
 -          bool, __has_trivial_assign(typename std::remove_reference<T>::type) 
&&
 -                    absl::is_copy_assignable<T>::value> {
+-#endif
 -#ifdef ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE
 - private:
 -  static constexpr bool compliant =
diff --git a/external/pdfium/build.patch.1 b/external/pdfium/build.patch.1
index 7e783a07fdb1..35073e2c94d3 100644
--- a/external/pdfium/build.patch.1
+++ b/external/pdfium/build.patch.1
@@ -13,18 +13,18 @@ index 323de4ffc..f11a0b0ad 100644
    std::vector<UnsupportedFeature> unsupported;
    CheckForSharedFormInternal(doc->GetRoot(), &unsupported);
 diff --git a/third_party/base/span.h b/third_party/base/span.h
-index 0fb627ba8..f71c362e2 100644
+index ec9f9903f..1c17ad091 100644
 --- a/third_party/base/span.h
 +++ b/third_party/base/span.h
-@@ -214,7 +214,7 @@ class span {
+@@ -208,7 +208,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_) {
+   span& operator=(const span& other) noexcept {
+     if (this != &other) {
+       ReleaseEmptySpan();
 diff --git a/third_party/base/span.h b/third_party/base/span.h
 index 0fb627ba8..dda1fc8bc 100644
 --- a/third_party/base/span.h
diff --git a/external/pdfium/c++20-comparison.patch 
b/external/pdfium/c++20-comparison.patch
index 638497f6aee4..d26fe66ad8b7 100644
--- a/external/pdfium/c++20-comparison.patch
+++ b/external/pdfium/c++20-comparison.patch
@@ -10,4 +10,4 @@
 +  bool operator!=(const FxPartitionAllocAllocator& that) const { return 
false; }
  };
  
- // Used to put backing store for std::vector<> and such
+ // Used to put backing store for std::vector<> and such into the
diff --git a/external/pdfium/inc/pch/precompiled_pdfium.hxx 
b/external/pdfium/inc/pch/precompiled_pdfium.hxx
index eaa6090cf6c6..21bc61f05fb3 100644
--- a/external/pdfium/inc/pch/precompiled_pdfium.hxx
+++ b/external/pdfium/inc/pch/precompiled_pdfium.hxx
@@ -54,6 +54,7 @@
 #include <stack>
 #include <stdarg.h>
 #include <stddef.h>
+#include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 #include <string>
@@ -188,7 +189,6 @@
 #include <core/fpdfapi/render/charposlist.h>
 #include <core/fpdfapi/render/cpdf_devicebuffer.h>
 #include <core/fpdfapi/render/cpdf_docrenderdata.h>
-#include <core/fpdfapi/render/cpdf_imagecacheentry.h>
 #include <core/fpdfapi/render/cpdf_imageloader.h>
 #include <core/fpdfapi/render/cpdf_imagerenderer.h>
 #include <core/fpdfapi/render/cpdf_pagerendercache.h>
@@ -274,18 +274,18 @@
 #include <core/fxcodec/scanlinedecoder.h>
 #include <core/fxcrt/autonuller.h>
 #include <core/fxcrt/autorestorer.h>
+#include <core/fxcrt/binary_buffer.h>
 #include <core/fxcrt/bytestring.h>
-#include <core/fxcrt/cfx_binarybuf.h>
 #include <core/fxcrt/cfx_bitstream.h>
 #include <core/fxcrt/cfx_datetime.h>
-#include <core/fxcrt/cfx_fixedbufgrow.h>
 #include <core/fxcrt/cfx_memorystream.h>
-#include <core/fxcrt/cfx_readonlymemorystream.h>
+#include <core/fxcrt/cfx_read_only_span_stream.h>
+#include <core/fxcrt/cfx_read_only_string_stream.h>
+#include <core/fxcrt/cfx_read_only_vector_stream.h>
 #include <core/fxcrt/cfx_seekablestreamproxy.h>
 #include <core/fxcrt/cfx_timer.h>
 #include <core/fxcrt/cfx_utf8decoder.h>
 #include <core/fxcrt/cfx_utf8encoder.h>
-#include <core/fxcrt/cfx_widetextbuf.h>
 #include <core/fxcrt/css/cfx_css.h>
 #include <core/fxcrt/css/cfx_csscolorvalue.h>
 #include <core/fxcrt/css/cfx_csscomputedstyle.h>
@@ -307,6 +307,7 @@
 #include <core/fxcrt/css/cfx_cssvalue.h>
 #include <core/fxcrt/css/cfx_cssvaluelist.h>
 #include <core/fxcrt/css/cfx_cssvaluelistparser.h>
+#include <core/fxcrt/data_vector.h>
 #include <core/fxcrt/fileaccess_iface.h>
 #include <core/fxcrt/fx_bidi.h>
 #include <core/fxcrt/fx_codepage.h>
@@ -328,12 +329,14 @@
 #include <core/fxcrt/pauseindicator_iface.h>
 #include <core/fxcrt/retain_ptr.h>
 #include <core/fxcrt/scoped_set_insertion.h>
+#include <core/fxcrt/small_buffer.h>
 #include <core/fxcrt/span_util.h>
 #include <core/fxcrt/stl_util.h>
 #include <core/fxcrt/string_data_template.h>
 #include <core/fxcrt/string_pool_template.h>
 #include <core/fxcrt/unowned_ptr.h>
 #include <core/fxcrt/widestring.h>
+#include <core/fxcrt/widetext_buffer.h>
 #include <core/fxcrt/xml/cfx_xmlchardata.h>
 #include <core/fxcrt/xml/cfx_xmldocument.h>
 #include <core/fxcrt/xml/cfx_xmlelement.h>
commit c79a58ab122932b9c4b481c5d532d2aa35bf875a
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Thu Jun 23 13:48:24 2022 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Mon Sep 19 08:44:20 2022 +0200

    external/pdfium: Adapt bundled abseil-cpp to Clang 15 trunk change
    
    
...<https://github.com/llvm/llvm-project/commit/5ea341d7c4f9cc4933adc04ff74d59e26ad2f306>
    "[clang] Fix trivially copyable for copy constructor and copy assignment
    operator", which caused my build on Windows with clang-cl against the MSVC
    standard library to fail with
    
    > In file included from 
workdir/UnpackedTarball/pdfium/core/fxge/win32/cgdi_plus_ext.cpp:19:
    > In file included from 
workdir/UnpackedTarball/pdfium\core/fxcrt/fx_string.h:14:
    > In file included from 
workdir/UnpackedTarball/pdfium\core/fxcrt/bytestring.h:23:
    > In file included from 
workdir/UnpackedTarball/pdfium\core/fxcrt/string_view_template.h:18:
    > In file included from 
workdir/UnpackedTarball/pdfium\third_party/abseil-cpp/absl/types/optional.h:39:
    > In file included from 
workdir/UnpackedTarball/pdfium/third_party/abseil-cpp\absl/utility/utility.h:51:
    > 
workdir/UnpackedTarball/pdfium/third_party/abseil-cpp\absl/meta/type_traits.h(501,3):
 error: static_assert failed due to requirement 'compliant || 
std::is_trivially_copy_assignable<std::pair<unsigned long long, unsigned long 
long>>::value' "Not compliant with std::is_trivially_copy_assignable; Standard: 
false, Implementation: true"
    >   static_assert(compliant || std::is_trivially_copy_assignable<T>::value,
    >   ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    > 
workdir/UnpackedTarball/pdfium/third_party/abseil-cpp\absl/types/internal/optional.h(175,21):
 note: in instantiation of template class 
'absl::is_trivially_copy_assignable<std::pair<unsigned long long, unsigned long 
long>>' requested here
    >               absl::is_trivially_copy_assignable<typename std::remove_cv<
    >                     ^
    > 
workdir/UnpackedTarball/pdfium\third_party/abseil-cpp/absl/types/optional.h(119,45):
 note: in instantiation of default argument for 
'optional_data<std::pair<unsigned long long, unsigned long long>>' required here
    > class optional : private optional_internal::optional_data<T>,
    >                                             ^~~~~~~~~~~~~~~~
    > workdir/UnpackedTarball/pdfium/core/fxge/win32/cgdi_plus_ext.cpp(384,43): 
note: in instantiation of template class 'absl::optional<std::pair<unsigned 
long long, unsigned long long>>' requested here
    > absl::optional<std::pair<size_t, size_t>> IsSmallTriangle(
    >                                           ^
    
    because the behavior of Clang's built-in __has_trivial_assign no longer 
matches
    the behavior of std::is_trivially_copy_assignable for std::pair, which in 
MSVC
    happens to be implemented with a deleted copy assignment op
    
    >     pair& operator=(const volatile pair&) = delete;
    
    in
    c:/Program Files/Microsoft Visual 
Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include/utility.
    
    (See the comments starting at <https://reviews.llvm.org/D127593#3596601>
    "[clang] Fix trivially copyable for copy constructor and copy assignment
    operator" for further details.)
    
    The easiest workaround appears to be to switch the implementation of
    absl::is_trivially_copy_assignable from __has_trivial_assign to
    std::is_trivially_copy_assignable, which should always be available in our
    C++17-based toolchain baselines.
    
    (cherry picked from commit a2fad16357309f1eba4346dc826bc5ad7012b1aa)
    
    Change-Id: I5d9c3c4fd95852e57d93b56752b7e64d6d71d153
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140073
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/external/pdfium/UnpackedTarball_pdfium.mk 
b/external/pdfium/UnpackedTarball_pdfium.mk
index afffd116d0e3..01bd6c74c42d 100644
--- a/external/pdfium/UnpackedTarball_pdfium.mk
+++ b/external/pdfium/UnpackedTarball_pdfium.mk
@@ -26,6 +26,8 @@ pdfium_patches += gcc-c++20-comparison.patch
 
 pdfium_patches += include.patch
 
+pdfium_patches += abseil-trivial.patch
+
 $(eval $(call gb_UnpackedTarball_UnpackedTarball,pdfium))
 
 $(eval $(call gb_UnpackedTarball_set_tarball,pdfium,$(PDFIUM_TARBALL)))
diff --git a/external/pdfium/abseil-trivial.patch 
b/external/pdfium/abseil-trivial.patch
new file mode 100644
index 000000000000..f3e929a5843a
--- /dev/null
+++ b/external/pdfium/abseil-trivial.patch
@@ -0,0 +1,27 @@
+--- third_party/abseil-cpp/absl/meta/type_traits.h
++++ third_party/abseil-cpp/absl/meta/type_traits.h
+@@ -489,23 +489,7 @@
+ // operation that is not trivial. `is_trivially_copy_assignable<T>` is simply
+ // `is_trivially_assignable<T&, const T&>`.
+ template <typename T>
+-struct is_trivially_copy_assignable
+-    : std::integral_constant<
+-          bool, __has_trivial_assign(typename std::remove_reference<T>::type) 
&&
+-                    absl::is_copy_assignable<T>::value> {
+-#ifdef ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE
+- private:
+-  static constexpr bool compliant =
+-      std::is_trivially_copy_assignable<T>::value ==
+-      is_trivially_copy_assignable::value;
+-  static_assert(compliant || std::is_trivially_copy_assignable<T>::value,
+-                "Not compliant with std::is_trivially_copy_assignable; "
+-                "Standard: false, Implementation: true");
+-  static_assert(compliant || !std::is_trivially_copy_assignable<T>::value,
+-                "Not compliant with std::is_trivially_copy_assignable; "
+-                "Standard: true, Implementation: false");
+-#endif  // ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE
+-};
++using is_trivially_copy_assignable = std::is_trivially_copy_assignable<T>;
+ 
+ #if defined(__cpp_lib_remove_cvref) && __cpp_lib_remove_cvref >= 201711L
+ template <typename T>

Reply via email to