OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "public/fpdf_formfill.h" | 7 #include "public/fpdf_formfill.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 } // namespace | 57 } // namespace |
58 | 58 |
59 DLLEXPORT int STDCALL FPDFPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle, | 59 DLLEXPORT int STDCALL FPDFPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle, |
60 FPDF_PAGE page, | 60 FPDF_PAGE page, |
61 double page_x, | 61 double page_x, |
62 double page_y) { | 62 double page_y) { |
63 if (!hHandle) | 63 if (!hHandle) |
64 return -1; | 64 return -1; |
65 CPDF_Page* pPage = CPDFPageFromFPDFPage(page); | 65 CPDF_Page* pPage = CPDFPageFromFPDFPage(page); |
66 if (pPage) { | 66 if (pPage) { |
67 CPDF_InterForm interform(pPage->m_pDocument, FALSE); | 67 CPDF_InterForm interform(pPage->m_pDocument); |
68 CPDF_FormControl* pFormCtrl = | 68 CPDF_FormControl* pFormCtrl = |
69 interform.GetControlAtPoint(pPage, static_cast<FX_FLOAT>(page_x), | 69 interform.GetControlAtPoint(pPage, static_cast<FX_FLOAT>(page_x), |
70 static_cast<FX_FLOAT>(page_y), nullptr); | 70 static_cast<FX_FLOAT>(page_y), nullptr); |
71 if (!pFormCtrl) | 71 if (!pFormCtrl) |
72 return -1; | 72 return -1; |
73 CPDF_FormField* pFormField = pFormCtrl->GetField(); | 73 CPDF_FormField* pFormField = pFormCtrl->GetField(); |
74 return pFormField ? pFormField->GetFieldType() : -1; | 74 return pFormField ? pFormField->GetFieldType() : -1; |
75 } | 75 } |
76 | 76 |
77 #ifdef PDF_ENABLE_XFA | 77 #ifdef PDF_ENABLE_XFA |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 DLLEXPORT int STDCALL FPDFPage_FormFieldZOrderAtPoint(FPDF_FORMHANDLE hHandle, | 128 DLLEXPORT int STDCALL FPDFPage_FormFieldZOrderAtPoint(FPDF_FORMHANDLE hHandle, |
129 FPDF_PAGE page, | 129 FPDF_PAGE page, |
130 double page_x, | 130 double page_x, |
131 double page_y) { | 131 double page_y) { |
132 if (!hHandle) | 132 if (!hHandle) |
133 return -1; | 133 return -1; |
134 CPDF_Page* pPage = CPDFPageFromFPDFPage(page); | 134 CPDF_Page* pPage = CPDFPageFromFPDFPage(page); |
135 if (!pPage) | 135 if (!pPage) |
136 return -1; | 136 return -1; |
137 CPDF_InterForm interform(pPage->m_pDocument, FALSE); | 137 CPDF_InterForm interform(pPage->m_pDocument); |
138 int z_order = -1; | 138 int z_order = -1; |
139 (void)interform.GetControlAtPoint(pPage, (FX_FLOAT)page_x, (FX_FLOAT)page_y, | 139 (void)interform.GetControlAtPoint(pPage, (FX_FLOAT)page_x, (FX_FLOAT)page_y, |
140 &z_order); | 140 &z_order); |
141 return z_order; | 141 return z_order; |
142 } | 142 } |
143 | 143 |
144 DLLEXPORT FPDF_FORMHANDLE STDCALL | 144 DLLEXPORT FPDF_FORMHANDLE STDCALL |
145 FPDFDOC_InitFormFillEnvironment(FPDF_DOCUMENT document, | 145 FPDFDOC_InitFormFillEnvironment(FPDF_DOCUMENT document, |
146 FPDF_FORMFILLINFO* formInfo) { | 146 FPDF_FORMFILLINFO* formInfo) { |
147 #ifdef PDF_ENABLE_XFA | 147 #ifdef PDF_ENABLE_XFA |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
716 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); | 716 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); |
717 } | 717 } |
718 } else { | 718 } else { |
719 if (aa.ActionExist(CPDF_AAction::ClosePage)) { | 719 if (aa.ActionExist(CPDF_AAction::ClosePage)) { |
720 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); | 720 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); |
721 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); | 721 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); |
722 } | 722 } |
723 } | 723 } |
724 } | 724 } |
725 } | 725 } |
OLD | NEW |