Index: fpdfsdk/src/fpdfformfill.cpp |
diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp |
index 170ae15799393909682d5931a2689e1f32a165b9..a6f27207994d6ad6c6b8ccd05d17d8ba232f2792 100644 |
--- a/fpdfsdk/src/fpdfformfill.cpp |
+++ b/fpdfsdk/src/fpdfformfill.cpp |
@@ -40,12 +40,11 @@ DLLEXPORT int STDCALL FPDPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle, |
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); |
+ CPDF_FormControl* pFormCtrl = pInterForm.GetControlAtPoint( |
+ pPage, (FX_FLOAT)page_x, (FX_FLOAT)page_y, nullptr); |
if (!pFormCtrl) |
return -1; |
@@ -56,6 +55,21 @@ DLLEXPORT int STDCALL FPDPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle, |
return pFormField->GetFieldType(); |
} |
+DLLEXPORT int STDCALL FPDPage_FormFieldZOrderAtPoint(FPDF_FORMHANDLE hHandle, |
Tom Sepez
2015/08/07 18:14:06
nit: I never noticed these entry points were named
Lei Zhang
2015/08/07 23:03:41
I'll fix it but retain the old one.
|
+ 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); |
+ int z_order = -1; |
+ 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) { |