summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfformfill.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/fpdfformfill.cpp')
-rw-r--r--fpdfsdk/src/fpdfformfill.cpp39
1 files changed, 30 insertions, 9 deletions
diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp
index 170ae15799..272e781cc2 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 interform(pPage->m_pDocument, FALSE);
+ CPDF_FormControl* pFormCtrl = interform.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 interform(pPage->m_pDocument, FALSE);
+ int z_order = -1;
+ (void)interform.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) {