| 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 "fpdfsdk/fsdk_actionhandler.h" | 7 #include "fpdfsdk/fsdk_actionhandler.h" |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 return FALSE; | 215 return FALSE; |
| 216 } | 216 } |
| 217 | 217 |
| 218 return TRUE; | 218 return TRUE; |
| 219 } | 219 } |
| 220 | 220 |
| 221 FX_BOOL CPDFSDK_ActionHandler::IsValidField(CPDFSDK_Document* pDocument, | 221 FX_BOOL CPDFSDK_ActionHandler::IsValidField(CPDFSDK_Document* pDocument, |
| 222 CPDF_Dictionary* pFieldDict) { | 222 CPDF_Dictionary* pFieldDict) { |
| 223 ASSERT(pFieldDict); | 223 ASSERT(pFieldDict); |
| 224 | 224 |
| 225 CPDFSDK_InterForm* pInterForm = pDocument->GetInterForm(); | 225 CPDFSDK_InterForm* pInterForm = pDocument->GetEnv()->GetInterForm(); |
| 226 CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm(); | 226 CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm(); |
| 227 return !!pPDFInterForm->GetFieldByDict(pFieldDict); | 227 return !!pPDFInterForm->GetFieldByDict(pFieldDict); |
| 228 } | 228 } |
| 229 | 229 |
| 230 FX_BOOL CPDFSDK_ActionHandler::ExecuteFieldAction( | 230 FX_BOOL CPDFSDK_ActionHandler::ExecuteFieldAction( |
| 231 const CPDF_Action& action, | 231 const CPDF_Action& action, |
| 232 CPDF_AAction::AActionType type, | 232 CPDF_AAction::AActionType type, |
| 233 CPDFSDK_Document* pDocument, | 233 CPDFSDK_Document* pDocument, |
| 234 CPDF_FormField* pFormField, | 234 CPDF_FormField* pFormField, |
| 235 PDFSDK_FieldAction& data, | 235 PDFSDK_FieldAction& data, |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 FX_BOOL bRet = pContext->RunScript(script, &csInfo); | 590 FX_BOOL bRet = pContext->RunScript(script, &csInfo); |
| 591 if (!bRet) { | 591 if (!bRet) { |
| 592 // FIXME: return error. | 592 // FIXME: return error. |
| 593 } | 593 } |
| 594 | 594 |
| 595 pRuntime->ReleaseContext(pContext); | 595 pRuntime->ReleaseContext(pContext); |
| 596 } | 596 } |
| 597 | 597 |
| 598 FX_BOOL CPDFSDK_ActionHandler::DoAction_Hide(const CPDF_Action& action, | 598 FX_BOOL CPDFSDK_ActionHandler::DoAction_Hide(const CPDF_Action& action, |
| 599 CPDFSDK_Document* pDocument) { | 599 CPDFSDK_Document* pDocument) { |
| 600 CPDFSDK_InterForm* pInterForm = pDocument->GetInterForm(); | 600 CPDFSDK_InterForm* pInterForm = pDocument->GetEnv()->GetInterForm(); |
| 601 if (pInterForm->DoAction_Hide(action)) { | 601 if (pInterForm->DoAction_Hide(action)) { |
| 602 pDocument->SetChangeMark(); | 602 pDocument->SetChangeMark(); |
| 603 return TRUE; | 603 return TRUE; |
| 604 } | 604 } |
| 605 | 605 |
| 606 return FALSE; | 606 return FALSE; |
| 607 } | 607 } |
| 608 | 608 |
| 609 FX_BOOL CPDFSDK_ActionHandler::DoAction_SubmitForm( | 609 FX_BOOL CPDFSDK_ActionHandler::DoAction_SubmitForm( |
| 610 const CPDF_Action& action, | 610 const CPDF_Action& action, |
| 611 CPDFSDK_Document* pDocument) { | 611 CPDFSDK_Document* pDocument) { |
| 612 CPDFSDK_InterForm* pInterForm = pDocument->GetInterForm(); | 612 CPDFSDK_InterForm* pInterForm = pDocument->GetEnv()->GetInterForm(); |
| 613 return pInterForm->DoAction_SubmitForm(action); | 613 return pInterForm->DoAction_SubmitForm(action); |
| 614 } | 614 } |
| 615 | 615 |
| 616 FX_BOOL CPDFSDK_ActionHandler::DoAction_ResetForm(const CPDF_Action& action, | 616 FX_BOOL CPDFSDK_ActionHandler::DoAction_ResetForm(const CPDF_Action& action, |
| 617 CPDFSDK_Document* pDocument) { | 617 CPDFSDK_Document* pDocument) { |
| 618 CPDFSDK_InterForm* pInterForm = pDocument->GetInterForm(); | 618 CPDFSDK_InterForm* pInterForm = pDocument->GetEnv()->GetInterForm(); |
| 619 return pInterForm->DoAction_ResetForm(action); | 619 return pInterForm->DoAction_ResetForm(action); |
| 620 } | 620 } |
| 621 | 621 |
| 622 FX_BOOL CPDFSDK_ActionHandler::DoAction_ImportData( | 622 FX_BOOL CPDFSDK_ActionHandler::DoAction_ImportData( |
| 623 const CPDF_Action& action, | 623 const CPDF_Action& action, |
| 624 CPDFSDK_Document* pDocument) { | 624 CPDFSDK_Document* pDocument) { |
| 625 CPDFSDK_InterForm* pInterForm = pDocument->GetInterForm(); | 625 CPDFSDK_InterForm* pInterForm = pDocument->GetEnv()->GetInterForm(); |
| 626 if (pInterForm->DoAction_ImportData(action)) { | 626 if (pInterForm->DoAction_ImportData(action)) { |
| 627 pDocument->SetChangeMark(); | 627 pDocument->SetChangeMark(); |
| 628 return TRUE; | 628 return TRUE; |
| 629 } | 629 } |
| 630 | 630 |
| 631 return FALSE; | 631 return FALSE; |
| 632 } | 632 } |
| OLD | NEW |