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 "../include/fsdk_define.h" | 7 #include "../include/fsdk_define.h" |
8 #include "../include/fpdfxfa/fpdfxfa_doc.h" | 8 #include "../include/fpdfxfa/fpdfxfa_doc.h" |
9 #include "../include/fsdk_mgr.h" | 9 #include "../include/fsdk_mgr.h" |
10 #include "../include/fsdk_actionhandler.h" | 10 #include "../include/fsdk_actionhandler.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 { | 152 { |
153 RunDocumentOpenJavaScript(pDocument, L"", swJS); | 153 RunDocumentOpenJavaScript(pDocument, L"", swJS); |
154 } | 154 } |
155 } | 155 } |
156 } | 156 } |
157 else | 157 else |
158 { | 158 { |
159 DoAction_NoJs(action, pDocument); | 159 DoAction_NoJs(action, pDocument); |
160 } | 160 } |
161 | 161 |
162 » for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i<sz; i++) | 162 » for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++) |
163 { | 163 { |
164 CPDF_Action subaction = action.GetSubAction(i); | 164 CPDF_Action subaction = action.GetSubAction(i); |
165 if (!ExecuteDocumentOpenAction(subaction, pDocument, list)) retu
rn FALSE; | 165 if (!ExecuteDocumentOpenAction(subaction, pDocument, list)) retu
rn FALSE; |
166 } | 166 } |
167 | 167 |
168 return TRUE; | 168 return TRUE; |
169 } | 169 } |
170 | 170 |
171 FX_BOOL CPDFSDK_ActionHandler::ExecuteLinkAction(const CPDF_Action& action,
CPDFSDK_Document* pDocument, | 171 FX_BOOL CPDFSDK_ActionHandler::ExecuteLinkAction(const CPDF_Action& action,
CPDFSDK_Document* pDocument, |
172
CFX_PtrList& list) | 172
CFX_PtrList& list) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 | 207 |
208 pRuntime->ReleaseContext(pContext); | 208 pRuntime->ReleaseContext(pContext); |
209 } | 209 } |
210 } | 210 } |
211 } | 211 } |
212 else | 212 else |
213 { | 213 { |
214 DoAction_NoJs(action, pDocument); | 214 DoAction_NoJs(action, pDocument); |
215 } | 215 } |
216 | 216 |
217 » for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i<sz; i++) | 217 » for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++) |
218 { | 218 { |
219 CPDF_Action subaction = action.GetSubAction(i); | 219 CPDF_Action subaction = action.GetSubAction(i); |
220 if (!ExecuteLinkAction(subaction, pDocument, list)) return FALSE
; | 220 if (!ExecuteLinkAction(subaction, pDocument, list)) return FALSE
; |
221 } | 221 } |
222 | 222 |
223 return TRUE; | 223 return TRUE; |
224 } | 224 } |
225 | 225 |
226 FX_BOOL CPDFSDK_ActionHandler::ExecuteDocumentPageAction(const CPDF_Action& acti
on, CPDF_AAction::AActionType type, | 226 FX_BOOL CPDFSDK_ActionHandler::ExecuteDocumentPageAction(const CPDF_Action& acti
on, CPDF_AAction::AActionType type, |
227
CPDFSDK_Document* pDocument, CFX_PtrList& list) | 227
CPDFSDK_Document* pDocument, CFX_PtrList& list) |
(...skipping 20 matching lines...) Expand all Loading... |
248 } | 248 } |
249 } | 249 } |
250 else | 250 else |
251 { | 251 { |
252 DoAction_NoJs(action, pDocument); | 252 DoAction_NoJs(action, pDocument); |
253 } | 253 } |
254 | 254 |
255 if (!IsValidDocView(pDocument)) | 255 if (!IsValidDocView(pDocument)) |
256 return FALSE; | 256 return FALSE; |
257 | 257 |
258 » for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i<sz; i++) | 258 » for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++) |
259 { | 259 { |
260 CPDF_Action subaction = action.GetSubAction(i); | 260 CPDF_Action subaction = action.GetSubAction(i); |
261 if (!ExecuteDocumentPageAction(subaction, type, pDocument, list)
) return FALSE; | 261 if (!ExecuteDocumentPageAction(subaction, type, pDocument, list)
) return FALSE; |
262 } | 262 } |
263 | 263 |
264 return TRUE; | 264 return TRUE; |
265 } | 265 } |
266 | 266 |
267 FX_BOOL CPDFSDK_ActionHandler::IsValidField(CPDFSDK_Document* pDocument, CPDF_Di
ctionary* pFieldDict) | 267 FX_BOOL CPDFSDK_ActionHandler::IsValidField(CPDFSDK_Document* pDocument, CPDF_Di
ctionary* pFieldDict) |
268 { | 268 { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 if (!IsValidField(pDocument, pFormField->GetFiel
dDict())) | 303 if (!IsValidField(pDocument, pFormField->GetFiel
dDict())) |
304 return FALSE; | 304 return FALSE; |
305 } | 305 } |
306 } | 306 } |
307 } | 307 } |
308 else | 308 else |
309 { | 309 { |
310 DoAction_NoJs(action, pDocument); | 310 DoAction_NoJs(action, pDocument); |
311 } | 311 } |
312 | 312 |
313 » for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i<sz; i++) | 313 » for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++) |
314 { | 314 { |
315 CPDF_Action subaction = action.GetSubAction(i); | 315 CPDF_Action subaction = action.GetSubAction(i); |
316 if (!ExecuteFieldAction(subaction, type, pDocument, pFormField,
data, list)) return FALSE; | 316 if (!ExecuteFieldAction(subaction, type, pDocument, pFormField,
data, list)) return FALSE; |
317 } | 317 } |
318 | 318 |
319 return TRUE; | 319 return TRUE; |
320 } | 320 } |
321 | 321 |
322 FX_BOOL CPDFSDK_ActionHandler::ExecuteScreenAction(const CPDF_Action& action, CP
DF_AAction::AActionType type, | 322 FX_BOOL CPDFSDK_ActionHandler::ExecuteScreenAction(const CPDF_Action& action, CP
DF_AAction::AActionType type, |
323
CPDFSDK_Document* pDocument, CPDFSDK_Annot* pScreen, CFX_PtrList& list) | 323
CPDFSDK_Document* pDocument, CPDFSDK_Annot* pScreen, CFX_PtrList& list) |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 | 393 |
394 pRuntime->ReleaseContext(pContext); | 394 pRuntime->ReleaseContext(pContext); |
395 } | 395 } |
396 } | 396 } |
397 } | 397 } |
398 else | 398 else |
399 { | 399 { |
400 DoAction_NoJs(action, pDocument); | 400 DoAction_NoJs(action, pDocument); |
401 } | 401 } |
402 | 402 |
403 » for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i<sz; i++) | 403 » for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++) |
404 { | 404 { |
405 CPDF_Action subaction = action.GetSubAction(i); | 405 CPDF_Action subaction = action.GetSubAction(i); |
406 if (!ExecuteScreenAction(subaction, type, pDocument, pScreen, li
st)) return FALSE; | 406 if (!ExecuteScreenAction(subaction, type, pDocument, pScreen, li
st)) return FALSE; |
407 } | 407 } |
408 | 408 |
409 return TRUE; | 409 return TRUE; |
410 } | 410 } |
411 | 411 |
412 FX_BOOL CPDFSDK_ActionHandler::ExecuteBookMark(const CPDF_Action& action, CPDFSD
K_Document* pDocument, | 412 FX_BOOL CPDFSDK_ActionHandler::ExecuteBookMark(const CPDF_Action& action, CPDFSD
K_Document* pDocument, |
413
CPDF_Bookmark* pBookmark, CFX_PtrList& list) | 413
CPDF_Bookmark* pBookmark, CFX_PtrList& list) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 | 448 |
449 pRuntime->ReleaseContext(pContext); | 449 pRuntime->ReleaseContext(pContext); |
450 } | 450 } |
451 } | 451 } |
452 } | 452 } |
453 else | 453 else |
454 { | 454 { |
455 DoAction_NoJs(action, pDocument); | 455 DoAction_NoJs(action, pDocument); |
456 } | 456 } |
457 | 457 |
458 » for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i<sz; i++) | 458 » for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++) |
459 { | 459 { |
460 CPDF_Action subaction = action.GetSubAction(i); | 460 CPDF_Action subaction = action.GetSubAction(i); |
461 if (!ExecuteBookMark(subaction, pDocument, pBookmark, list)) ret
urn FALSE; | 461 if (!ExecuteBookMark(subaction, pDocument, pBookmark, list)) ret
urn FALSE; |
462 } | 462 } |
463 | 463 |
464 return TRUE; | 464 return TRUE; |
465 } | 465 } |
466 | 466 |
467 void CPDFSDK_ActionHandler::DoAction_NoJs(const CPDF_Action& action, CPDFSDK_Doc
ument* pDocument) | 467 void CPDFSDK_ActionHandler::DoAction_NoJs(const CPDF_Action& action, CPDFSDK_Doc
ument* pDocument) |
468 { | 468 { |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 | 821 |
822 FX_BOOL CPDFSDK_MediaActionHandler::DoAction_Sound(const CPDF_Action& action, CP
DFSDK_Document* pDocument) | 822 FX_BOOL CPDFSDK_MediaActionHandler::DoAction_Sound(const CPDF_Action& action, CP
DFSDK_Document* pDocument) |
823 { | 823 { |
824 return FALSE; | 824 return FALSE; |
825 } | 825 } |
826 | 826 |
827 FX_BOOL CPDFSDK_MediaActionHandler::DoAction_Movie(const CPDF_Action& action, CP
DFSDK_Document* pDocument) | 827 FX_BOOL CPDFSDK_MediaActionHandler::DoAction_Movie(const CPDF_Action& action, CP
DFSDK_Document* pDocument) |
828 { | 828 { |
829 return FALSE; | 829 return FALSE; |
830 } | 830 } |
OLD | NEW |