Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Unified Diff: fpdfsdk/src/fpdfformfill.cpp

Issue 1278053004: Add new public APIs to find the z-order for links and widgets. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: address rest of comments Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: fpdfsdk/src/fpdfformfill.cpp
diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp
index 170ae15799393909682d5931a2689e1f32a165b9..cf697c7970701aa41b33121a33515b7be5ad5246 100644
--- a/fpdfsdk/src/fpdfformfill.cpp
+++ b/fpdfsdk/src/fpdfformfill.cpp
@@ -34,18 +34,17 @@ CPDFSDK_PageView* FormHandleToPageView(FPDF_FORMHANDLE hHandle,
} // namespace
-DLLEXPORT int STDCALL FPDPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle,
- FPDF_PAGE page,
- double page_x,
- double page_y) {
+DLLEXPORT int STDCALL FPDFPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle,
+ FPDF_PAGE page,
+ double page_x,
+ double page_y) {
if (!page || !hHandle)
return -1;
- CPDF_Page* pPage = (CPDF_Page*)page;
- nonstd::unique_ptr<CPDF_InterForm> pInterForm(
- new CPDF_InterForm(pPage->m_pDocument, FALSE));
- CPDF_FormControl* pFormCtrl =
- pInterForm->GetControlAtPoint(pPage, (FX_FLOAT)page_x, (FX_FLOAT)page_y);
+ CPDF_Page* pPage = (CPDF_Page*)page;
+ CPDF_InterForm pInterForm(pPage->m_pDocument, FALSE);
jun_fang 2015/08/10 23:51:00 nit: p as a prefix represents a pointer. However,
Lei Zhang 2015/08/15 02:02:27 Done.
+ CPDF_FormControl* pFormCtrl = pInterForm.GetControlAtPoint(
+ pPage, (FX_FLOAT)page_x, (FX_FLOAT)page_y, nullptr);
if (!pFormCtrl)
return -1;
@@ -56,6 +55,28 @@ DLLEXPORT int STDCALL FPDPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle,
return pFormField->GetFieldType();
}
+DLLEXPORT int STDCALL FPDPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle,
+ FPDF_PAGE page,
+ double page_x,
+ double page_y) {
+ return FPDFPage_HasFormFieldAtPoint(hHandle, page, page_x, page_y);
+}
+
+DLLEXPORT int STDCALL FPDFPage_FormFieldZOrderAtPoint(FPDF_FORMHANDLE hHandle,
+ FPDF_PAGE page,
+ double page_x,
+ double page_y) {
+ if (!page || !hHandle)
+ return -1;
+
+ CPDF_Page* pPage = (CPDF_Page*)page;
+ CPDF_InterForm pInterForm(pPage->m_pDocument, FALSE);
jun_fang 2015/08/10 23:51:00 The same as above.
Lei Zhang 2015/08/15 02:02:28 Done.
+ int z_order = -1;
+ (void)pInterForm.GetControlAtPoint(pPage, (FX_FLOAT)page_x, (FX_FLOAT)page_y,
+ &z_order);
+ return z_order;
+}
+
DLLEXPORT FPDF_FORMHANDLE STDCALL
FPDFDOC_InitFormFillEnvironment(FPDF_DOCUMENT document,
FPDF_FORMFILLINFO* formInfo) {

Powered by Google App Engine
This is Rietveld 408576698