diff options
Diffstat (limited to 'external/pdfium/0001-Add-FPDFFormObj_GetObject-API.patch.1')
-rw-r--r-- | external/pdfium/0001-Add-FPDFFormObj_GetObject-API.patch.1 | 108 |
1 files changed, 0 insertions, 108 deletions
diff --git a/external/pdfium/0001-Add-FPDFFormObj_GetObject-API.patch.1 b/external/pdfium/0001-Add-FPDFFormObj_GetObject-API.patch.1 deleted file mode 100644 index 8aec3cd21fa6..000000000000 --- a/external/pdfium/0001-Add-FPDFFormObj_GetObject-API.patch.1 +++ /dev/null @@ -1,108 +0,0 @@ -From 1d273f1cf00676725da6f0cd17e107f114030e87 Mon Sep 17 00:00:00 2001 -Date: Mon, 16 Jul 2018 19:20:36 +0000 -Subject: [PATCH] Add FPDFFormObj_GetObject() API -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -To be used together with the existing FPDFFormObj_CountObjects() -function. - -Change-Id: I8ed69624e967708c8db7e8f135e28fbe6a52752f -Reviewed-on: https://pdfium-review.googlesource.com/37890 -Reviewed-by: Nicolás Peña Moreno <npm@chromium.org> -Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> -Commit-Queue: Nicolás Peña Moreno <npm@chromium.org> ---- - fpdfsdk/fpdf_edit_embeddertest.cpp | 20 +++++++++++++++++++ - fpdfsdk/fpdf_editpage.cpp | 41 +++++++++++++++++++++++++++----------- - fpdfsdk/fpdf_view_c_api_test.c | 1 + - public/fpdf_edit.h | 10 ++++++++++ - 4 files changed, 60 insertions(+), 12 deletions(-) - -diff --git a/fpdfsdk/fpdf_editpage.cpp b/fpdfsdk/fpdf_editpage.cpp -index ded55b9be..f1dbf7019 100644 ---- a/fpdfsdk/fpdf_editpage.cpp -+++ b/fpdfsdk/fpdf_editpage.cpp -@@ -140,6 +140,23 @@ unsigned int GetUnsignedAlpha(float alpha) { - return static_cast<unsigned int>(alpha * 255.f + 0.5f); - } - -+const CPDF_PageObjectList* CPDFPageObjListFromFPDFFormObject( -+ FPDF_PAGEOBJECT page_object) { -+ auto* pPageObj = CPDFPageObjectFromFPDFPageObject(page_object); -+ if (!pPageObj) -+ return nullptr; -+ -+ CPDF_FormObject* pFormObject = pPageObj->AsForm(); -+ if (!pFormObject) -+ return nullptr; -+ -+ const CPDF_Form* pForm = pFormObject->form(); -+ if (!pForm) -+ return nullptr; -+ -+ return pForm->GetPageObjectList(); -+} -+ - } // namespace - - FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV FPDF_CreateNewDocument() { -@@ -812,21 +829,21 @@ FPDFPageObj_SetLineCap(FPDF_PAGEOBJECT page_object, int line_cap) { - - FPDF_EXPORT int FPDF_CALLCONV - FPDFFormObj_CountObjects(FPDF_PAGEOBJECT page_object) { -- auto* pPageObj = CPDFPageObjectFromFPDFPageObject(page_object); -- if (!pPageObj) -- return -1; -- -- CPDF_FormObject* pFormObject = pPageObj->AsForm(); -- if (!pFormObject) -+ const CPDF_PageObjectList* pObjectList = -+ CPDFPageObjListFromFPDFFormObject(page_object); -+ if (!pObjectList) - return -1; - -- const CPDF_Form* pForm = pFormObject->form(); -- if (!pForm) -- return -1; -+ return pObjectList->size(); -+} - -- const CPDF_PageObjectList* pObjectList = pForm->GetPageObjectList(); -+FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV -+FPDFFormObj_GetObject(FPDF_PAGEOBJECT form_object, unsigned long index) { -+ const CPDF_PageObjectList* pObjectList = -+ CPDFPageObjListFromFPDFFormObject(form_object); - if (!pObjectList) -- return -1; -+ return nullptr; - -- return pObjectList->size(); -+ return FPDFPageObjectFromCPDFPageObject( -+ pObjectList->GetPageObjectByIndex(index)); - } -diff --git a/public/fpdf_edit.h b/public/fpdf_edit.h -index fdd8c97d0..b97a7adbd 100644 ---- a/public/fpdf_edit.h -+++ b/public/fpdf_edit.h -@@ -1265,6 +1265,16 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetTextRenderMode(FPDF_PAGEOBJECT text); - FPDF_EXPORT int FPDF_CALLCONV - FPDFFormObj_CountObjects(FPDF_PAGEOBJECT form_object); - -+// Experimental API. -+// Get page object in |form_object| at |index|. -+// -+// form_object - handle to a form object. -+// index - the 0-based index of a page object. -+// -+// Returns the handle to the page object, or NULL on error. -+FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV -+FPDFFormObj_GetObject(FPDF_PAGEOBJECT form_object, unsigned long index); -+ - #ifdef __cplusplus - } // extern "C" - #endif // __cplusplus --- -2.16.4 - |