summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfformfill.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-10-16 14:00:21 -0700
committerTom Sepez <tsepez@chromium.org>2015-10-16 14:00:21 -0700
commitdb0be96179f0cd5f1787564cbccf86320a4d54ae (patch)
tree447ba797f172bfffa2d21dacc7dbf6fb2900bfd7 /fpdfsdk/src/fpdfformfill.cpp
parentcebdda5a686251087f14e8df19b7f988dfae46de (diff)
downloadpdfium-db0be96179f0cd5f1787564cbccf86320a4d54ae.tar.xz
Merge to XFA: Introduce CPDFPageFromFPFDPage()
Original Review URL: https://codereview.chromium.org/1406543004 . (cherry picked from commit 943ea142b6a7e6edc91fe3c307013129e6eb0ef3) R=thestig@chromium.org Review URL: https://codereview.chromium.org/1411623002 .
Diffstat (limited to 'fpdfsdk/src/fpdfformfill.cpp')
-rw-r--r--fpdfsdk/src/fpdfformfill.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp
index e86a47be55..9fe024c50b 100644
--- a/fpdfsdk/src/fpdfformfill.cpp
+++ b/fpdfsdk/src/fpdfformfill.cpp
@@ -42,10 +42,9 @@ DLLEXPORT int STDCALL FPDFPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle,
FPDF_PAGE page,
double page_x,
double page_y) {
- if (!page || !hHandle)
+ if (!hHandle)
return -1;
-
- CPDF_Page* pPage = ((CPDFXFA_Page*)page)->GetPDFPage();
+ CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
if (pPage) {
CPDF_InterForm interform(pPage->m_pDocument, FALSE);
CPDF_FormControl* pFormCtrl = interform.GetControlAtPoint(
@@ -115,10 +114,11 @@ DLLEXPORT int STDCALL FPDFPage_FormFieldZOrderAtPoint(FPDF_FORMHANDLE hHandle,
FPDF_PAGE page,
double page_x,
double page_y) {
- if (!page || !hHandle)
+ if (!hHandle)
+ return -1;
+ CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
+ if (!pPage)
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,