cppu/qa/cppumaker/test_cppumaker.cxx                         |    1 
 cppu/qa/test_any.cxx                                         |    1 
 dev/null                                                     |binary
 download.lst                                                 |    4 
 external/liborcus/inc/pch/precompiled_orcus.hxx              |  109 -----
 external/pdfium/Library_pdfium.mk                            |  153 +++-----
 external/pdfium/UnpackedTarball_pdfium.mk                    |   15 
 external/pdfium/build.patch.1                                |  119 +++++-
 external/pdfium/c++20-comparison.patch                       |   13 
 external/pdfium/configs/build_config.h                       |    6 
 external/pdfium/msvc2015.patch.1                             |  202 -----------
 external/pdfium/ubsan.patch                                  |   26 -
 external/pdfium/visibility.patch.1                           |   30 +
 external/pdfium/windows7.patch.1                             |   34 -
 i18npool/qa/cppunit/test_breakiterator.cxx                   |    1 
 include/vcl/filter/PDFiumLibrary.hxx                         |    2 
 sal/qa/rtl/oustring/rtl_OUString2.cxx                        |    2 
 sal/qa/rtl/oustringbuffer/test_oustringbuffer_appendchar.cxx |    3 
 sal/qa/rtl/strings/test_oustring_stringliterals.cxx          |    1 
 sal/qa/rtl/textenc/rtl_textcvt.cxx                           |    1 
 solenv/flatpak-manifest.in                                   |    6 
 starmath/qa/cppunit/test_node.cxx                            |    1 
 starmath/qa/extras/mmlexport-test.cxx                        |    2 
 svl/qa/unit/test_lngmisc.cxx                                 |    3 
 svx/source/svdraw/svdpdf.cxx                                 |   31 -
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx                     |    1 
 sw/qa/extras/ooxmlexport/ooxmlexport5.cxx                    |    1 
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx                     |    1 
 sw/qa/extras/rtfimport/rtfimport.cxx                         |    2 
 sw/qa/extras/uiwriter/uiwriter.cxx                           |    1 
 vcl/qa/cppunit/mnemonic.cxx                                  |    3 
 xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx                |   16 
 xmlsecurity/source/pdfio/pdfdocument.cxx                     |   63 ---
 33 files changed, 241 insertions(+), 613 deletions(-)

New commits:
commit 6209be73adec00901f839c9fa2c97076c7d0ad9f
Author:     Gabor Kelemen <kelemen.gab...@nisz.hu>
AuthorDate: Thu Nov 4 12:31:02 2021 +0100
Commit:     Gabor Kelemen <kelemen.gab...@nisz.hu>
CommitDate: Thu Nov 4 12:31:02 2021 +0100

    Revert "xmlsecurity: reject a few dangerous annotation types during pdf sig 
verify"
    
    This reverts commit 4ebc328779539d9bc0cb0d7759c27e1e155c129e.
    
    Older pdfium does not have FPDF_ANNOT_REDACT yet

diff --git a/external/liborcus/inc/pch/precompiled_orcus.hxx 
b/external/liborcus/inc/pch/precompiled_orcus.hxx
deleted file mode 100644
index 28e1bc8119d8..000000000000
--- a/external/liborcus/inc/pch/precompiled_orcus.hxx
+++ /dev/null
@@ -1,109 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/*
- This file has been autogenerated by update_pch.sh. It is possible to edit it
- manually (such as when an include file has been moved/renamed/removed). All 
such
- manual changes will be rewritten by the next run of update_pch.sh (which 
presumably
- also fixes all possible problems, so it's usually better to use it).
-
- Generated on 2020-02-01 12:22:35 using:
- ./bin/update_pch external/liborcus orcus --cutoff=1 --exclude:system 
--include:module --include:local
-
- If after updating build fails, use the following command to locate 
conflicting headers:
- ./bin/update_pch_bisect ./external/liborcus/inc/pch/precompiled_orcus.hxx 
"make external/liborcus.build" --find-conflicts
-*/
-
-#if PCH_LEVEL >= 1
-#include <algorithm>
-#include <cassert>
-#include <codecvt>
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
-#include <deque>
-#include <fstream>
-#include <functional>
-#include <iostream>
-#include <iterator>
-#include <limits>
-#include <locale>
-#include <map>
-#include <memory>
-#include <ostream>
-#include <sstream>
-#include <string>
-#include <unordered_map>
-#include <unordered_set>
-#include <vector>
-#include <boost/current_function.hpp>
-#include <boost/filesystem.hpp>
-#include <boost/iostreams/filter/gzip.hpp>
-#include <boost/iostreams/filtering_stream.hpp>
-#include <boost/optional.hpp>
-#include <boost/pool/object_pool.hpp>
-#endif // PCH_LEVEL >= 1
-#if PCH_LEVEL >= 2
-#endif // PCH_LEVEL >= 2
-#if PCH_LEVEL >= 3
-#include <mdds/global.hpp>
-#include <mdds/sorted_string_map.hpp>
-#include <orcus/config.hpp>
-#include <orcus/css_document_tree.hpp>
-#include <orcus/css_parser.hpp>
-#include <orcus/css_selector.hpp>
-#include <orcus/csv_parser.hpp>
-#include <orcus/dom_tree.hpp>
-#include <orcus/exception.hpp>
-#include <orcus/format_detection.hpp>
-#include <orcus/global.hpp>
-#include <orcus/info.hpp>
-#include <orcus/interface.hpp>
-#include <orcus/json_document_tree.hpp>
-#include <orcus/json_global.hpp>
-#include <orcus/json_parser.hpp>
-#include <orcus/json_structure_tree.hpp>
-#include <orcus/measurement.hpp>
-#include <orcus/orcus_csv.hpp>
-#include <orcus/orcus_gnumeric.hpp>
-#include <orcus/orcus_import_ods.hpp>
-#include <orcus/orcus_import_xlsx.hpp>
-#include <orcus/orcus_json.hpp>
-#include <orcus/orcus_ods.hpp>
-#include <orcus/orcus_xls_xml.hpp>
-#include <orcus/orcus_xlsx.hpp>
-#include <orcus/orcus_xml.hpp>
-#include <orcus/parser_base.hpp>
-#include <orcus/parser_global.hpp>
-#include <orcus/pstring.hpp>
-#include <orcus/sax_ns_parser.hpp>
-#include <orcus/sax_parser.hpp>
-#include <orcus/sax_parser_base.hpp>
-#include <orcus/sax_token_parser.hpp>
-#include <orcus/spreadsheet/export_interface.hpp>
-#include <orcus/spreadsheet/import_interface.hpp>
-#include <orcus/spreadsheet/import_interface_pivot.hpp>
-#include <orcus/spreadsheet/import_interface_view.hpp>
-#include <orcus/spreadsheet/styles.hpp>
-#include <orcus/spreadsheet/types.hpp>
-#include <orcus/stream.hpp>
-#include <orcus/string_pool.hpp>
-#include <orcus/threaded_sax_token_parser.hpp>
-#include <orcus/tokens.hpp>
-#include <orcus/xml_namespace.hpp>
-#include <orcus/xml_structure_tree.hpp>
-#include <orcus/yaml_document_tree.hpp>
-#include <orcus/yaml_parser.hpp>
-#include <orcus/zip_archive.hpp>
-#include <orcus/zip_archive_stream.hpp>
-#endif // PCH_LEVEL >= 3
-#if PCH_LEVEL >= 4
-#endif // PCH_LEVEL >= 4
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/filter/PDFiumLibrary.hxx 
b/include/vcl/filter/PDFiumLibrary.hxx
index 027e4939fab1..783b9a6da8b4 100644
--- a/include/vcl/filter/PDFiumLibrary.hxx
+++ b/include/vcl/filter/PDFiumLibrary.hxx
@@ -59,8 +59,6 @@ public:
             FPDF_ClosePage(mpPage);
     }
 
-    FPDF_PAGE getPointer() { return mpPage; }
-
     /// Get bitmap checksum of the page, without annotations/commenting.
     BitmapChecksum getChecksum(int nMDPPerm);
 };
diff --git a/xmlsecurity/qa/unit/pdfsigning/data/bad-cert-p3-stamp.pdf 
b/xmlsecurity/qa/unit/pdfsigning/data/bad-cert-p3-stamp.pdf
deleted file mode 100644
index b30f5b03867c..000000000000
Binary files a/xmlsecurity/qa/unit/pdfsigning/data/bad-cert-p3-stamp.pdf and 
/dev/null differ
diff --git a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx 
b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
index 55e548112f9d..894aca99a26a 100644
--- a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
+++ b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
@@ -458,22 +458,6 @@ void PDFSigningTest::testBadCertP1()
                          rInformation.nStatus);
 }
 
-CPPUNIT_TEST_FIXTURE(PDFSigningTest, testBadCertP3Stamp)
-{
-    std::vector<SignatureInformation> aInfos
-        = verify(m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"bad-cert-p3-stamp.pdf", 1,
-                 /*rExpectedSubFilter=*/OString());
-    CPPUNIT_ASSERT(!aInfos.empty());
-    SignatureInformation& rInformation = aInfos[0];
-
-    // Without the accompanying fix in place, this test would have failed with:
-    // - Expected: 0 (SecurityOperationStatus_UNKNOWN)
-    // - Actual  : 1 (SecurityOperationStatus_OPERATION_SUCCEEDED)
-    // i.e. adding a stamp annotation was not considered as a bad modification.
-    
CPPUNIT_ASSERT_EQUAL(xml::crypto::SecurityOperationStatus::SecurityOperationStatus_UNKNOWN,
-                         rInformation.nStatus);
-}
-
 /// Test writing a PAdES signature.
 void PDFSigningTest::testSigningCertificateAttribute()
 {
diff --git a/xmlsecurity/source/pdfio/pdfdocument.cxx 
b/xmlsecurity/source/pdfio/pdfdocument.cxx
index 51eac91495a7..9d056de0a15c 100644
--- a/xmlsecurity/source/pdfio/pdfdocument.cxx
+++ b/xmlsecurity/source/pdfio/pdfdocument.cxx
@@ -24,11 +24,6 @@
 #include <svl/cryptosign.hxx>
 #include <vcl/filter/pdfdocument.hxx>
 #include <vcl/bitmap.hxx>
-#include <basegfx/range/b2drectangle.hxx>
-
-#if HAVE_FEATURE_PDFIUM
-#include <fpdf_annot.h>
-#endif
 
 using namespace com::sun::star;
 
@@ -143,29 +138,8 @@ bool IsCompleteSignature(SvStream& rStream, 
vcl::filter::PDFDocument& rDocument,
     return std::find(rAllEOFs.begin(), rAllEOFs.end(), nFileEnd) != 
rAllEOFs.end();
 }
 
-/**
- * Contains checksums of a PDF page, which is rendered without annotations. It 
also contains
- * the geometry of a few dangerous annotation types.
- */
-struct PageChecksum
-{
-    BitmapChecksum m_nPageContent;
-    std::vector<basegfx::B2DRectangle> m_aAnnotations;
-    bool operator==(const PageChecksum& rChecksum) const;
-};
-
-bool PageChecksum::operator==(const PageChecksum& rChecksum) const
-{
-    if (m_nPageContent != rChecksum.m_nPageContent)
-    {
-        return false;
-    }
-
-    return m_aAnnotations == rChecksum.m_aAnnotations;
-}
-
 /// Collects the checksum of each page of one version of the PDF.
-void AnalyizeSignatureStream(SvMemoryStream& rStream, 
std::vector<PageChecksum>& rPageChecksums,
+void AnalyizeSignatureStream(SvMemoryStream& rStream, 
std::vector<BitmapChecksum>& rPageChecksums,
                              int nMDPPerm)
 {
 #if HAVE_FEATURE_PDFIUM
@@ -182,35 +156,8 @@ void AnalyizeSignatureStream(SvMemoryStream& rStream, 
std::vector<PageChecksum>&
             return;
         }
 
-        PageChecksum aPageChecksum;
-        aPageChecksum.m_nPageContent = pPdfPage->getChecksum(nMDPPerm);
-        for (int i = 0; i < FPDFPage_GetAnnotCount(pPdfPage->getPointer()); 
++i)
-        {
-            FPDF_ANNOTATION pAnnotation = 
FPDFPage_GetAnnot(pPdfPage->getPointer(), i);
-            int nType = FPDFAnnot_GetSubtype(pAnnotation);
-            switch (nType)
-            {
-                case FPDF_ANNOT_UNKNOWN:
-                case FPDF_ANNOT_FREETEXT:
-                case FPDF_ANNOT_STAMP:
-                case FPDF_ANNOT_REDACT:
-                {
-                    basegfx::B2DRectangle aB2DRectangle;
-                    FS_RECTF aRect;
-                    if (FPDFAnnot_GetRect(pAnnotation, &aRect))
-                    {
-                        aB2DRectangle = basegfx::B2DRectangle(aRect.left, 
aRect.top, aRect.right,
-                                                              aRect.bottom);
-                    }
-                    aPageChecksum.m_aAnnotations.push_back(aB2DRectangle);
-                    break;
-                }
-                default:
-                    break;
-            }
-            FPDFPage_CloseAnnot(pAnnotation);
-        }
-        rPageChecksums.push_back(aPageChecksum);
+        BitmapChecksum nPageChecksum = pPdfPage->getChecksum(nMDPPerm);
+        rPageChecksums.push_back(nPageChecksum);
     }
 #else
     (void)rStream;
@@ -235,7 +182,7 @@ bool IsValidSignature(SvStream& rStream, 
vcl::filter::PDFObjectElement* pSignatu
     aSignatureStream.WriteStream(rStream, nSignatureEOF);
     rStream.Seek(nPos);
     aSignatureStream.Seek(0);
-    std::vector<PageChecksum> aSignedPages;
+    std::vector<BitmapChecksum> aSignedPages;
     AnalyizeSignatureStream(aSignatureStream, aSignedPages, nMDPPerm);
 
     SvMemoryStream aFullStream;
@@ -244,7 +191,7 @@ bool IsValidSignature(SvStream& rStream, 
vcl::filter::PDFObjectElement* pSignatu
     aFullStream.WriteStream(rStream);
     rStream.Seek(nPos);
     aFullStream.Seek(0);
-    std::vector<PageChecksum> aAllPages;
+    std::vector<BitmapChecksum> aAllPages;
     AnalyizeSignatureStream(aFullStream, aAllPages, nMDPPerm);
 
     // Fail if any page looks different after signing and at the end. 
Annotations/commenting doesn't
commit 47b359654460f3fbe9b0a1251ff132254e02b89d
Author:     Gabor Kelemen <kelemen.gab...@nisz.hu>
AuthorDate: Thu Nov 4 11:58:41 2021 +0100
Commit:     Gabor Kelemen <kelemen.gab...@nisz.hu>
CommitDate: Thu Nov 4 11:58:41 2021 +0100

    Revert "external: update pdfium to handle redact annotations"
    
    This reverts commit 8a1ee2fa05aaf72f998eaedfda4efe060d75be36.
    
    Causes build issues with older gcc

diff --git a/download.lst b/download.lst
index 55ab48d83730..9c02c062885f 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 := 
eca406d47ac7e2a84dcc86f93c08f96e591d409589e881477fa75e488e4851d8
-export PDFIUM_TARBALL := pdfium-4306.tar.bz2
+export PDFIUM_SHA256SUM := 
572460f7f9e2f86d022a9c6a82f1e2ded6c3c29ba352d4b9fac60b87e2159679
+export PDFIUM_TARBALL := pdfium-3550.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 3b37143c4599..f9a62bf75b46 100644
--- a/external/pdfium/Library_pdfium.mk
+++ b/external/pdfium/Library_pdfium.mk
@@ -20,15 +20,13 @@ $(eval $(call gb_Library_set_include,pdfium,\
 ))
 
 $(eval $(call gb_Library_add_defs,pdfium,\
-    -DFPDF_IMPLEMENTATION \
+    -DPDFIUM_DLLIMPLEMENTATION \
     -DUSE_SYSTEM_LCMS2 \
     -DUSE_SYSTEM_LIBJPEG \
     -DUSE_SYSTEM_ZLIB \
     -DUSE_SYSTEM_ICUUC \
     -DMEMORY_TOOL_REPLACES_ALLOCATOR \
     -DUNICODE \
-    -DWIN32_LEAN_AND_MEAN \
-    -DCOMPONENT_BUILD \
 ))
 
 # Don't show warnings upstream doesn't care about.
@@ -43,12 +41,15 @@ $(eval $(call 
gb_Library_set_generated_cxx_suffix,pdfium,cpp))
 
 # pdfium
 $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
+    UnpackedTarball/pdfium/fpdfsdk/cfx_systemhandler \
     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_datetime \
     UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_formfillenvironment \
+    UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_interform \
     UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_pageview \
     UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_widget \
     UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_widgethandler \
@@ -78,21 +79,20 @@ $(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/cpdfsdk_pauseadapter \
-    UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_interactiveform \
-    UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_renderpage \
-    UnpackedTarball/pdfium/fpdfsdk/fpdf_signature \
+    UnpackedTarball/pdfium/fpdfsdk/ipdfsdk_pauseadapter \
+    UnpackedTarball/pdfium/fpdfsdk/cpdf_annotcontext \
 ))
 
 # fdrm
 $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
-    UnpackedTarball/pdfium/core/fdrm/fx_crypt \
-    UnpackedTarball/pdfium/core/fdrm/fx_crypt_aes \
-    UnpackedTarball/pdfium/core/fdrm/fx_crypt_sha \
+    UnpackedTarball/pdfium/core/fdrm/crypto/fx_crypt \
+    UnpackedTarball/pdfium/core/fdrm/crypto/fx_crypt_aes \
+    UnpackedTarball/pdfium/core/fdrm/crypto/fx_crypt_sha \
 ))
 
 # 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 \
@@ -103,7 +103,6 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
     UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_textfield \
     UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_button \
     UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_textobject \
-    UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_privatedata \
 ))
 
 # fpdfapi
@@ -170,6 +169,8 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
     UnpackedTarball/pdfium/core/fpdfapi/cmaps/Korea1/UniKS-UTF16-H_0 \
     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/edit/cpdf_pagecontentgenerator \
     UnpackedTarball/pdfium/core/fpdfapi/font/cpdf_cidfont \
     UnpackedTarball/pdfium/core/fpdfapi/font/cpdf_font \
@@ -184,7 +185,7 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
     UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_color \
     UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_colorspace \
     UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_colorstate \
-    UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_contentmarks \
+    UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_contentmark \
     UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_contentmarkitem \
     UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_contentparser \
     UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_docpagedata \
@@ -199,6 +200,7 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
     UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_pagemodule \
     UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_pageobject \
     UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_pageobjectholder \
+    UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_pageobjectlist \
     UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_path \
     UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_pathobject \
     UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_pattern \
@@ -235,8 +237,9 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
     UnpackedTarball/pdfium/core/fpdfapi/parser/fpdf_parser_utility \
     UnpackedTarball/pdfium/core/fpdfapi/parser/cpdf_object_walker \
     UnpackedTarball/pdfium/core/fpdfapi/parser/cpdf_read_validator \
-    UnpackedTarball/pdfium/core/fpdfapi/render/charposlist \
+    UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_charposlist \
     UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_devicebuffer \
+    UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_dibtransferfunc \
     UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_docrenderdata \
     UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_imagecacheentry \
     UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_imageloader \
@@ -248,13 +251,12 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
     UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_renderstatus \
     UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_scaledrenderbuffer \
     UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_textrenderer \
+    UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_transferfunc \
     UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_type3cache \
-    UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_type3glyphmap \
-    UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_rendershading \
-    UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_rendertiling \
+    UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_type3glyphs \
     UnpackedTarball/pdfium/core/fpdfapi/edit/cpdf_creator \
-    UnpackedTarball/pdfium/core/fpdfapi/parser/cpdf_encryptor \
-    UnpackedTarball/pdfium/core/fpdfapi/parser/cpdf_flateencoder \
+    UnpackedTarball/pdfium/core/fpdfapi/edit/cpdf_encryptor \
+    UnpackedTarball/pdfium/core/fpdfapi/edit/cpdf_flateencoder \
     UnpackedTarball/pdfium/core/fpdfapi/font/cfx_cttgsubtable \
     UnpackedTarball/pdfium/core/fpdfapi/font/cfx_stockfontarray \
     UnpackedTarball/pdfium/core/fpdfapi/font/cpdf_cid2unicodemap \
@@ -276,17 +278,11 @@ $(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/page/cpdf_transparency \
-    UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_dib \
+    UnpackedTarball/pdfium/core/fpdfapi/render/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 \
-    UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_annotcontext \
-    UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_pagerendercontext \
-    UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_transferfuncdib \
-    UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_transferfunc \
 ))
 
 # fpdfdoc
@@ -294,6 +290,7 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
     UnpackedTarball/pdfium/core/fpdfdoc/cline \
     UnpackedTarball/pdfium/core/fpdfdoc/cpdf_aaction \
     UnpackedTarball/pdfium/core/fpdfdoc/cpdf_action \
+    UnpackedTarball/pdfium/core/fpdfdoc/cpdf_actionfields \
     UnpackedTarball/pdfium/core/fpdfdoc/cpdf_annot \
     UnpackedTarball/pdfium/core/fpdfdoc/cpdf_annotlist \
     UnpackedTarball/pdfium/core/fpdfdoc/cpdf_apsettings \
@@ -301,16 +298,18 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
     UnpackedTarball/pdfium/core/fpdfdoc/cpdf_bookmarktree \
     UnpackedTarball/pdfium/core/fpdfdoc/cpdf_defaultappearance \
     UnpackedTarball/pdfium/core/fpdfdoc/cpdf_dest \
+    UnpackedTarball/pdfium/core/fpdfdoc/cpdf_docjsactions \
     UnpackedTarball/pdfium/core/fpdfdoc/cpdf_filespec \
     UnpackedTarball/pdfium/core/fpdfdoc/cpdf_formcontrol \
     UnpackedTarball/pdfium/core/fpdfdoc/cpdf_formfield \
     UnpackedTarball/pdfium/core/fpdfdoc/cpdf_iconfit \
-    UnpackedTarball/pdfium/core/fpdfdoc/cpdf_interactiveform \
+    UnpackedTarball/pdfium/core/fpdfdoc/cpdf_interform \
     UnpackedTarball/pdfium/core/fpdfdoc/cpdf_link \
     UnpackedTarball/pdfium/core/fpdfdoc/cpdf_linklist \
     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 \
@@ -321,9 +320,6 @@ $(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 \
-    UnpackedTarball/pdfium/core/fpdfdoc/cpdf_icon \
 ))
 
 # fpdftext
@@ -336,7 +332,7 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
 
 # fxcodec
 $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
-    UnpackedTarball/pdfium/core/fxcodec/fx_codec \
+    UnpackedTarball/pdfium/core/fxcodec/codec/fx_codec \
     UnpackedTarball/pdfium/core/fxcodec/jbig2/JBig2_ArithDecoder \
     UnpackedTarball/pdfium/core/fxcodec/jbig2/JBig2_ArithIntDecoder \
     UnpackedTarball/pdfium/core/fxcodec/jbig2/JBig2_BitStream \
@@ -353,20 +349,18 @@ $(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/cfx_codec_memory \
-    UnpackedTarball/pdfium/core/fxcodec/fax/faxmodule \
-    UnpackedTarball/pdfium/core/fxcodec/scanlinedecoder \
-    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/flate/flatemodule \
-    UnpackedTarball/pdfium/core/fxcodec/icc/iccmodule \
-    UnpackedTarball/pdfium/core/fxcodec/jbig2/jbig2_decoder \
-    UnpackedTarball/pdfium/core/fxcodec/jpeg/jpeg_common \
+    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 \
 ))
 
 # fxcrt
@@ -379,6 +373,7 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
     UnpackedTarball/pdfium/core/fxcrt/fx_memory \
     UnpackedTarball/pdfium/core/fxcrt/fx_stream \
     UnpackedTarball/pdfium/core/fxcrt/fx_system \
+    UnpackedTarball/pdfium/core/fxcrt/fx_ucddata \
     UnpackedTarball/pdfium/core/fxcrt/fx_unicode \
     UnpackedTarball/pdfium/core/fxcrt/xml/cfx_xmldocument \
     UnpackedTarball/pdfium/core/fxcrt/xml/cfx_xmlelement \
@@ -415,13 +410,11 @@ $(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 \
-    UnpackedTarball/pdfium/core/fxcrt/string_data_template \
 ))
 
 # fxge
@@ -430,13 +423,13 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
     UnpackedTarball/pdfium/core/fxge/dib/cfx_bitmapstorer \
     UnpackedTarball/pdfium/core/fxge/dib/cfx_dibextractor \
     UnpackedTarball/pdfium/core/fxge/dib/cfx_dibitmap \
-    UnpackedTarball/pdfium/core/fxge/cfx_drawutils \
+    UnpackedTarball/pdfium/core/fxge/dib/cfx_filtereddib \
     UnpackedTarball/pdfium/core/fxge/dib/cfx_imagerenderer \
     UnpackedTarball/pdfium/core/fxge/dib/cfx_imagestretcher \
     UnpackedTarball/pdfium/core/fxge/dib/cfx_imagetransformer \
     UnpackedTarball/pdfium/core/fxge/dib/cfx_scanlinecompositor \
     UnpackedTarball/pdfium/core/fxge/dib/cstretchengine \
-    UnpackedTarball/pdfium/core/fxge/dib/fx_dib \
+    UnpackedTarball/pdfium/core/fxge/dib/fx_dib_main \
     UnpackedTarball/pdfium/core/fxge/fontdata/chromefontdata/FoxitDingbats \
     UnpackedTarball/pdfium/core/fxge/fontdata/chromefontdata/FoxitFixed \
     UnpackedTarball/pdfium/core/fxge/fontdata/chromefontdata/FoxitFixedBold \
@@ -458,7 +451,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_glyphcache \
+    UnpackedTarball/pdfium/core/fxge/cfx_facecache \
     UnpackedTarball/pdfium/core/fxge/cfx_folderfontinfo \
     UnpackedTarball/pdfium/core/fxge/cfx_font \
     UnpackedTarball/pdfium/core/fxge/cfx_fontcache \
@@ -471,14 +464,11 @@ $(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/cfx_glyphbitmap \
-    UnpackedTarball/pdfium/core/fxge/scoped_font_transform \
-    UnpackedTarball/pdfium/core/fxge/text_glyph_pos \
-    UnpackedTarball/pdfium/core/fxge/fx_font \
+    UnpackedTarball/pdfium/core/fxge/cttfontdesc \
+    UnpackedTarball/pdfium/core/fxge/fx_ge_fontmap \
+    UnpackedTarball/pdfium/core/fxge/fx_ge_linux \
+    UnpackedTarball/pdfium/core/fxge/fx_ge_text \
     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.
@@ -490,21 +480,21 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
 
 # pwl
 $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
-    UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_appstream \
+    UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_appstream \
     UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_button \
     UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_caret \
     UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_combo_box \
     UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_edit \
     UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_edit_ctrl \
     UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_edit_impl \
+    UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_font_map \
     UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_icon \
     UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_list_box \
-    UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_cbbutton \
-    UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_cblistbox \
-    UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_list_ctrl \
+    UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_list_impl \
     UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_scroll_bar \
     UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_special_button \
-    UnpackedTarball/pdfium/core/fxcrt/cfx_timer \
+    UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_timer \
+    UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_timer_handler \
     UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_wnd \
 ))
 
@@ -549,10 +539,6 @@ $(eval $(call gb_Library_add_generated_cobjects,pdfium,\
     UnpackedTarball/pdfium/third_party/libopenjpeg20/sparse_array \
 ))
 
-$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
-    UnpackedTarball/pdfium/third_party/libopenjpeg20/opj_malloc \
-))
-
 # pdfium_base
 $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
     
UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/address_space_randomization
 \
@@ -560,13 +546,6 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
     
UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/spin_lock 
\
     
UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/partition_alloc
 \
     UnpackedTarball/pdfium/third_party/base/debug/alias \
-    
UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/oom_callback
 \
-    
UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/partition_bucket
 \
-    
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 \
-    UnpackedTarball/pdfium/third_party/base/memory/aligned_memory \
 ))
 
 # skia_shared
@@ -586,6 +565,7 @@ ifneq (,$(filter LINUX ANDROID,$(OS)))
 $(eval $(call gb_Library_add_libs,pdfium,\
     -ldl \
     -lrt \
+    -lpthread \
 ))
 
 $(eval $(call gb_Library_use_external,pdfium,freetype))
@@ -639,33 +619,23 @@ ifeq ($(OS),WNT)
 $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
     UnpackedTarball/pdfium/core/fxge/win32/cfx_psrenderer \
     UnpackedTarball/pdfium/core/fxge/win32/cpsoutput \
-    UnpackedTarball/pdfium/core/fxge/win32/cgdi_device_driver \
-    UnpackedTarball/pdfium/core/fxge/win32/cgdi_display_driver \
-    UnpackedTarball/pdfium/core/fxge/win32/cgdi_plus_ext \
-    UnpackedTarball/pdfium/core/fxge/win32/cgdi_printer_driver \
-    UnpackedTarball/pdfium/core/fxge/win32/cps_printer_driver \
-    UnpackedTarball/pdfium/core/fxge/win32/ctext_only_printer_driver \
-    UnpackedTarball/pdfium/core/fxge/win32/cwin32_platform \
-    UnpackedTarball/pdfium/core/fxge/cfx_windowsrenderdevice \
+    UnpackedTarball/pdfium/core/fxge/win32/fx_win32_device \
+    UnpackedTarball/pdfium/core/fxge/win32/fx_win32_dib \
+    UnpackedTarball/pdfium/core/fxge/win32/fx_win32_gdipext \
+    UnpackedTarball/pdfium/core/fxge/win32/fx_win32_print \
     UnpackedTarball/pdfium/core/fxcrt/cfx_fileaccess_windows \
-    UnpackedTarball/pdfium/third_party/base/win/win_util \
-    UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_windowsrenderdevice \
 ))
 
 $(eval $(call gb_Library_use_system_win32_libs,pdfium,\
     gdi32 \
 ))
-
-$(eval $(call gb_Library_add_defs,pdfium,\
-    -DWIN32 \
-))
 endif
 
 ifeq ($(OS),MACOSX)
 # fxge
 $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
     UnpackedTarball/pdfium/core/fxge/apple/fx_apple_platform \
-    UnpackedTarball/pdfium/core/fxge/apple/fx_mac_impl \
+    UnpackedTarball/pdfium/core/fxge/apple/fx_mac_imp \
     UnpackedTarball/pdfium/core/fxge/apple/fx_quartz_device \
 ))
 
@@ -682,16 +652,9 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
     UnpackedTarball/pdfium/core/fxge/android/cfpf_skiafont \
     UnpackedTarball/pdfium/core/fxge/android/cfpf_skiafontmgr \
     UnpackedTarball/pdfium/core/fxge/android/cfx_androidfontinfo \
-    UnpackedTarball/pdfium/core/fxge/android/fx_android_impl \
+    UnpackedTarball/pdfium/core/fxge/android/fx_android_imp \
     UnpackedTarball/pdfium/core/fxge/android/cfpf_skiapathfont \
 ))
 endif
 
-ifeq ($(OS),LINUX)
-# fxge
-$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
-    UnpackedTarball/pdfium/core/fxge/fx_ge_linux \
-))
-endif
-
 # vim: set noet sw=4 ts=4:
diff --git a/external/pdfium/UnpackedTarball_pdfium.mk 
b/external/pdfium/UnpackedTarball_pdfium.mk
index f4643376cee0..aaaab0c25ac1 100644
--- a/external/pdfium/UnpackedTarball_pdfium.mk
+++ b/external/pdfium/UnpackedTarball_pdfium.mk
@@ -8,12 +8,10 @@
 #
 
 pdfium_patches :=
+pdfium_patches += visibility.patch.1
 pdfium_patches += ubsan.patch
 # Fixes build on our baseline.
 pdfium_patches += build.patch.1
-# Avoids Windows 8 build dependency.
-pdfium_patches += windows7.patch.1
-pdfium_patches += c++20-comparison.patch
 
 $(eval $(call gb_UnpackedTarball_UnpackedTarball,pdfium))
 
@@ -38,16 +36,7 @@ $(eval $(call gb_UnpackedTarball_set_post_action,pdfium,\
     mv third_party/base/allocator/partition_allocator/page_allocator.cc 
third_party/base/allocator/partition_allocator/page_allocator.cpp && \
     mv third_party/base/allocator/partition_allocator/partition_alloc.cc 
third_party/base/allocator/partition_allocator/partition_alloc.cpp && \
     mv third_party/base/allocator/partition_allocator/spin_lock.cc 
third_party/base/allocator/partition_allocator/spin_lock.cpp && \
-    mv third_party/base/debug/alias.cc third_party/base/debug/alias.cpp && \
-    mv third_party/base/allocator/partition_allocator/oom_callback.cc 
third_party/base/allocator/partition_allocator/oom_callback.cpp && \
-    mv third_party/base/allocator/partition_allocator/partition_bucket.cc 
third_party/base/allocator/partition_allocator/partition_bucket.cpp && \
-    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/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/libopenjpeg20/opj_malloc.cc 
third_party/libopenjpeg20/opj_malloc.cpp \
+       mv third_party/base/debug/alias.cc third_party/base/debug/alias.cpp \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/pdfium/build.patch.1 b/external/pdfium/build.patch.1
index 7cf1021938f5..721c1784719d 100644
--- a/external/pdfium/build.patch.1
+++ b/external/pdfium/build.patch.1
@@ -1,3 +1,24 @@
+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
@@ -11,6 +32,38 @@ index 323de4ffc..f11a0b0ad 100644
  
    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
@@ -24,6 +77,37 @@ index 0fb627ba8..f71c362e2 100644
    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/third_party/base/span.h b/third_party/base/span.h
 index 0fb627ba8..dda1fc8bc 100644
 --- a/third_party/base/span.h
@@ -37,14 +121,29 @@ index 0fb627ba8..dda1fc8bc 100644
        : span(container.data(), container.size()) {}
    template <
        typename Container,
---- a/core/fxcodec/jpx/cjpx_decoder.cpp
-+++ b/core/fxcodec/jpx/cjpx_decoder.cpp
-@@ -70,7 +70,7 @@ Optional<OpjImageRgbData> alloc_rgb(size_t size) {
-   if (!data.b)
-     return {};
- 
--  return data;
-+  return std::move(data);
- }
+diff --git a/core/fpdfdoc/cpdf_dest.h b/core/fpdfdoc/cpdf_dest.h
+index 7f4eb86c0..5e227f86e 100644
+--- a/core/fpdfdoc/cpdf_dest.h
++++ b/core/fpdfdoc/cpdf_dest.h
+@@ -41,7 +41,7 @@
+               float* pZoom) const;
+ 
+  private:
+-  UnownedPtr<const CPDF_Array> const m_pArray;
++  UnownedPtr<const CPDF_Array> m_pArray;
+ };
+ 
+ #endif  // CORE_FPDFDOC_CPDF_DEST_H_
+diff --git a/core/fpdfdoc/cpdf_filespec.h b/core/fpdfdoc/cpdf_filespec.h
+index 7050f695b..916afed8b 100644
+--- a/core/fpdfdoc/cpdf_filespec.h
++++ b/core/fpdfdoc/cpdf_filespec.h
+@@ -41,7 +41,7 @@ class CPDF_FileSpec {
+ 
+  private:
+   UnownedPtr<const CPDF_Object> const m_pObj;
+-  UnownedPtr<CPDF_Object> const m_pWritableObj;
++  UnownedPtr<CPDF_Object> m_pWritableObj;
+ };
  
- void sycc_to_rgb(int offset,
+ #endif  // CORE_FPDFDOC_CPDF_FILESPEC_H_
diff --git a/external/pdfium/c++20-comparison.patch 
b/external/pdfium/c++20-comparison.patch
deleted file mode 100644
index 025f9ba010db..000000000000
--- a/external/pdfium/c++20-comparison.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- core/fxcrt/fx_memory_wrappers.h
-+++ core/fxcrt/fx_memory_wrappers.h
-@@ -70,8 +70,8 @@
-   }
- 
-   // There's no state, so they are all the same,
--  bool operator==(const FxAllocAllocator& that) { return true; }
--  bool operator!=(const FxAllocAllocator& that) { return false; }
-+  bool operator==(const FxAllocAllocator& that) const { return true; }
-+  bool operator!=(const FxAllocAllocator& that) const { return false; }
- };
- 
- #endif  // CORE_FXCRT_FX_MEMORY_WRAPPERS_H_
diff --git a/external/pdfium/configs/build_config.h 
b/external/pdfium/configs/build_config.h
index ec93c278767c..edd70af53034 100644
--- a/external/pdfium/configs/build_config.h
+++ b/external/pdfium/configs/build_config.h
@@ -6,7 +6,7 @@
 
 // This file adds defines about the platform we're currently building on.
 //  Operating System:
-//    OS_WIN / OS_APPLE / OS_LINUX / OS_POSIX (MACOSX or LINUX)
+//    OS_WIN / OS_MACOSX / OS_LINUX / OS_POSIX (MACOSX or LINUX)
 //  Compiler:
 //    COMPILER_MSVC / COMPILER_GCC
 //  Processor:
@@ -21,7 +21,7 @@
 #define OS_ANDROID 1
 #define OS_LINUX 1
 #elif defined(__APPLE__)
-#define OS_APPLE 1
+#define OS_MACOSX 1
 #elif defined(__linux__)
 #define OS_LINUX 1
 #elif defined(__DragonFly__)
@@ -48,7 +48,7 @@
 
 // For access to standard POSIX features, use OS_POSIX instead of a more
 // specific macro.
-#if defined(OS_APPLE) || defined(OS_LINUX) || defined(OS_BSD) || 
defined(OS_SOLARIS)
+#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || 
defined(OS_SOLARIS)
 #define OS_POSIX 1
 #endif
 
diff --git a/external/pdfium/msvc2015.patch.1 b/external/pdfium/msvc2015.patch.1
deleted file mode 100644
index 36cb5332c7b0..000000000000
--- a/external/pdfium/msvc2015.patch.1
+++ /dev/null
@@ -1,202 +0,0 @@
-Fix MSVC 2015 build
-
---- pdfium/third_party/base/optional.h.orig    2020-10-26 19:26:04.000000000 
+0100
-+++ pdfium/third_party/base/optional.h 2020-12-03 16:00:54.879883100 +0100
-@@ -36,7 +36,7 @@
- struct OptionalStorageBase {
-   // Provide non-defaulted default ctor to make sure it's not deleted by
-   // non-trivial T::T() in the union.
--  constexpr OptionalStorageBase() : dummy_() {}
-+  OptionalStorageBase() : dummy_() {}
- 
-   template <class... Args>
-   constexpr explicit OptionalStorageBase(in_place_t, Args&&... args)
-@@ -88,7 +88,7 @@
- struct OptionalStorageBase<T, true /* trivially destructible */> {
-   // Provide non-defaulted default ctor to make sure it's not deleted by
-   // non-trivial T::T() in the union.
--  constexpr OptionalStorageBase() : dummy_() {}
-+  OptionalStorageBase() : dummy_() {}
- 
-   template <class... Args>
-   constexpr explicit OptionalStorageBase(in_place_t, Args&&... args)
-@@ -607,32 +607,32 @@
-     return *this;
-   }
- 
--  constexpr const T* operator->() const {
-+  const T* operator->() const {
-     CHECK(storage_.is_populated_);
-     return &storage_.value_;
-   }
- 
--  constexpr T* operator->() {
-+  T* operator->() {
-     CHECK(storage_.is_populated_);
-     return &storage_.value_;
-   }
- 
--  constexpr const T& operator*() const & {
-+  const T& operator*() const & {
-     CHECK(storage_.is_populated_);
-     return storage_.value_;
-   }
- 
--  constexpr T& operator*() & {
-+  T& operator*() & {
-     CHECK(storage_.is_populated_);
-     return storage_.value_;
-   }
- 
--  constexpr const T&& operator*() const && {
-+  const T&& operator*() const && {
-     CHECK(storage_.is_populated_);
-     return std::move(storage_.value_);
-   }
- 
--  constexpr T&& operator*() && {
-+  T&& operator*() && {
-     CHECK(storage_.is_populated_);
-     return std::move(storage_.value_);
-   }
-@@ -641,22 +641,22 @@
- 
-   constexpr bool has_value() const { return storage_.is_populated_; }
- 
--  constexpr T& value() & {
-+  T& value() & {
-     CHECK(storage_.is_populated_);
-     return storage_.value_;
-   }
- 
--  constexpr const T& value() const & {
-+  const T& value() const & {
-     CHECK(storage_.is_populated_);
-     return storage_.value_;
-   }
- 
--  constexpr T&& value() && {
-+  T&& value() && {
-     CHECK(storage_.is_populated_);
-     return std::move(storage_.value_);
-   }
- 
--  constexpr const T&& value() const && {
-+  const T&& value() const && {
-     CHECK(storage_.is_populated_);
-     return std::move(storage_.value_);
-   }
---- pdfium/third_party/base/span.h.orig        2020-10-26 19:26:04.000000000 
+0100
-+++ pdfium/third_party/base/span.h     2020-12-03 16:28:15.642138100 +0100
-@@ -193,7 +193,7 @@
- 
-   // TODO(dcheng): Implement construction from a |begin| and |end| pointer.
-   template <size_t N>
--  constexpr span(T (&array)[N]) noexcept : span(array, N) {}
-+  span(T (&array)[N]) noexcept : span(array, N) {}
-   // TODO(dcheng): Implement construction from std::array.
-   // Conversion from a container that provides |T* data()| and |integral_type
-   // size()|.
---- pdfium/core/fpdfapi/page/cpdf_colorspace.cpp.orig  2020-12-03 
16:54:15.514659400 +0100
-+++ pdfium/core/fpdfapi/page/cpdf_colorspace.cpp       2020-12-03 
16:38:52.167650200 +0100
-@@ -905,7 +905,7 @@
-     float R;
-     float G;
-     float B;
--    GetRGB(lab, &R, &G, &B);
-+    GetRGB(pdfium::span<float>(lab), &R, &G, &B);
-     pDestBuf[0] = static_cast<int32_t>(B * 255);
-     pDestBuf[1] = static_cast<int32_t>(G * 255);
-     pDestBuf[2] = static_cast<int32_t>(R * 255);
---- pdfium/core/fpdfapi/page/cpdf_meshstream.cpp.orig  2020-12-03 
16:54:09.233498800 +0100
-+++ pdfium/core/fpdfapi/page/cpdf_meshstream.cpp       2020-12-03 
16:41:29.173766500 +0100
-@@ -209,7 +209,7 @@
-       func->Call(color_value, 1, result, &nResults);
-   }
- 
--  m_pCS->GetRGB(result, &r, &g, &b);
-+  m_pCS->GetRGB(pdfium::span<float>(result), &r, &g, &b);
-   return std::tuple<float, float, float>(r, g, b);
- }
- 
---- pdfium/core/fpdfapi/parser/cpdf_security_handler.cpp.orig  2020-12-03 
16:53:56.077095400 +0100
-+++ pdfium/core/fpdfapi/parser/cpdf_security_handler.cpp       2020-12-03 
16:44:23.951334200 +0100
-@@ -481,7 +481,7 @@
-   uint8_t passcode[32];
-   GetPassCode(owner_password, passcode);
-   uint8_t digest[16];
--  CRYPT_MD5Generate(passcode, digest);
-+  CRYPT_MD5Generate(pdfium::span<uint8_t>(passcode), digest);
-   if (m_Revision >= 3) {
-     for (uint32_t i = 0; i < 50; i++)
-       CRYPT_MD5Generate(digest, digest);
-@@ -570,10 +570,10 @@
-     uint8_t passcode[32];
-     GetPassCode(owner_password_copy, passcode);
-     uint8_t digest[16];
--    CRYPT_MD5Generate(passcode, digest);
-+    CRYPT_MD5Generate(pdfium::span<uint8_t>(passcode), digest);
-     if (m_Revision >= 3) {
-       for (uint32_t i = 0; i < 50; i++)
--        CRYPT_MD5Generate(digest, digest);
-+        CRYPT_MD5Generate(pdfium::span<uint8_t>(digest), digest);
-     }
-     uint8_t enckey[32];
-     memcpy(enckey, digest, key_len);
---- pdfium/core/fpdfapi/page/cpdf_dib.cpp.orig 2020-12-03 16:53:44.548444600 
+0100
-+++ pdfium/core/fpdfapi/page/cpdf_dib.cpp      2020-12-03 16:49:11.937584700 
+0100
-@@ -874,7 +874,7 @@
-     color_values[0] += m_CompData[0].m_DecodeStep;
-     color_values[1] += m_CompData[0].m_DecodeStep;
-     color_values[2] += m_CompData[0].m_DecodeStep;
--    m_pColorSpace->GetRGB(color_values, &R, &G, &B);
-+    m_pColorSpace->GetRGB(pdfium::span<float>(color_values), &R, &G, &B);
-     FX_ARGB argb1 = ArgbEncode(255, FXSYS_roundf(R * 255),
-                                FXSYS_roundf(G * 255), FXSYS_roundf(B * 255));
-     if (argb0 != 0xFF000000 || argb1 != 0xFFFFFFFF) {
---- 
pdfium/third_party/base/allocator/partition_allocator/partition_alloc.cc.orig   
   2020-12-03 17:09:02.887283800 +0100
-+++ pdfium/third_party/base/allocator/partition_allocator/partition_alloc.cc   
2020-12-03 17:07:22.198993800 +0100
-@@ -67,12 +67,12 @@
-   // Chained hooks are not supported. Registering a non-null hook when a
-   // non-null hook is already registered indicates somebody is trying to
-   // overwrite a hook.
--  CHECK((!allocation_observer_hook_ && !free_observer_hook_) ||
-+  CHECK((!allocation_observer_hook_.load() && !free_observer_hook_.load()) ||
-         (!alloc_hook && !free_hook));
-   allocation_observer_hook_ = alloc_hook;
-   free_observer_hook_ = free_hook;
- 
--  hooks_enabled_ = allocation_observer_hook_ || allocation_override_hook_;
-+  hooks_enabled_ = allocation_observer_hook_.load() || 
allocation_override_hook_.load();
- }
- 
- void PartitionAllocHooks::SetOverrideHooks(AllocationOverrideHook* alloc_hook,
-@@ -80,14 +80,14 @@
-                                            ReallocOverrideHook realloc_hook) {
-   subtle::SpinLock::Guard guard(set_hooks_lock_);
- 
--  CHECK((!allocation_override_hook_ && !free_override_hook_ &&
--         !realloc_override_hook_) ||
-+  CHECK((!allocation_override_hook_.load() && !free_override_hook_.load() &&
-+         !realloc_override_hook_.load()) ||
-         (!alloc_hook && !free_hook && !realloc_hook));
-   allocation_override_hook_ = alloc_hook;
-   free_override_hook_ = free_hook;
-   realloc_override_hook_ = realloc_hook;
- 
--  hooks_enabled_ = allocation_observer_hook_ || allocation_override_hook_;
-+  hooks_enabled_ = allocation_observer_hook_.load() || 
allocation_override_hook_.load();
- }
- 
- void PartitionAllocHooks::AllocationObserverHookIfEnabled(
---- 
pdfium/third_party/base/allocator/partition_allocator/partition_page.h.orig     
   2020-12-03 17:13:56.944624000 +0100
-+++ pdfium/third_party/base/allocator/partition_allocator/partition_page.h     
2020-12-03 17:13:34.385932300 +0100
-@@ -25,6 +25,8 @@
- struct DeferredUnmap {
-   void* ptr = nullptr;
-   size_t size = 0;
-+  DeferredUnmap(void* const p, size_t const s) : ptr(p), size(s) {}
-+  DeferredUnmap() = default;
-   // In most cases there is no page to unmap and ptr == nullptr. This function
-   // is inlined to avoid the overhead of a function call in the common case.
-   ALWAYS_INLINE void Run();
diff --git a/external/pdfium/ubsan.patch b/external/pdfium/ubsan.patch
index 8610e24f2828..91428326fc5d 100644
--- a/external/pdfium/ubsan.patch
+++ b/external/pdfium/ubsan.patch
@@ -1,18 +1,18 @@
---- core/fxcrt/string_data_template.cpp
-+++ core/fxcrt/string_data_template.cpp
-@@ -82,7 +82,8 @@ void StringDataTemplate<CharType>::CopyContentsAt(size_t 
offset,
-   ASSERT(nLen >= 0);
-   ASSERT(offset + nLen <= m_nAllocLength);
+--- core/fxcrt/string_data_template.h
++++ core/fxcrt/string_data_template.h
+@@ -78,7 +78,8 @@
  
--  memcpy(m_String + offset, pStr, nLen * sizeof(CharType));
-+  if (nLen != 0)
-+    memcpy(m_String + offset, pStr, nLen * sizeof(CharType));
-   m_String[offset + nLen] = 0;
- }
+   void CopyContentsAt(size_t offset, const CharType* pStr, size_t nLen) {
+     ASSERT(offset >= 0 && nLen >= 0 && offset + nLen <= m_nAllocLength);
+-    memcpy(m_String + offset, pStr, nLen * sizeof(CharType));
++    if (nLen != 0)
++      memcpy(m_String + offset, pStr, nLen * sizeof(CharType));
+     m_String[offset + nLen] = 0;
+   }
  
---- core/fxge/cfx_glyphcache.cpp
-+++ core/fxge/cfx_glyphcache.cpp
-@@ -183,7 +183,8 @@ std::unique_ptr<CFX_GlyphBitmap> 
CFX_GlyphCache::RenderGlyph(
+--- core/fxge/cfx_facecache.cpp
++++ core/fxge/cfx_facecache.cpp
+@@ -183,7 +183,8 @@ std::unique_ptr<CFX_GlyphBitmap> 
CFX_FaceCache::RenderGlyph(
        }
      }
    } else {
diff --git a/external/pdfium/visibility.patch.1 
b/external/pdfium/visibility.patch.1
new file mode 100644
index 000000000000..04e89b38ab10
--- /dev/null
+++ b/external/pdfium/visibility.patch.1
@@ -0,0 +1,30 @@
+diff --git a/public/fpdfview.h b/public/fpdfview.h
+index 1ff0aeb26..f48036f2b 100644
+--- a/public/fpdfview.h
++++ b/public/fpdfview.h
+@@ -129,14 +129,20 @@ typedef int FPDF_ANNOTATION_SUBTYPE;
+ // Dictionary value types.
+ typedef int FPDF_OBJECT_TYPE;
+ 
+-#if defined(_WIN32) && defined(FPDFSDK_EXPORTS)
+-// On Windows system, functions are exported in a DLL
++#if defined(PDFIUM_DLLIMPLEMENTATION)
++#ifdef _WIN32
+ #define FPDF_EXPORT __declspec(dllexport)
+-#define FPDF_CALLCONV __stdcall
+ #else
+-#define FPDF_EXPORT
+-#define FPDF_CALLCONV
++#define FPDF_EXPORT __attribute__ ((visibility("default")))
++#endif
++#else
++#ifdef _WIN32
++#define FPDF_EXPORT __declspec(dllimport)
++#else
++#define FPDF_EXPORT __attribute__ ((visibility("default")))
+ #endif
++#endif
++#define FPDF_CALLCONV
+ 
+ // Exported Functions
+ #ifdef __cplusplus
diff --git a/external/pdfium/windows7.patch.1 b/external/pdfium/windows7.patch.1
deleted file mode 100644
index d33f273ff4ca..000000000000
--- a/external/pdfium/windows7.patch.1
+++ /dev/null
@@ -1,34 +0,0 @@
-diff --git a/third_party/base/win/win_util.cc 
b/third_party/base/win/win_util.cc
-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<GetProcessMitigationPolicyType>(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/solenv/flatpak-manifest.in b/solenv/flatpak-manifest.in
index a211b4e3291f..0a26b353e3bf 100644
--- a/solenv/flatpak-manifest.in
+++ b/solenv/flatpak-manifest.in
@@ -54,10 +54,10 @@
                     "type": "shell"
                 },
                 {
-                    "url": 
"https://dev-www.libreoffice.org/src/pdfium-4306.tar.bz2";,
-                    "sha256": 
"eca406d47ac7e2a84dcc86f93c08f96e591d409589e881477fa75e488e4851d8",
+                    "url": 
"https://dev-www.libreoffice.org/src/pdfium-3550.tar.bz2";,
+                    "sha256": 
"572460f7f9e2f86d022a9c6a82f1e2ded6c3c29ba352d4b9fac60b87e2159679",
                     "type": "file",
-                    "dest-filename": "external/tarballs/pdfium-4306.tar.bz2"
+                    "dest-filename": "external/tarballs/pdfium-3550.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 3d46fcdd55fc..881880255f90 100644
--- a/svx/source/svdraw/svdpdf.cxx
+++ b/svx/source/svdraw/svdpdf.cxx
@@ -218,7 +218,7 @@ void ImpSdrPdfImport::DoObjects(SvdProgressInfo* 
pProgrInfo, sal_uInt32* pAction
         // Load the page text to extract it when we get text elements.
         FPDF_TEXTPAGE pTextPage = FPDFText_LoadPage(pPdfPage);
 
-        const int nPageObjectCount = FPDFPage_CountObjects(pPdfPage);
+        const int nPageObjectCount = FPDFPage_CountObject(pPdfPage);
         if (pProgrInfo)
             pProgrInfo->SetActionCount(nPageObjectCount);
 
@@ -767,9 +767,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;
 
-    FS_MATRIX matrix;
-    FPDFFormObj_GetMatrix(pPageObject, &matrix);
-    mCurMatrix = Matrix(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, 
matrix.f);
+    double a, b, c, d, e, f;
+    FPDFFormObj_GetMatrix(pPageObject, &a, &b, &c, &d, &e, &f);
+    mCurMatrix = Matrix(a, b, c, d, e, f);
 
     const int nCount = FPDFFormObj_CountObjects(pPageObject);
     for (int nIndex = 0; nIndex < nCount; ++nIndex)
@@ -797,8 +797,8 @@ void ImpSdrPdfImport::ImportText(FPDF_PAGEOBJECT 
pPageObject, FPDF_TEXTPAGE pTex
     if (left == right || top == bottom)
         return;
 
-    FS_MATRIX matrix;
-    FPDFTextObj_GetMatrix(pPageObject, &matrix);
+    double a, b, c, d, e, f;
+    FPDFText_GetMatrix(pPageObject, &a, &b, &c, &d, &e, &f);
     Matrix aTextMatrix(mCurMatrix);
 
     aTextMatrix.Transform(left, right, top, bottom);
@@ -816,8 +816,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(matrix.a, matrix.c) * dFontSize);
-    double dFontSizeV = fabs(sqrt2(matrix.b, matrix.d) * dFontSize);
+    double dFontSizeH = fabs(sqrt2(a, c) * dFontSize);
+    double dFontSizeV = fabs(sqrt2(b, d) * dFontSize);
     dFontSizeH = lcl_PointToPixel(dFontSizeH);
     dFontSizeV = lcl_PointToPixel(dFontSizeV);
     dFontSizeH = lcl_ToLogic(dFontSizeH);
@@ -850,7 +850,7 @@ void ImpSdrPdfImport::ImportText(FPDF_PAGEOBJECT 
pPageObject, FPDF_TEXTPAGE pTex
     Color aTextColor(COL_TRANSPARENT);
     bool bFill = false;
     bool bUse = true;
-    switch (FPDFTextObj_GetTextRenderMode(pPageObject))
+    switch (FPDFText_GetTextRenderMode(pPageObject))
     {
         case FPDF_TEXTRENDERMODE_FILL:
         case FPDF_TEXTRENDERMODE_FILL_CLIP:
@@ -860,7 +860,6 @@ 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:
@@ -940,7 +939,7 @@ void ImpSdrPdfImport::ImportText(const Point& rPos, const 
Size& rSize, const OUS
     if (nAngle)
     {
         nAngle *= 10;
-        double a = nAngle * F_PI18000;
+        double a = nAngle * nPi180;
         double nSin = sin(a);
         double nCos = cos(a);
         pText->NbcRotate(aPos, nAngle, nSin, nCos);
@@ -1033,9 +1032,9 @@ void ImpSdrPdfImport::ImportImage(FPDF_PAGEOBJECT 
pPageObject, int /*nPageObject
 
 void ImpSdrPdfImport::ImportPath(FPDF_PAGEOBJECT pPageObject, int 
/*nPageObjectIndex*/)
 {
-    FS_MATRIX matrix;
-    FPDFPath_GetMatrix(pPageObject, &matrix);
-    Matrix aPathMatrix(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, 
matrix.f);
+    double a, b, c, d, e, f;
+    FPDFPath_GetMatrix(pPageObject, &a, &b, &c, &d, &e, &f);
+    Matrix aPathMatrix(a, b, c, d, e, f);
     aPathMatrix.Concatinate(mCurMatrix);
 
     basegfx::B2DPolyPolygon aPolyPoly;
@@ -1138,12 +1137,12 @@ void ImpSdrPdfImport::ImportPath(FPDF_PAGEOBJECT 
pPageObject, int /*nPageObjectI
     unsigned int nG;
     unsigned int nB;
     unsigned int nA;
-    FPDFPageObj_GetFillColor(pPageObject, &nR, &nG, &nB, &nA);
+    FPDFPath_GetFillColor(pPageObject, &nR, &nG, &nB, &nA);
     mpVD->SetFillColor(Color(nR, nG, nB));
 
     if (bStroke)
     {
-        FPDFPageObj_GetStrokeColor(pPageObject, &nR, &nG, &nB, &nA);
+        FPDFPath_GetStrokeColor(pPageObject, &nR, &nG, &nB, &nA);
         mpVD->SetLineColor(Color(nR, nG, nB));
     }
     else
commit 90a9da457d5842af8566199e4182f1130a13f85d
Author:     Gabor Kelemen <kelemen.gab...@nisz.hu>
AuthorDate: Wed Nov 3 11:09:56 2021 +0100
Commit:     Gabor Kelemen <kelemen.gab...@nisz.hu>
CommitDate: Wed Nov 3 11:11:03 2021 +0100

    Revert "Adapt CPPUNIT_ASSERT to C++20 deleted ostream <<
    
    for sal_Unicode (aka char16_t)"
    
    This reverts commit 5d8f0fad50f90195a11873c70ddab4644f5839ea.
    This causes build errors on older baseline
    
    Change-Id: I16abadf2c282b13678dd3382edeb2d03d4342ab5

diff --git a/cppu/qa/cppumaker/test_cppumaker.cxx 
b/cppu/qa/cppumaker/test_cppumaker.cxx
index 0ac7f854fe76..e73a502333f8 100644
--- a/cppu/qa/cppumaker/test_cppumaker.cxx
+++ b/cppu/qa/cppumaker/test_cppumaker.cxx
@@ -360,7 +360,6 @@
 #include <cppunit/TestFixture.h>
 #include <cppunit/extensions/HelperMacros.h>
 #include <cppunit/plugin/TestPlugIn.h>
-#include <o3tl/cppunittraitshelper.hxx>
 #include <rtl/ustring.hxx>
 
 #include <cstddef>
diff --git a/cppu/qa/test_any.cxx b/cppu/qa/test_any.cxx
index ea4013b2e2bc..7787176ffd3b 100644
--- a/cppu/qa/test_any.cxx
+++ b/cppu/qa/test_any.cxx
@@ -50,7 +50,6 @@
 #include <com/sun/star/uno/Sequence.hxx>
 #include <com/sun/star/uno/Type.hxx>
 #include <com/sun/star/uno/XInterface.hpp>
-#include <o3tl/cppunittraitshelper.hxx>
 #include <osl/interlck.h>
 #include <rtl/string.h>
 #include <rtl/ustring.h>
diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx 
b/i18npool/qa/cppunit/test_breakiterator.cxx
index 71858daa617e..0c132acf3a43 100644
--- a/i18npool/qa/cppunit/test_breakiterator.cxx
+++ b/i18npool/qa/cppunit/test_breakiterator.cxx
@@ -13,7 +13,6 @@
 #include <com/sun/star/i18n/CharacterIteratorMode.hpp>
 #include <com/sun/star/i18n/ScriptType.hpp>
 #include <com/sun/star/i18n/WordType.hpp>
-#include <o3tl/cppunittraitshelper.hxx>
 #include <unotest/bootstrapfixturebase.hxx>
 
 #include <unicode/uversion.h>
diff --git a/sal/qa/rtl/oustring/rtl_OUString2.cxx 
b/sal/qa/rtl/oustring/rtl_OUString2.cxx
index 20fe5e02991c..b932e371be3d 100644
--- a/sal/qa/rtl/oustring/rtl_OUString2.cxx
+++ b/sal/qa/rtl/oustring/rtl_OUString2.cxx
@@ -30,8 +30,6 @@
 #include <cppunit/extensions/HelperMacros.h>
 #include <cppunit/plugin/TestPlugIn.h>
 
-#include <o3tl/cppunittraitshelper.hxx>
-
 #include <stringhelper.hxx>
 #include <valueequal.hxx>
 
diff --git a/sal/qa/rtl/oustringbuffer/test_oustringbuffer_appendchar.cxx 
b/sal/qa/rtl/oustringbuffer/test_oustringbuffer_appendchar.cxx
index 80ce83b1d2d0..f1a151fdc836 100644
--- a/sal/qa/rtl/oustringbuffer/test_oustringbuffer_appendchar.cxx
+++ b/sal/qa/rtl/oustringbuffer/test_oustringbuffer_appendchar.cxx
@@ -7,9 +7,6 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#include <sal/config.h>
-
-#include <o3tl/cppunittraitshelper.hxx>
 #include <sal/types.h>
 #include <cppunit/TestFixture.h>
 #include <cppunit/TestAssert.h>
diff --git a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx 
b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
index c09dfe99451b..a98401351a7f 100644
--- a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
@@ -14,7 +14,6 @@
 
 #include <utility>
 
-#include <o3tl/cppunittraitshelper.hxx>
 #include <sal/types.h>
 #include <config_global.h>
 #include <cppunit/TestFixture.h>
diff --git a/sal/qa/rtl/textenc/rtl_textcvt.cxx 
b/sal/qa/rtl/textenc/rtl_textcvt.cxx
index 3c8539640522..339075decba3 100644
--- a/sal/qa/rtl/textenc/rtl_textcvt.cxx
+++ b/sal/qa/rtl/textenc/rtl_textcvt.cxx
@@ -27,7 +27,6 @@
 #include <cppunit/TestFixture.h>
 #include <cppunit/extensions/HelperMacros.h>
 
-#include <o3tl/cppunittraitshelper.hxx>
 #include <rtl/string.hxx>
 #include <rtl/ustring.hxx>
 #include <rtl/tencinfo.h>
diff --git a/starmath/qa/cppunit/test_node.cxx 
b/starmath/qa/cppunit/test_node.cxx
index 19cb5167cc2f..cb24bbdff78b 100644
--- a/starmath/qa/cppunit/test_node.cxx
+++ b/starmath/qa/cppunit/test_node.cxx
@@ -10,7 +10,6 @@
 #include <sal/config.h>
 #include <test/bootstrapfixture.hxx>
 
-#include <o3tl/cppunittraitshelper.hxx>
 #include <sfx2/sfxmodelfactory.hxx>
 
 #include <document.hxx>
diff --git a/starmath/qa/extras/mmlexport-test.cxx 
b/starmath/qa/extras/mmlexport-test.cxx
index cbcc1d040c26..8fdaa566a778 100644
--- a/starmath/qa/extras/mmlexport-test.cxx
+++ b/starmath/qa/extras/mmlexport-test.cxx
@@ -8,8 +8,6 @@
  */
 
 #include <sal/config.h>
-
-#include <o3tl/cppunittraitshelper.hxx>
 #include <test/bootstrapfixture.hxx>
 #include <test/xmltesttools.hxx>
 #include <unotools/tempfile.hxx>
diff --git a/svl/qa/unit/test_lngmisc.cxx b/svl/qa/unit/test_lngmisc.cxx
index e8daf852ddf2..b4ba30c6c63b 100644
--- a/svl/qa/unit/test_lngmisc.cxx
+++ b/svl/qa/unit/test_lngmisc.cxx
@@ -7,9 +7,6 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#include <sal/config.h>
-
-#include <o3tl/cppunittraitshelper.hxx>
 #include <sal/types.h>
 #include <cppunit/TestAssert.h>
 #include <cppunit/TestFixture.h>
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index ebc8da1bb79c..3c84ed37e97e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -19,7 +19,6 @@
 #include <com/sun/star/text/XTextRangeCompare.hpp>
 #include <com/sun/star/text/WritingMode2.hpp>
 #include <com/sun/star/text/TableColumnSeparator.hpp>
-#include <o3tl/cppunittraitshelper.hxx>
 #include <oox/drawingml/drawingmltypes.hxx>
 #include <config_features.h>
 #include <string>
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index 09bc82a493ce..64b9adc07ff9 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -48,7 +48,6 @@
 #include <com/sun/star/drawing/Hatch.hpp>
 #include <com/sun/star/rdf/URI.hpp>
 #include <com/sun/star/rdf/Statement.hpp>
-#include <o3tl/cppunittraitshelper.hxx>
 
 #include <string>
 #include <config_features.h>
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 20d769bf77e3..e05d7490519a 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -53,7 +53,6 @@
 #include <com/sun/star/document/XFilter.hpp>
 #include <com/sun/star/document/XImporter.hpp>
 #include <vcl/bitmapaccess.hxx>
-#include <o3tl/cppunittraitshelper.hxx>
 #include <unotools/fltrcfg.hxx>
 #include <comphelper/sequenceashashmap.hxx>
 #include <com/sun/star/text/GraphicCrop.hpp>
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index df71b2359cea..263b9aef0e5d 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -39,7 +39,7 @@
 #include <com/sun/star/text/HoriOrientation.hpp>
 #include <com/sun/star/text/VertOrientation.hpp>
 #include <com/sun/star/text/XFormField.hpp>
-#include <o3tl/cppunittraitshelper.hxx>
+
 #include <rtl/ustring.hxx>
 #include <vcl/settings.hxx>
 #include <comphelper/sequenceashashmap.hxx>
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index b007d50ff4a1..ed742104e1c9 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -92,7 +92,6 @@
 #include <com/sun/star/document/XEmbeddedObjectSupplier2.hpp>
 #include <com/sun/star/drawing/XShape.hpp>
 #include <com/sun/star/linguistic2/XLinguProperties.hpp>
-#include <o3tl/cppunittraitshelper.hxx>
 #include <o3tl/deleter.hxx>
 #include <o3tl/make_unique.hxx>
 #include <osl/file.hxx>
diff --git a/vcl/qa/cppunit/mnemonic.cxx b/vcl/qa/cppunit/mnemonic.cxx
index b846d72334dd..0109c1cd0279 100644
--- a/vcl/qa/cppunit/mnemonic.cxx
+++ b/vcl/qa/cppunit/mnemonic.cxx
@@ -7,9 +7,6 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#include <sal/config.h>
-
-#include <o3tl/cppunittraitshelper.hxx>
 #include <test/bootstrapfixture.hxx>
 #include <cppunit/TestAssert.h>
 #include <cppunit/TestFixture.h>

Reply via email to