download.lst                                   |    4 -
 external/pdfium/Library_pdfium.mk              |    7 --
 external/pdfium/build.patch.1                  |   64 +++++++++++++++++++++++++
 external/pdfium/cg-instead-of-carbon.patch.1   |    2 
 external/pdfium/inc/pch/precompiled_pdfium.hxx |   14 ++---
 5 files changed, 74 insertions(+), 17 deletions(-)

New commits:
commit fcfd33f667a00ca95980bce4e66293455e5e253e
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Thu May 19 20:24:18 2022 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Fri Sep 16 15:36:50 2022 +0200

    external: update pdfium to 5058
    
    Which started to use require __builtin_is_constant_evaluated(), which
    our baseline doesn't have, so patch that out for now.
    
    (cherry picked from commit 6a599ff57fb878c07353d93b476706acda6058f3)
    
    Change-Id: Idd1923291a933209d18bb677d011c9353c8f8c4d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140045
    Tested-by: Miklos Vajna <vmik...@collabora.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/download.lst b/download.lst
index 9d1d86a2d335..1a07d7d76744 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 := 
563842a02657daee3a162b769fb42ae436782c839a5ac5d22d04c4e5664970e1
-export PDFIUM_TARBALL := pdfium-4933.tar.bz2
+export PDFIUM_SHA256SUM := 
eaf4ce9fad32b5d951c524139df23119b66c67720057defb97acab2dfb2582ac
+export PDFIUM_TARBALL := pdfium-5058.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 ea96eba855b1..57f67693450d 100644
--- a/external/pdfium/Library_pdfium.mk
+++ b/external/pdfium/Library_pdfium.mk
@@ -47,14 +47,11 @@ $(eval $(call 
gb_Library_set_generated_cxx_suffix,pdfium,cpp))
 # pdfium
 $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
     UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_annot \
-    UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_annothandlermgr \
     UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_annotiteration \
     UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_baannot \
-    UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_baannothandler \
     UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_formfillenvironment \
     UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_pageview \
     UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_widget \
-    UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_widgethandler \
     UnpackedTarball/pdfium/fpdfsdk/fpdf_dataavail \
     UnpackedTarball/pdfium/fpdfsdk/fpdf_ext \
     UnpackedTarball/pdfium/fpdfsdk/fpdf_flatten \
@@ -63,7 +60,6 @@ $(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/cpdfsdk_actionhandler \
     UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_annotiterator \
     UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_customaccess \
     UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_filewriteadapter \
@@ -80,7 +76,6 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
     UnpackedTarball/pdfium/fpdfsdk/fpdf_save \
     UnpackedTarball/pdfium/fpdfsdk/fpdf_text \
     UnpackedTarball/pdfium/fpdfsdk/fpdf_view \
-    UnpackedTarball/pdfium/fpdfsdk/ipdfsdk_annothandler \
     UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_pauseadapter \
     UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_interactiveform \
     UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_renderpage \
@@ -91,6 +86,7 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
        UnpackedTarball/pdfium/constants/page_object \
        UnpackedTarball/pdfium/constants/stream_dict_common \
        UnpackedTarball/pdfium/constants/transparency \
+       UnpackedTarball/pdfium/constants/font_encodings \
 ))
 
 # fdrm
@@ -269,7 +265,6 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
     UnpackedTarball/pdfium/core/fpdfapi/font/cfx_stockfontarray \
     UnpackedTarball/pdfium/core/fpdfapi/font/cpdf_cid2unicodemap \
     UnpackedTarball/pdfium/core/fpdfapi/font/cpdf_cmap \
-    UnpackedTarball/pdfium/core/fpdfapi/font/cpdf_cmapmanager \
     UnpackedTarball/pdfium/core/fpdfapi/font/cpdf_cmapparser \
     UnpackedTarball/pdfium/core/fpdfapi/font/cpdf_fontglobals \
     UnpackedTarball/pdfium/core/fpdfapi/font/cpdf_tounicodemap \
diff --git a/external/pdfium/build.patch.1 b/external/pdfium/build.patch.1
index 49bdd10692fc..46ea17fbc9bd 100644
--- a/external/pdfium/build.patch.1
+++ b/external/pdfium/build.patch.1
@@ -81,3 +81,67 @@ index 8b3a72700..ea1db23f4 100644
  }
  
  FX_RECT FXRectFromFTPos(FT_Pos left, FT_Pos top, FT_Pos right, FT_Pos bottom) 
{
+diff --git a/third_party/base/numerics/safe_conversions_impl.h 
b/third_party/base/numerics/safe_conversions_impl.h
+index 4d8a7b7d9..d14c6dc06 100644
+--- a/third_party/base/numerics/safe_conversions_impl.h
++++ b/third_party/base/numerics/safe_conversions_impl.h
+@@ -88,7 +88,7 @@ constexpr typename std::make_unsigned<T>::type 
SafeUnsignedAbs(T value) {
+ 
+ // TODO(jschuh): Switch to std::is_constant_evaluated() once C++20 is 
supported.
+ // Alternately, the usage could be restructured for "consteval if" in C++23.
+-#define IsConstantEvaluated() (__builtin_is_constant_evaluated())
++#define IsConstantEvaluated() (false)
+ 
+ // TODO(jschuh): Debug builds don't reliably propagate constants, so we 
restrict
+ // some accelerated runtime paths to release builds until this can be forced
+--- pdfium/core/fpdfapi/font/cpdf_cidfont.cpp.orig     2022-05-20 
09:25:52.066728467 +0000
++++ pdfium/core/fpdfapi/font/cpdf_cidfont.cpp  2022-05-20 09:25:56.146736531 
+0000
+@@ -738,7 +738,7 @@
+         uint32_t maccode = CharCodeFromUnicodeForFreetypeEncoding(
+             FT_ENCODING_APPLE_ROMAN, name_unicode);
+         index = maccode ? FT_Get_Char_Index(face, maccode)
+-                        : FT_Get_Name_Index(face, name);
++                        : FT_Get_Name_Index(face, const_cast<char*>(name));
+       }
+       if (index == 0 || index == 0xffff)
+         return charcode ? static_cast<int>(charcode) : -1;
+--- pdfium/core/fpdfapi/font/cpdf_type1font.cpp.orig   2022-05-20 
09:26:59.090862058 +0000
++++ pdfium/core/fpdfapi/font/cpdf_type1font.cpp        2022-05-20 
09:27:33.810932435 +0000
+@@ -260,7 +260,7 @@
+                                           static_cast<uint32_t>(charcode));
+       if (name) {
+         m_Encoding.SetUnicode(charcode, UnicodeFromAdobeName(name));
+-        m_GlyphIndex[charcode] = FT_Get_Name_Index(m_Font.GetFaceRec(), name);
++        m_GlyphIndex[charcode] = FT_Get_Name_Index(m_Font.GetFaceRec(), 
const_cast<char*>(name));
+       } else {
+         m_GlyphIndex[charcode] = FT_Get_Char_Index(
+             m_Font.GetFaceRec(), static_cast<uint32_t>(charcode));
+@@ -291,7 +291,7 @@
+       continue;
+ 
+     m_Encoding.SetUnicode(charcode, UnicodeFromAdobeName(name));
+-    m_GlyphIndex[charcode] = FT_Get_Name_Index(m_Font.GetFaceRec(), name);
++    m_GlyphIndex[charcode] = FT_Get_Name_Index(m_Font.GetFaceRec(), 
const_cast<char*>(name));
+     if (m_GlyphIndex[charcode] != 0)
+       continue;
+ 
+--- pdfium/core/fpdfapi/font/cpdf_truetypefont.cpp.orig        2022-05-20 
09:26:12.066767996 +0000
++++ pdfium/core/fpdfapi/font/cpdf_truetypefont.cpp     2022-05-20 
09:26:46.690836923 +0000
+@@ -90,7 +90,7 @@
+               FT_ENCODING_APPLE_ROMAN,
+               m_Encoding.UnicodeFromCharCode(charcode));
+           if (!maccode) {
+-            m_GlyphIndex[charcode] = FT_Get_Name_Index(face, name);
++            m_GlyphIndex[charcode] = FT_Get_Name_Index(face, 
const_cast<char*>(name));
+           } else {
+             m_GlyphIndex[charcode] = FT_Get_Char_Index(face, maccode);
+           }
+@@ -104,7 +104,7 @@
+         m_GlyphIndex[charcode] = FT_Get_Char_Index(face, 32);
+         continue;
+       }
+-      m_GlyphIndex[charcode] = FT_Get_Name_Index(face, name);
++      m_GlyphIndex[charcode] = FT_Get_Name_Index(face, 
const_cast<char*>(name));
+       if (m_GlyphIndex[charcode] != 0 || !bToUnicode)
+         continue;
+ 
diff --git a/external/pdfium/cg-instead-of-carbon.patch.1 
b/external/pdfium/cg-instead-of-carbon.patch.1
index 770f9ad1f647..055eac735307 100644
--- a/external/pdfium/cg-instead-of-carbon.patch.1
+++ b/external/pdfium/cg-instead-of-carbon.patch.1
@@ -13,7 +13,7 @@
 --- a/core/fpdfapi/font/cpdf_type1font.cpp
 +++ b/core/fpdfapi/font/cpdf_type1font.cpp
 @@ -19,7 +19,7 @@
- #include "core/fxge/fx_freetype.h"
+ #include "core/fxge/fx_font.h"
  
  #if BUILDFLAG(IS_APPLE)
 -#include <Carbon/Carbon.h>
diff --git a/external/pdfium/inc/pch/precompiled_pdfium.hxx 
b/external/pdfium/inc/pch/precompiled_pdfium.hxx
index 06fece1e55ad..eaa6090cf6c6 100644
--- a/external/pdfium/inc/pch/precompiled_pdfium.hxx
+++ b/external/pdfium/inc/pch/precompiled_pdfium.hxx
@@ -45,6 +45,7 @@
 #include <map>
 #include <math.h>
 #include <memory>
+#include <new>
 #include <numeric>
 #include <ostream>
 #include <set>
@@ -72,6 +73,7 @@
 #include <constants/annotation_flags.h>
 #include <constants/appearance.h>
 #include <constants/ascii.h>
+#include <constants/font_encodings.h>
 #include <constants/form_fields.h>
 #include <constants/form_flags.h>
 #include <constants/page_object.h>
@@ -93,7 +95,6 @@
 #include <core/fpdfapi/font/cpdf_cid2unicodemap.h>
 #include <core/fpdfapi/font/cpdf_cidfont.h>
 #include <core/fpdfapi/font/cpdf_cmap.h>
-#include <core/fpdfapi/font/cpdf_cmapmanager.h>
 #include <core/fpdfapi/font/cpdf_cmapparser.h>
 #include <core/fpdfapi/font/cpdf_font.h>
 #include <core/fpdfapi/font/cpdf_fontencoding.h>
@@ -126,6 +127,7 @@
 #include <core/fpdfapi/page/cpdf_iccprofile.h>
 #include <core/fpdfapi/page/cpdf_image.h>
 #include <core/fpdfapi/page/cpdf_imageobject.h>
+#include <core/fpdfapi/page/cpdf_indexedcs.h>
 #include <core/fpdfapi/page/cpdf_meshstream.h>
 #include <core/fpdfapi/page/cpdf_occontext.h>
 #include <core/fpdfapi/page/cpdf_page.h>
@@ -318,6 +320,7 @@
 #include <core/fxcrt/fx_safe_types.h>
 #include <core/fxcrt/fx_stream.h>
 #include <core/fxcrt/fx_string.h>
+#include <core/fxcrt/fx_string_wrappers.h>
 #include <core/fxcrt/fx_system.h>
 #include <core/fxcrt/fx_unicode.h>
 #include <core/fxcrt/maybe_owned.h>
@@ -339,6 +342,7 @@
 #include <core/fxcrt/xml/cfx_xmlparser.h>
 #include <core/fxcrt/xml/cfx_xmltext.h>
 #include <core/fxge/agg/fx_agg_driver.h>
+#include <core/fxge/calculate_pitch.h>
 #include <core/fxge/cfx_cliprgn.h>
 #include <core/fxge/cfx_color.h>
 #include <core/fxge/cfx_defaultrenderdevice.h>
@@ -374,21 +378,18 @@
 #include <core/fxge/dib/fx_dib.h>
 #include <core/fxge/dib/scanlinecomposer_iface.h>
 #include <core/fxge/fontdata/chromefontdata/chromefontdata.h>
+#include <core/fxge/freetype/fx_freetype.h>
 #include <core/fxge/fx_font.h>
-#include <core/fxge/fx_freetype.h>
 #include <core/fxge/renderdevicedriver_iface.h>
 #include <core/fxge/scoped_font_transform.h>
 #include <core/fxge/systemfontinfo_iface.h>
 #include <core/fxge/text_char_pos.h>
 #include <core/fxge/text_glyph_pos.h>
-#include <fpdfsdk/cpdfsdk_actionhandler.h>
 #include <fpdfsdk/cpdfsdk_annot.h>
-#include <fpdfsdk/cpdfsdk_annothandlermgr.h>
 #include <fpdfsdk/cpdfsdk_annotiteration.h>
 #include <fpdfsdk/cpdfsdk_annotiterator.h>
 #include <fpdfsdk/cpdfsdk_appstream.h>
 #include <fpdfsdk/cpdfsdk_baannot.h>
-#include <fpdfsdk/cpdfsdk_baannothandler.h>
 #include <fpdfsdk/cpdfsdk_customaccess.h>
 #include <fpdfsdk/cpdfsdk_filewriteadapter.h>
 #include <fpdfsdk/cpdfsdk_formfillenvironment.h>
@@ -398,7 +399,6 @@
 #include <fpdfsdk/cpdfsdk_pauseadapter.h>
 #include <fpdfsdk/cpdfsdk_renderpage.h>
 #include <fpdfsdk/cpdfsdk_widget.h>
-#include <fpdfsdk/cpdfsdk_widgethandler.h>
 #include <fpdfsdk/formfiller/cffl_button.h>
 #include <fpdfsdk/formfiller/cffl_checkbox.h>
 #include <fpdfsdk/formfiller/cffl_combobox.h>
@@ -411,7 +411,6 @@
 #include <fpdfsdk/formfiller/cffl_radiobutton.h>
 #include <fpdfsdk/formfiller/cffl_textfield.h>
 #include <fpdfsdk/formfiller/cffl_textobject.h>
-#include <fpdfsdk/ipdfsdk_annothandler.h>
 #include <fpdfsdk/pwl/cpwl_button.h>
 #include <fpdfsdk/pwl/cpwl_caret.h>
 #include <fpdfsdk/pwl/cpwl_cbbutton.h>
@@ -426,7 +425,6 @@
 #include <fpdfsdk/pwl/cpwl_special_button.h>
 #include <fpdfsdk/pwl/cpwl_wnd.h>
 #include <fpdfsdk/pwl/ipwl_fillernotify.h>
-#include <fpdfsdk/pwl/ipwl_systemhandler.h>
 #include <fxjs/cjs_event_context_stub.h>
 #include <fxjs/cjs_runtimestub.h>
 #include <fxjs/ijs_event_context.h>

Reply via email to