diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-10-16 14:00:21 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-10-16 14:00:21 -0700 |
commit | db0be96179f0cd5f1787564cbccf86320a4d54ae (patch) | |
tree | 447ba797f172bfffa2d21dacc7dbf6fb2900bfd7 /fpdfsdk/src/fpdfdoc.cpp | |
parent | cebdda5a686251087f14e8df19b7f988dfae46de (diff) | |
download | pdfium-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/fpdfdoc.cpp')
-rw-r--r-- | fpdfsdk/src/fpdfdoc.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/fpdfsdk/src/fpdfdoc.cpp b/fpdfsdk/src/fpdfdoc.cpp index d4b6b08ff3..d1b71ac2bc 100644 --- a/fpdfsdk/src/fpdfdoc.cpp +++ b/fpdfsdk/src/fpdfdoc.cpp @@ -203,8 +203,7 @@ DLLEXPORT unsigned long STDCALL FPDFDest_GetPageIndex(FPDF_DOCUMENT document, DLLEXPORT FPDF_LINK STDCALL FPDFLink_GetLinkAtPoint(FPDF_PAGE page, double x, double y) { - CPDFXFA_Page* pXFAPage = (CPDFXFA_Page*)page; - CPDF_Page* pPage = pXFAPage->GetPDFPage(); + CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!pPage) return nullptr; @@ -218,8 +217,7 @@ FPDFLink_GetLinkAtPoint(FPDF_PAGE page, double x, double y) { DLLEXPORT int STDCALL FPDFLink_GetLinkZOrderAtPoint(FPDF_PAGE page, double x, double y) { - CPDFXFA_Page* pXFAPage = (CPDFXFA_Page*)page; - CPDF_Page* pPage = pXFAPage->GetPDFPage(); + CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!pPage) return -1; @@ -261,10 +259,10 @@ DLLEXPORT FPDF_ACTION STDCALL FPDFLink_GetAction(FPDF_LINK pDict) { DLLEXPORT FPDF_BOOL STDCALL FPDFLink_Enumerate(FPDF_PAGE page, int* startPos, FPDF_LINK* linkAnnot) { - if (!page || !startPos || !linkAnnot) + if (!startPos || !linkAnnot) return FALSE; - CPDF_Page* pPage = ((CPDFXFA_Page*)page)->GetPDFPage(); - if (!pPage->m_pFormDict) + CPDF_Page* pPage = CPDFPageFromFPDFPage(page); + if (!pPage || !pPage->m_pFormDict) return FALSE; CPDF_Array* pAnnots = pPage->m_pFormDict->GetArray("Annots"); if (!pAnnots) |