external/pdfium/CPWL_Dash-switch-to-universal-init.patch.1 |  150 +++++++++++++
 external/pdfium/UnpackedTarball_pdfium.mk                  |    2 
 external/pdfium/build.patch.1                              |  114 ---------
 3 files changed, 152 insertions(+), 114 deletions(-)

New commits:
commit 3e97144aea7b6fd81ec56820eaac67edf7af5ab1
Author:     Miklos Vajna <[email protected]>
AuthorDate: Tue Dec 10 15:23:17 2024 +0100
Commit:     Miklos Vajna <[email protected]>
CommitDate: Tue Nov 11 08:30:39 2025 +0100

    pdfium: mark part of build.patch.1 as upstreamed
    
    So it'll be easier to drop it the next time pdfium is updated.
    
    (cherry picked from commit 904b956622b1581517c938ed8dacac70f7c6242c)
    
     Conflicts:
            external/pdfium/UnpackedTarball_pdfium.mk
    
    Change-Id: Iebeb892f62ee8002460142adf28f75666c92c2e4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182866
    Reviewed-by: Miklos Vajna <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    (cherry picked from commit 60dec074779488c7efe7461ea195b4468f6574d4)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193767

diff --git a/external/pdfium/CPWL_Dash-switch-to-universal-init.patch.1 
b/external/pdfium/CPWL_Dash-switch-to-universal-init.patch.1
new file mode 100644
index 000000000000..9a82052c5013
--- /dev/null
+++ b/external/pdfium/CPWL_Dash-switch-to-universal-init.patch.1
@@ -0,0 +1,150 @@
+From 4467963f67102181c41a1579e627a9748b954d74 Mon Sep 17 00:00:00 2001
+From: Miklos Vajna <[email protected]>
+Date: Fri, 18 Oct 2024 22:08:25 +0000
+Subject: [PATCH] CPWL_Dash: switch to universal init
+
+E.g. clang-15 in -std=c++20 mode fails without this with the following
+error message:
+
+pdfium/fpdfsdk/pwl/cpwl_wnd.cpp:43:7: error: no matching constructor for 
initialization of 'CPWL_Dash'
+      sDash(3, 0, 0) {}
+      ^     ~~~~~~~
+pdfium/fpdfsdk/pwl/cpwl_wnd.h:61:8: note: candidate constructor (the implicit 
copy constructor) not viable: requires 1 argument, but 3 were provided
+struct CPWL_Dash {
+       ^
+pdfium/fpdfsdk/pwl/cpwl_wnd.h:61:8: note: candidate constructor (the implicit 
move constructor) not viable: requires 1 argument, but 3 were provided
+pdfium/fpdfsdk/pwl/cpwl_wnd.h:61:8: note: candidate constructor (the implicit 
default constructor) not viable: requires 0 arguments, but 3 were provided
+1 error generated.
+
+Switching to universal init restores the ability to build with this
+compiler, as it was working in the past.
+
+Change-Id: I48b2079b87cce9bc4e2ec7b813e21ea5bcb786d3
+Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/125170
+Reviewed-by: Tom Sepez <[email protected]>
+Commit-Queue: Tom Sepez <[email protected]>
+Reviewed-by: Lei Zhang <[email protected]>
+Reviewed-by: Tom Sepez <[email protected]>
+---
+ fpdfsdk/cpdfsdk_appstream.cpp         | 20 ++++++++++----------
+ fpdfsdk/formfiller/cffl_formfield.cpp |  2 +-
+ fpdfsdk/pwl/cpwl_wnd.cpp              |  2 +-
+ 3 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/fpdfsdk/cpdfsdk_appstream.cpp b/fpdfsdk/cpdfsdk_appstream.cpp
+index 3a9bfabef..b7b06cae8 100644
+--- a/fpdfsdk/cpdfsdk_appstream.cpp
++++ b/fpdfsdk/cpdfsdk_appstream.cpp
+@@ -1055,7 +1055,7 @@ ByteString GetDropButtonAppStream(const CFX_FloatRect& 
rcBBox) {
+         rcBBox, 2, CFX_Color(CFX_Color::Type::kGray, 0),
+         CFX_Color(CFX_Color::Type::kGray, 1),
+         CFX_Color(CFX_Color::Type::kGray, 0.5), BorderStyle::kBeveled,
+-        CPWL_Dash(3, 0, 0));
++        CPWL_Dash{3, 0, 0});
+   }
+ 
+   CFX_PointF ptCenter = CFX_PointF((rcBBox.left + rcBBox.right) / 2,
+@@ -1162,14 +1162,14 @@ void CPDFSDK_AppStream::SetAsPushButton() {
+   CFX_Color crBorder = pControl->GetOriginalBorderColor();
+ 
+   float fBorderWidth = static_cast<float>(widget_->GetBorderWidth());
+-  CPWL_Dash dsBorder(3, 0, 0);
++  CPWL_Dash dsBorder{3, 0, 0};
+   CFX_Color crLeftTop;
+   CFX_Color crRightBottom;
+ 
+   BorderStyle nBorderStyle = widget_->GetBorderStyle();
+   switch (nBorderStyle) {
+     case BorderStyle::kDash:
+-      dsBorder = CPWL_Dash(3, 3, 0);
++      dsBorder = CPWL_Dash{3, 3, 0};
+       break;
+     case BorderStyle::kBeveled:
+       fBorderWidth *= 2;
+@@ -1313,14 +1313,14 @@ void CPDFSDK_AppStream::SetAsCheckBox() {
+   CFX_Color crBackground = pControl->GetOriginalBackgroundColor();
+   CFX_Color crBorder = pControl->GetOriginalBorderColor();
+   float fBorderWidth = static_cast<float>(widget_->GetBorderWidth());
+-  CPWL_Dash dsBorder(3, 0, 0);
++  CPWL_Dash dsBorder{3, 0, 0};
+   CFX_Color crLeftTop;
+   CFX_Color crRightBottom;
+ 
+   BorderStyle nBorderStyle = widget_->GetBorderStyle();
+   switch (nBorderStyle) {
+     case BorderStyle::kDash:
+-      dsBorder = CPWL_Dash(3, 3, 0);
++      dsBorder = CPWL_Dash{3, 3, 0};
+       break;
+     case BorderStyle::kBeveled:
+       fBorderWidth *= 2;
+@@ -1392,14 +1392,14 @@ void CPDFSDK_AppStream::SetAsRadioButton() {
+   CFX_Color crBackground = pControl->GetOriginalBackgroundColor();
+   CFX_Color crBorder = pControl->GetOriginalBorderColor();
+   float fBorderWidth = static_cast<float>(widget_->GetBorderWidth());
+-  CPWL_Dash dsBorder(3, 0, 0);
++  CPWL_Dash dsBorder{3, 0, 0};
+   CFX_Color crLeftTop;
+   CFX_Color crRightBottom;
+ 
+   BorderStyle nBorderStyle = widget_->GetBorderStyle();
+   switch (nBorderStyle) {
+     case BorderStyle::kDash:
+-      dsBorder = CPWL_Dash(3, 3, 0);
++      dsBorder = CPWL_Dash{3, 3, 0};
+       break;
+     case BorderStyle::kBeveled:
+       fBorderWidth *= 2;
+@@ -1769,7 +1769,7 @@ void 
CPDFSDK_AppStream::SetAsTextField(std::optional<WideString> sValue) {
+         ByteString sColor =
+             GetStrokeColorAppStream(widget_->GetBorderPWLColor());
+         if (sColor.GetLength() > 0) {
+-          CPWL_Dash dsBorder = CPWL_Dash(3, 3, 0);
++          CPWL_Dash dsBorder = CPWL_Dash{3, 3, 0};
+           AutoClosedQCommand q(&sLines);
+           sLines << widget_->GetBorderWidth() << " " << kSetLineWidthOperator
+                  << "
"
+@@ -1876,12 +1876,12 @@ ByteString CPDFSDK_AppStream::GetBorderAppStream() 
const {
+   CFX_Color crRightBottom;
+ 
+   float fBorderWidth = static_cast<float>(widget_->GetBorderWidth());
+-  CPWL_Dash dsBorder(3, 0, 0);
++  CPWL_Dash dsBorder{3, 0, 0};
+ 
+   BorderStyle nBorderStyle = widget_->GetBorderStyle();
+   switch (nBorderStyle) {
+     case BorderStyle::kDash:
+-      dsBorder = CPWL_Dash(3, 3, 0);
++      dsBorder = CPWL_Dash{3, 3, 0};
+       break;
+     case BorderStyle::kBeveled:
+       fBorderWidth *= 2;
+diff --git a/fpdfsdk/formfiller/cffl_formfield.cpp 
b/fpdfsdk/formfiller/cffl_formfield.cpp
+index 49edfdaed..bba78eda6 100644
+--- a/fpdfsdk/formfiller/cffl_formfield.cpp
++++ b/fpdfsdk/formfiller/cffl_formfield.cpp
+@@ -336,7 +336,7 @@ CPWL_Wnd::CreateParams CFFL_FormField::GetCreateParam() {
+   cp.nBorderStyle = m_pWidget->GetBorderStyle();
+   switch (cp.nBorderStyle) {
+     case BorderStyle::kDash:
+-      cp.sDash = CPWL_Dash(3, 3, 0);
++      cp.sDash = CPWL_Dash{3, 3, 0};
+       break;
+     case BorderStyle::kBeveled:
+     case BorderStyle::kInset:
+diff --git a/fpdfsdk/pwl/cpwl_wnd.cpp b/fpdfsdk/pwl/cpwl_wnd.cpp
+index 502568709..88b0cf03e 100644
+--- a/fpdfsdk/pwl/cpwl_wnd.cpp
++++ b/fpdfsdk/pwl/cpwl_wnd.cpp
+@@ -40,7 +40,7 @@ 
CPWL_Wnd::CreateParams::CreateParams(CFX_Timer::HandlerIface* timer_handler,
+       pFillerNotify(filler_notify),
+       pProvider(provider),
+       fFontSize(kDefaultFontSize),
+-      sDash(3, 0, 0) {}
++      sDash{3, 0, 0} {}
+ 
+ CPWL_Wnd::CreateParams::CreateParams(const CreateParams& other) = default;
+ 
+-- 
+2.43.0
+
diff --git a/external/pdfium/UnpackedTarball_pdfium.mk 
b/external/pdfium/UnpackedTarball_pdfium.mk
index 9c0b002d8073..d7a2118e7b80 100644
--- a/external/pdfium/UnpackedTarball_pdfium.mk
+++ b/external/pdfium/UnpackedTarball_pdfium.mk
@@ -12,6 +12,8 @@ pdfium_patches :=
 pdfium_patches += build.patch.1
 # Avoids Windows 8 build dependency.
 pdfium_patches += windows7.patch.1
+# https://pdfium-review.googlesource.com/c/pdfium/+/125170
+pdfium_patches += CPWL_Dash-switch-to-universal-init.patch.1
 pdfium_patches += c++20-comparison.patch
 
 pdfium_patches += constexpr-template.patch
diff --git a/external/pdfium/build.patch.1 b/external/pdfium/build.patch.1
index 80e136d096d1..6fe32f6b76ca 100644
--- a/external/pdfium/build.patch.1
+++ b/external/pdfium/build.patch.1
@@ -77,117 +77,3 @@ index 8026a75d5..34c20d62f 100644
    static_assert(kModeKeyForMode.size() == FPDF_ANNOT_APPEARANCEMODE_COUNT,
                  "length of kModeKeyForMode should be equal to "
                  "FPDF_ANNOT_APPEARANCEMODE_COUNT");
-diff --git a/fpdfsdk/cpdfsdk_appstream.cpp b/fpdfsdk/cpdfsdk_appstream.cpp
-index 3a9bfabef..b7b06cae8 100644
---- a/fpdfsdk/cpdfsdk_appstream.cpp
-+++ b/fpdfsdk/cpdfsdk_appstream.cpp
-@@ -1055,7 +1055,7 @@ ByteString GetDropButtonAppStream(const CFX_FloatRect& 
rcBBox) {
-         rcBBox, 2, CFX_Color(CFX_Color::Type::kGray, 0),
-         CFX_Color(CFX_Color::Type::kGray, 1),
-         CFX_Color(CFX_Color::Type::kGray, 0.5), BorderStyle::kBeveled,
--        CPWL_Dash(3, 0, 0));
-+        CPWL_Dash{3, 0, 0});
-   }
- 
-   CFX_PointF ptCenter = CFX_PointF((rcBBox.left + rcBBox.right) / 2,
-@@ -1162,14 +1162,14 @@ void CPDFSDK_AppStream::SetAsPushButton() {
-   CFX_Color crBorder = pControl->GetOriginalBorderColor();
- 
-   float fBorderWidth = static_cast<float>(widget_->GetBorderWidth());
--  CPWL_Dash dsBorder(3, 0, 0);
-+  CPWL_Dash dsBorder{3, 0, 0};
-   CFX_Color crLeftTop;
-   CFX_Color crRightBottom;
- 
-   BorderStyle nBorderStyle = widget_->GetBorderStyle();
-   switch (nBorderStyle) {
-     case BorderStyle::kDash:
--      dsBorder = CPWL_Dash(3, 3, 0);
-+      dsBorder = CPWL_Dash{3, 3, 0};
-       break;
-     case BorderStyle::kBeveled:
-       fBorderWidth *= 2;
-@@ -1313,14 +1313,14 @@ void CPDFSDK_AppStream::SetAsCheckBox() {
-   CFX_Color crBackground = pControl->GetOriginalBackgroundColor();
-   CFX_Color crBorder = pControl->GetOriginalBorderColor();
-   float fBorderWidth = static_cast<float>(widget_->GetBorderWidth());
--  CPWL_Dash dsBorder(3, 0, 0);
-+  CPWL_Dash dsBorder{3, 0, 0};
-   CFX_Color crLeftTop;
-   CFX_Color crRightBottom;
- 
-   BorderStyle nBorderStyle = widget_->GetBorderStyle();
-   switch (nBorderStyle) {
-     case BorderStyle::kDash:
--      dsBorder = CPWL_Dash(3, 3, 0);
-+      dsBorder = CPWL_Dash{3, 3, 0};
-       break;
-     case BorderStyle::kBeveled:
-       fBorderWidth *= 2;
-@@ -1392,14 +1392,14 @@ void CPDFSDK_AppStream::SetAsRadioButton() {
-   CFX_Color crBackground = pControl->GetOriginalBackgroundColor();
-   CFX_Color crBorder = pControl->GetOriginalBorderColor();
-   float fBorderWidth = static_cast<float>(widget_->GetBorderWidth());
--  CPWL_Dash dsBorder(3, 0, 0);
-+  CPWL_Dash dsBorder{3, 0, 0};
-   CFX_Color crLeftTop;
-   CFX_Color crRightBottom;
- 
-   BorderStyle nBorderStyle = widget_->GetBorderStyle();
-   switch (nBorderStyle) {
-     case BorderStyle::kDash:
--      dsBorder = CPWL_Dash(3, 3, 0);
-+      dsBorder = CPWL_Dash{3, 3, 0};
-       break;
-     case BorderStyle::kBeveled:
-       fBorderWidth *= 2;
-@@ -1769,7 +1769,7 @@ void 
CPDFSDK_AppStream::SetAsTextField(std::optional<WideString> sValue) {
-         ByteString sColor =
-             GetStrokeColorAppStream(widget_->GetBorderPWLColor());
-         if (sColor.GetLength() > 0) {
--          CPWL_Dash dsBorder = CPWL_Dash(3, 3, 0);
-+          CPWL_Dash dsBorder = CPWL_Dash{3, 3, 0};
-           AutoClosedQCommand q(&sLines);
-           sLines << widget_->GetBorderWidth() << " " << kSetLineWidthOperator
-                  << "
"
-@@ -1876,12 +1876,12 @@ ByteString CPDFSDK_AppStream::GetBorderAppStream() 
const {
-   CFX_Color crRightBottom;
- 
-   float fBorderWidth = static_cast<float>(widget_->GetBorderWidth());
--  CPWL_Dash dsBorder(3, 0, 0);
-+  CPWL_Dash dsBorder{3, 0, 0};
- 
-   BorderStyle nBorderStyle = widget_->GetBorderStyle();
-   switch (nBorderStyle) {
-     case BorderStyle::kDash:
--      dsBorder = CPWL_Dash(3, 3, 0);
-+      dsBorder = CPWL_Dash{3, 3, 0};
-       break;
-     case BorderStyle::kBeveled:
-       fBorderWidth *= 2;
-diff --git a/fpdfsdk/formfiller/cffl_formfield.cpp 
b/fpdfsdk/formfiller/cffl_formfield.cpp
-index 49edfdaed..bba78eda6 100644
---- a/fpdfsdk/formfiller/cffl_formfield.cpp
-+++ b/fpdfsdk/formfiller/cffl_formfield.cpp
-@@ -336,7 +336,7 @@ CPWL_Wnd::CreateParams CFFL_FormField::GetCreateParam() {
-   cp.nBorderStyle = m_pWidget->GetBorderStyle();
-   switch (cp.nBorderStyle) {
-     case BorderStyle::kDash:
--      cp.sDash = CPWL_Dash(3, 3, 0);
-+      cp.sDash = CPWL_Dash{3, 3, 0};
-       break;
-     case BorderStyle::kBeveled:
-     case BorderStyle::kInset:
-diff --git a/fpdfsdk/pwl/cpwl_wnd.cpp b/fpdfsdk/pwl/cpwl_wnd.cpp
-index 502568709..88b0cf03e 100644
---- a/fpdfsdk/pwl/cpwl_wnd.cpp
-+++ b/fpdfsdk/pwl/cpwl_wnd.cpp
-@@ -40,7 +40,7 @@ 
CPWL_Wnd::CreateParams::CreateParams(CFX_Timer::HandlerIface* timer_handler,
-       pFillerNotify(filler_notify),
-       pProvider(provider),
-       fFontSize(kDefaultFontSize),
--      sDash(3, 0, 0) {}
-+      sDash{3, 0, 0} {}
- 
- CPWL_Wnd::CreateParams::CreateParams(const CreateParams& other) = default;
- 

Reply via email to