From ba62bf4077789557079a7523226dc542a8773bbc Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 2 Apr 2019 21:14:36 +0200 Subject: pdfium: avoid problems with SetForm using WIN32_LEAN_AND_MEAN So that it does not get defined to SetFormA() or SetFormW() and still requires no patching. Change-Id: I4364b02306633733d8536ebd8d7d42273dfeef74 Reviewed-on: https://gerrit.libreoffice.org/70150 Tested-by: Jenkins Reviewed-by: Miklos Vajna (cherry picked from commit 66c29fd202f22a36edbb929ddcc1f1cadb0a6e8f) --- external/pdfium/Library_pdfium.mk | 1 + external/pdfium/build.patch.1 | 57 --------------------------------------- 2 files changed, 1 insertion(+), 57 deletions(-) (limited to 'external') diff --git a/external/pdfium/Library_pdfium.mk b/external/pdfium/Library_pdfium.mk index 4e22618f32b5..2bfa8210676d 100644 --- a/external/pdfium/Library_pdfium.mk +++ b/external/pdfium/Library_pdfium.mk @@ -27,6 +27,7 @@ $(eval $(call gb_Library_add_defs,pdfium,\ -DUSE_SYSTEM_ICUUC \ -DMEMORY_TOOL_REPLACES_ALLOCATOR \ -DUNICODE \ + -DWIN32_LEAN_AND_MEAN \ )) # Don't show warnings upstream doesn't care about. diff --git a/external/pdfium/build.patch.1 b/external/pdfium/build.patch.1 index 0a4476ce1300..a1ec25e8b223 100644 --- a/external/pdfium/build.patch.1 +++ b/external/pdfium/build.patch.1 @@ -84,60 +84,3 @@ index 7050f695b..916afed8b 100644 }; #endif // CORE_FPDFDOC_CPDF_FILESPEC_H_ -diff --git a/fpdfsdk/cpdf_annotcontext.cpp b/fpdfsdk/cpdf_annotcontext.cpp -index 0beebe1bf..4aeefb04e 100644 ---- a/fpdfsdk/cpdf_annotcontext.cpp -+++ b/fpdfsdk/cpdf_annotcontext.cpp -@@ -21,7 +21,7 @@ CPDF_AnnotContext::CPDF_AnnotContext(CPDF_Dictionary* pAnnotDict, - - 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 cab81e7d4..ce24fff52 100644 ---- a/fpdfsdk/cpdf_annotcontext.h -+++ b/fpdfsdk/cpdf_annotcontext.h -@@ -21,7 +21,7 @@ class CPDF_AnnotContext { - CPDF_AnnotContext(CPDF_Dictionary* pAnnotDict, CPDF_Page* pPage); - ~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(); } - -diff --git a/fpdfsdk/fpdf_annot.cpp b/fpdfsdk/fpdf_annot.cpp -index 8b4c69789..f6560059f 100644 ---- a/fpdfsdk/fpdf_annot.cpp -+++ b/fpdfsdk/fpdf_annot.cpp -@@ -399,7 +399,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 -@@ -435,7 +435,7 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFAnnot_GetObjectCount(FPDF_ANNOTATION annot) { - if (!pStream) - return 0; - -- pAnnot->SetForm(pStream); -+ pAnnot->SetForm_(pStream); - } - return pdfium::CollectionSize(*pAnnot->GetForm()->GetPageObjectList()); - } -@@ -452,7 +452,7 @@ FPDFAnnot_GetObject(FPDF_ANNOTATION annot, int index) { - if (!pStream) - return nullptr; - -- pAnnot->SetForm(pStream); -+ pAnnot->SetForm_(pStream); - } - - return FPDFPageObjectFromCPDFPageObject( -- cgit v1.2.3