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 #ifdef PDF_ENABLE_XFA |
9 #include "../include/fpdfxfa/fpdfxfa_app.h" | 10 #include "../include/fpdfxfa/fpdfxfa_app.h" |
10 #include "../include/fpdfxfa/fpdfxfa_doc.h" | 11 #include "../include/fpdfxfa/fpdfxfa_doc.h" |
11 #include "../include/fpdfxfa/fpdfxfa_page.h" | 12 #include "../include/fpdfxfa/fpdfxfa_page.h" |
| 13 #endif |
12 #include "fpdfsdk/include/fsdk_define.h" | 14 #include "fpdfsdk/include/fsdk_define.h" |
13 #include "fpdfsdk/include/fsdk_mgr.h" | 15 #include "fpdfsdk/include/fsdk_mgr.h" |
14 #include "public/fpdfview.h" | 16 #include "public/fpdfview.h" |
15 #include "third_party/base/nonstd_unique_ptr.h" | 17 #include "third_party/base/nonstd_unique_ptr.h" |
16 | 18 |
17 namespace { | 19 namespace { |
18 | 20 |
19 CPDFSDK_Document* FormHandleToSDKDoc(FPDF_FORMHANDLE hHandle) { | 21 CPDFSDK_Document* FormHandleToSDKDoc(FPDF_FORMHANDLE hHandle) { |
20 CPDFDoc_Environment* pEnv = (CPDFDoc_Environment*)hHandle; | 22 CPDFDoc_Environment* pEnv = (CPDFDoc_Environment*)hHandle; |
21 return pEnv ? pEnv->GetSDKDocument() : nullptr; | 23 return pEnv ? pEnv->GetSDKDocument() : nullptr; |
(...skipping 16 matching lines...) Expand all Loading... |
38 | 40 |
39 } // namespace | 41 } // namespace |
40 | 42 |
41 DLLEXPORT int STDCALL FPDFPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle, | 43 DLLEXPORT int STDCALL FPDFPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle, |
42 FPDF_PAGE page, | 44 FPDF_PAGE page, |
43 double page_x, | 45 double page_x, |
44 double page_y) { | 46 double page_y) { |
45 if (!hHandle) | 47 if (!hHandle) |
46 return -1; | 48 return -1; |
47 CPDF_Page* pPage = CPDFPageFromFPDFPage(page); | 49 CPDF_Page* pPage = CPDFPageFromFPDFPage(page); |
| 50 #ifndef PDF_ENABLE_XFA |
| 51 if (!pPage) |
| 52 return -1; |
| 53 CPDF_InterForm interform(pPage->m_pDocument, FALSE); |
| 54 CPDF_FormControl* pFormCtrl = interform.GetControlAtPoint( |
| 55 pPage, (FX_FLOAT)page_x, (FX_FLOAT)page_y, nullptr); |
| 56 if (!pFormCtrl) |
| 57 return -1; |
| 58 #else |
48 if (pPage) { | 59 if (pPage) { |
49 CPDF_InterForm interform(pPage->m_pDocument, FALSE); | 60 CPDF_InterForm interform(pPage->m_pDocument, FALSE); |
50 CPDF_FormControl* pFormCtrl = interform.GetControlAtPoint( | 61 CPDF_FormControl* pFormCtrl = interform.GetControlAtPoint( |
51 pPage, (FX_FLOAT)page_x, (FX_FLOAT)page_y, nullptr); | 62 pPage, (FX_FLOAT)page_x, (FX_FLOAT)page_y, nullptr); |
52 if (!pFormCtrl) | 63 if (!pFormCtrl) |
53 return -1; | 64 return -1; |
54 | 65 |
55 CPDF_FormField* pFormField = pFormCtrl->GetField(); | 66 CPDF_FormField* pFormField = pFormCtrl->GetField(); |
56 if (!pFormField) | 67 if (!pFormField) |
57 return -1; | 68 return -1; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 if (rcWidget.Contains(static_cast<FX_FLOAT>(page_x), | 103 if (rcWidget.Contains(static_cast<FX_FLOAT>(page_x), |
93 static_cast<FX_FLOAT>(page_y))) { | 104 static_cast<FX_FLOAT>(page_y))) { |
94 pWidgetIterator->Release(); | 105 pWidgetIterator->Release(); |
95 return FPDF_FORMFIELD_XFA; | 106 return FPDF_FORMFIELD_XFA; |
96 } | 107 } |
97 pXFAAnnot = pWidgetIterator->MoveToNext(); | 108 pXFAAnnot = pWidgetIterator->MoveToNext(); |
98 } | 109 } |
99 | 110 |
100 pWidgetIterator->Release(); | 111 pWidgetIterator->Release(); |
101 } | 112 } |
| 113 #endif |
102 | 114 |
| 115 #ifndef PDF_ENABLE_XFA |
| 116 CPDF_FormField* pFormField = pFormCtrl->GetField(); |
| 117 return pFormField ? pFormField->GetFieldType() : -1; |
| 118 #else |
103 return -1; | 119 return -1; |
| 120 #endif |
104 } | 121 } |
105 | 122 |
106 DLLEXPORT int STDCALL FPDPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle, | 123 DLLEXPORT int STDCALL FPDPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle, |
107 FPDF_PAGE page, | 124 FPDF_PAGE page, |
108 double page_x, | 125 double page_x, |
109 double page_y) { | 126 double page_y) { |
110 return FPDFPage_HasFormFieldAtPoint(hHandle, page, page_x, page_y); | 127 return FPDFPage_HasFormFieldAtPoint(hHandle, page, page_x, page_y); |
111 } | 128 } |
112 | 129 |
113 DLLEXPORT int STDCALL FPDFPage_FormFieldZOrderAtPoint(FPDF_FORMHANDLE hHandle, | 130 DLLEXPORT int STDCALL FPDFPage_FormFieldZOrderAtPoint(FPDF_FORMHANDLE hHandle, |
114 FPDF_PAGE page, | 131 FPDF_PAGE page, |
115 double page_x, | 132 double page_x, |
116 double page_y) { | 133 double page_y) { |
117 if (!hHandle) | 134 if (!hHandle) |
118 return -1; | 135 return -1; |
119 CPDF_Page* pPage = CPDFPageFromFPDFPage(page); | 136 CPDF_Page* pPage = CPDFPageFromFPDFPage(page); |
120 if (!pPage) | 137 if (!pPage) |
121 return -1; | 138 return -1; |
122 CPDF_InterForm interform(pPage->m_pDocument, FALSE); | 139 CPDF_InterForm interform(pPage->m_pDocument, FALSE); |
123 int z_order = -1; | 140 int z_order = -1; |
124 (void)interform.GetControlAtPoint(pPage, (FX_FLOAT)page_x, (FX_FLOAT)page_y, | 141 (void)interform.GetControlAtPoint(pPage, (FX_FLOAT)page_x, (FX_FLOAT)page_y, |
125 &z_order); | 142 &z_order); |
126 return z_order; | 143 return z_order; |
127 } | 144 } |
128 | 145 |
129 DLLEXPORT FPDF_FORMHANDLE STDCALL | 146 DLLEXPORT FPDF_FORMHANDLE STDCALL |
130 FPDFDOC_InitFormFillEnvironment(FPDF_DOCUMENT document, | 147 FPDFDOC_InitFormFillEnvironment(FPDF_DOCUMENT document, |
131 FPDF_FORMFILLINFO* formInfo) { | 148 FPDF_FORMFILLINFO* formInfo) { |
| 149 #ifndef PDF_ENABLE_XFA |
| 150 const int kRequiredVersion = 1; |
| 151 #else |
132 const int kRequiredVersion = 2; | 152 const int kRequiredVersion = 2; |
| 153 #endif |
133 if (!formInfo || formInfo->version != kRequiredVersion) | 154 if (!formInfo || formInfo->version != kRequiredVersion) |
134 return nullptr; | 155 return nullptr; |
135 | 156 |
136 UnderlyingDocumentType* pDocument = UnderlyingFromFPDFDocument(document); | 157 UnderlyingDocumentType* pDocument = UnderlyingFromFPDFDocument(document); |
137 if (!pDocument) | 158 if (!pDocument) |
138 return nullptr; | 159 return nullptr; |
139 | 160 |
140 CPDFDoc_Environment* pEnv = new CPDFDoc_Environment(pDocument, formInfo); | 161 CPDFDoc_Environment* pEnv = new CPDFDoc_Environment(pDocument, formInfo); |
| 162 #ifndef PDF_ENABLE_XFA |
| 163 pEnv->SetSDKDocument(new CPDFSDK_Document(pDocument, pEnv)); |
| 164 #else |
141 pEnv->SetSDKDocument(pDocument->GetSDKDocument(pEnv)); | 165 pEnv->SetSDKDocument(pDocument->GetSDKDocument(pEnv)); |
142 | 166 |
143 CPDFXFA_App* pApp = CPDFXFA_App::GetInstance(); | 167 CPDFXFA_App* pApp = CPDFXFA_App::GetInstance(); |
144 pApp->AddFormFillEnv(pEnv); | 168 pApp->AddFormFillEnv(pEnv); |
| 169 #endif |
145 return pEnv; | 170 return pEnv; |
146 } | 171 } |
147 | 172 |
148 DLLEXPORT void STDCALL | 173 DLLEXPORT void STDCALL |
149 FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle) { | 174 FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle) { |
150 if (!hHandle) | 175 if (!hHandle) |
151 return; | 176 return; |
| 177 #ifndef PDF_ENABLE_XFA |
| 178 |
| 179 CPDFDoc_Environment* pEnv = (CPDFDoc_Environment*)hHandle; |
| 180 if (CPDFSDK_Document* pSDKDoc = pEnv->GetSDKDocument()) { |
| 181 pEnv->SetSDKDocument(NULL); |
| 182 delete pSDKDoc; |
| 183 } |
| 184 delete pEnv; |
| 185 #else |
152 CPDFXFA_App* pApp = CPDFXFA_App::GetInstance(); | 186 CPDFXFA_App* pApp = CPDFXFA_App::GetInstance(); |
153 pApp->RemoveFormFillEnv((CPDFDoc_Environment*)hHandle); | 187 pApp->RemoveFormFillEnv((CPDFDoc_Environment*)hHandle); |
154 delete (CPDFDoc_Environment*)hHandle; | 188 delete (CPDFDoc_Environment*)hHandle; |
| 189 #endif |
155 } | 190 } |
156 | 191 |
157 DLLEXPORT FPDF_BOOL STDCALL FORM_OnMouseMove(FPDF_FORMHANDLE hHandle, | 192 DLLEXPORT FPDF_BOOL STDCALL FORM_OnMouseMove(FPDF_FORMHANDLE hHandle, |
158 FPDF_PAGE page, | 193 FPDF_PAGE page, |
159 int modifier, | 194 int modifier, |
160 double page_x, | 195 double page_x, |
161 double page_y) { | 196 double page_y) { |
162 CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); | 197 CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); |
163 if (!pPageView) | 198 if (!pPageView) |
164 return FALSE; | 199 return FALSE; |
(...skipping 21 matching lines...) Expand all Loading... |
186 double page_x, | 221 double page_x, |
187 double page_y) { | 222 double page_y) { |
188 CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); | 223 CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); |
189 if (!pPageView) | 224 if (!pPageView) |
190 return FALSE; | 225 return FALSE; |
191 | 226 |
192 CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); | 227 CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); |
193 return pPageView->OnLButtonUp(pt, modifier); | 228 return pPageView->OnLButtonUp(pt, modifier); |
194 } | 229 } |
195 | 230 |
| 231 #ifdef PDF_ENABLE_XFA |
196 DLLEXPORT FPDF_BOOL STDCALL FORM_OnRButtonDown(FPDF_FORMHANDLE hHandle, | 232 DLLEXPORT FPDF_BOOL STDCALL FORM_OnRButtonDown(FPDF_FORMHANDLE hHandle, |
197 FPDF_PAGE page, | 233 FPDF_PAGE page, |
198 int modifier, | 234 int modifier, |
199 double page_x, | 235 double page_x, |
200 double page_y) { | 236 double page_y) { |
201 CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); | 237 CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); |
202 if (!pPageView) | 238 if (!pPageView) |
203 return FALSE; | 239 return FALSE; |
204 | 240 |
205 CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); | 241 CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); |
206 return pPageView->OnRButtonDown(pt, modifier); | 242 return pPageView->OnRButtonDown(pt, modifier); |
207 } | 243 } |
208 | 244 |
209 DLLEXPORT FPDF_BOOL STDCALL FORM_OnRButtonUp(FPDF_FORMHANDLE hHandle, | 245 DLLEXPORT FPDF_BOOL STDCALL FORM_OnRButtonUp(FPDF_FORMHANDLE hHandle, |
210 FPDF_PAGE page, | 246 FPDF_PAGE page, |
211 int modifier, | 247 int modifier, |
212 double page_x, | 248 double page_x, |
213 double page_y) { | 249 double page_y) { |
214 CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); | 250 CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); |
215 if (!pPageView) | 251 if (!pPageView) |
216 return FALSE; | 252 return FALSE; |
217 | 253 |
218 CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); | 254 CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); |
219 return pPageView->OnRButtonUp(pt, modifier); | 255 return pPageView->OnRButtonUp(pt, modifier); |
220 } | 256 } |
221 | 257 |
| 258 #endif |
222 DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyDown(FPDF_FORMHANDLE hHandle, | 259 DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyDown(FPDF_FORMHANDLE hHandle, |
223 FPDF_PAGE page, | 260 FPDF_PAGE page, |
224 int nKeyCode, | 261 int nKeyCode, |
225 int modifier) { | 262 int modifier) { |
226 CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); | 263 CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); |
227 if (!pPageView) | 264 if (!pPageView) |
228 return FALSE; | 265 return FALSE; |
229 | 266 |
230 return pPageView->OnKeyDown(nKeyCode, modifier); | 267 return pPageView->OnKeyDown(nKeyCode, modifier); |
231 } | 268 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 int size_y, | 306 int size_y, |
270 int rotate, | 307 int rotate, |
271 int flags) { | 308 int flags) { |
272 if (!hHandle) | 309 if (!hHandle) |
273 return; | 310 return; |
274 | 311 |
275 UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page); | 312 UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page); |
276 if (!pPage) | 313 if (!pPage) |
277 return; | 314 return; |
278 | 315 |
| 316 #ifndef PDF_ENABLE_XFA |
| 317 CPDF_RenderOptions options; |
| 318 if (flags & FPDF_LCD_TEXT) |
| 319 options.m_Flags |= RENDER_CLEARTYPE; |
| 320 else |
| 321 options.m_Flags &= ~RENDER_CLEARTYPE; |
| 322 #else |
279 CPDFXFA_Document* pDocument = pPage->GetDocument(); | 323 CPDFXFA_Document* pDocument = pPage->GetDocument(); |
280 if (!pDocument) | 324 if (!pDocument) |
281 return; | 325 return; |
| 326 #endif |
282 | 327 |
| 328 #ifndef PDF_ENABLE_XFA |
| 329 // Grayscale output |
| 330 if (flags & FPDF_GRAYSCALE) { |
| 331 options.m_ColorMode = RENDER_COLOR_GRAY; |
| 332 options.m_ForeColor = 0; |
| 333 options.m_BackColor = 0xffffff; |
| 334 } |
| 335 #else |
283 CPDF_Document* pPDFDoc = pDocument->GetPDFDoc(); | 336 CPDF_Document* pPDFDoc = pDocument->GetPDFDoc(); |
284 if (!pPDFDoc) | 337 if (!pPDFDoc) |
285 return; | 338 return; |
| 339 #endif |
286 | 340 |
| 341 #ifndef PDF_ENABLE_XFA |
| 342 options.m_AddFlags = flags >> 8; |
| 343 options.m_pOCContext = new CPDF_OCContext(pPage->m_pDocument); |
| 344 #else |
287 CPDFDoc_Environment* pEnv = (CPDFDoc_Environment*)hHandle; | 345 CPDFDoc_Environment* pEnv = (CPDFDoc_Environment*)hHandle; |
288 CPDFSDK_Document* pFXDoc = pEnv->GetSDKDocument(); | 346 CPDFSDK_Document* pFXDoc = pEnv->GetSDKDocument(); |
289 if (!pFXDoc) | 347 if (!pFXDoc) |
290 return; | 348 return; |
| 349 #endif |
291 | 350 |
292 CFX_AffineMatrix matrix; | 351 CFX_AffineMatrix matrix; |
293 pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate); | 352 pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate); |
294 | 353 |
295 FX_RECT clip; | 354 FX_RECT clip; |
296 clip.left = start_x; | 355 clip.left = start_x; |
297 clip.right = start_x + size_x; | 356 clip.right = start_x + size_x; |
298 clip.top = start_y; | 357 clip.top = start_y; |
299 clip.bottom = start_y + size_y; | 358 clip.bottom = start_y + size_y; |
300 | 359 |
301 #ifdef _SKIA_SUPPORT_ | 360 #ifdef _SKIA_SUPPORT_ |
302 nonstd::unique_ptr<CFX_SkiaDevice> pDevice(new CFX_SkiaDevice); | 361 nonstd::unique_ptr<CFX_SkiaDevice> pDevice(new CFX_SkiaDevice); |
303 #else | 362 #else |
304 nonstd::unique_ptr<CFX_FxgeDevice> pDevice(new CFX_FxgeDevice); | 363 nonstd::unique_ptr<CFX_FxgeDevice> pDevice(new CFX_FxgeDevice); |
305 #endif | 364 #endif |
| 365 #ifdef PDF_ENABLE_XFA |
306 | 366 |
307 if (!pDevice) | 367 if (!pDevice) |
308 return; | 368 return; |
| 369 #endif |
309 pDevice->Attach((CFX_DIBitmap*)bitmap); | 370 pDevice->Attach((CFX_DIBitmap*)bitmap); |
310 pDevice->SaveState(); | 371 pDevice->SaveState(); |
311 pDevice->SetClip_Rect(&clip); | 372 pDevice->SetClip_Rect(&clip); |
312 | 373 |
| 374 #ifndef PDF_ENABLE_XFA |
| 375 if (CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, pPage)) |
| 376 pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options); |
| 377 #else |
313 CPDF_RenderOptions options; | 378 CPDF_RenderOptions options; |
314 if (flags & FPDF_LCD_TEXT) | 379 if (flags & FPDF_LCD_TEXT) |
315 options.m_Flags |= RENDER_CLEARTYPE; | 380 options.m_Flags |= RENDER_CLEARTYPE; |
316 else | 381 else |
317 options.m_Flags &= ~RENDER_CLEARTYPE; | 382 options.m_Flags &= ~RENDER_CLEARTYPE; |
318 | 383 |
319 // Grayscale output | 384 // Grayscale output |
320 if (flags & FPDF_GRAYSCALE) { | 385 if (flags & FPDF_GRAYSCALE) { |
321 options.m_ColorMode = RENDER_COLOR_GRAY; | 386 options.m_ColorMode = RENDER_COLOR_GRAY; |
322 options.m_ForeColor = 0; | 387 options.m_ForeColor = 0; |
323 options.m_BackColor = 0xffffff; | 388 options.m_BackColor = 0xffffff; |
324 } | 389 } |
325 options.m_AddFlags = flags >> 8; | 390 options.m_AddFlags = flags >> 8; |
326 options.m_pOCContext = new CPDF_OCContext(pPDFDoc); | 391 options.m_pOCContext = new CPDF_OCContext(pPDFDoc); |
327 | 392 |
328 if (CPDFSDK_PageView* pPageView = pFXDoc->GetPageView(pPage)) | 393 if (CPDFSDK_PageView* pPageView = pFXDoc->GetPageView(pPage)) |
329 pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options, clip); | 394 pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options, clip); |
| 395 #endif |
330 | 396 |
331 pDevice->RestoreState(); | 397 pDevice->RestoreState(); |
332 delete options.m_pOCContext; | 398 delete options.m_pOCContext; |
| 399 #ifdef PDF_ENABLE_XFA |
333 options.m_pOCContext = NULL; | 400 options.m_pOCContext = NULL; |
334 } | 401 } |
335 DLLEXPORT void STDCALL FPDF_Widget_Undo(FPDF_DOCUMENT document, | 402 DLLEXPORT void STDCALL FPDF_Widget_Undo(FPDF_DOCUMENT document, |
336 FPDF_WIDGET hWidget) { | 403 FPDF_WIDGET hWidget) { |
337 if (NULL == hWidget || NULL == document) | 404 if (NULL == hWidget || NULL == document) |
338 return; | 405 return; |
339 | 406 |
340 CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document; | 407 CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document; |
341 if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic && | 408 if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic && |
342 pDocument->GetDocType() != XFA_DOCTYPE_Static) | 409 pDocument->GetDocType() != XFA_DOCTYPE_Static) |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 FPDF_BYTESTRING bsText, | 640 FPDF_BYTESTRING bsText, |
574 FPDF_DWORD size) { | 641 FPDF_DWORD size) { |
575 if (stringHandle == NULL || bsText == NULL || size <= 0) | 642 if (stringHandle == NULL || bsText == NULL || size <= 0) |
576 return FALSE; | 643 return FALSE; |
577 | 644 |
578 CFX_ByteStringArray* stringArr = (CFX_ByteStringArray*)stringHandle; | 645 CFX_ByteStringArray* stringArr = (CFX_ByteStringArray*)stringHandle; |
579 CFX_ByteString bsStr(bsText, size); | 646 CFX_ByteString bsStr(bsText, size); |
580 | 647 |
581 stringArr->Add(bsStr); | 648 stringArr->Add(bsStr); |
582 return TRUE; | 649 return TRUE; |
| 650 #endif |
583 } | 651 } |
584 | 652 |
585 DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightColor(FPDF_FORMHANDLE hHandle, | 653 DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightColor(FPDF_FORMHANDLE hHandle, |
586 int fieldType, | 654 int fieldType, |
587 unsigned long color) { | 655 unsigned long color) { |
588 if (CPDFSDK_InterForm* pInterForm = FormHandleToInterForm(hHandle)) | 656 if (CPDFSDK_InterForm* pInterForm = FormHandleToInterForm(hHandle)) |
589 pInterForm->SetHighlightColor(color, fieldType); | 657 pInterForm->SetHighlightColor(color, fieldType); |
590 } | 658 } |
591 | 659 |
592 DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightAlpha(FPDF_FORMHANDLE hHandle, | 660 DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightAlpha(FPDF_FORMHANDLE hHandle, |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); | 750 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); |
683 } | 751 } |
684 } else { | 752 } else { |
685 if (aa.ActionExist(CPDF_AAction::ClosePage)) { | 753 if (aa.ActionExist(CPDF_AAction::ClosePage)) { |
686 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); | 754 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); |
687 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); | 755 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); |
688 } | 756 } |
689 } | 757 } |
690 } | 758 } |
691 } | 759 } |
OLD | NEW |