summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fsdk_baseform.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-03-05 16:44:22 -0800
committerTom Sepez <tsepez@chromium.org>2015-03-05 16:44:22 -0800
commit7b5bc26e8267fec38bef9f95cd04d2bd731faff3 (patch)
tree9203aa0ff0d4a34616a5161b2ded34ce7e9ada24 /fpdfsdk/src/fsdk_baseform.cpp
parent827a1722f70e7092270b5e0fdfba1e9c0b1ac50f (diff)
downloadpdfium-7b5bc26e8267fec38bef9f95cd04d2bd731faff3.tar.xz
Merge to XFA: Make conversion between CPDF_Action and its dictionary explicit.
Original Review URL: https://codereview.chromium.org/984773002 R=thestig@chromium.org TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/984783002
Diffstat (limited to 'fpdfsdk/src/fsdk_baseform.cpp')
-rw-r--r--fpdfsdk/src/fsdk_baseform.cpp33
1 files changed, 12 insertions, 21 deletions
diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp
index f2873b51fd..86c43f1aa4 100644
--- a/fpdfsdk/src/fsdk_baseform.cpp
+++ b/fpdfsdk/src/fsdk_baseform.cpp
@@ -2310,24 +2310,22 @@ CPDF_Action CPDFSDK_Widget::GetAAction(CPDF_AAction::AActionType eAAT)
case CPDF_AAction::PageVisible:
case CPDF_AAction::PageInvisible:
return CPDFSDK_BAAnnot::GetAAction(eAAT);
+
case CPDF_AAction::KeyStroke:
case CPDF_AAction::Format:
case CPDF_AAction::Validate:
case CPDF_AAction::Calculate:
{
CPDF_FormField* pField = this->GetFormField();
- ASSERT(pField != NULL);
-
if (CPDF_AAction aa = pField->GetAdditionalAction())
return aa.GetAction(eAAT);
- else
- return CPDFSDK_BAAnnot::GetAAction(eAAT);
+ return CPDFSDK_BAAnnot::GetAAction(eAAT);
}
default:
- return NULL;
+ break;
}
- return NULL;
+ return CPDF_Action();
}
@@ -2930,7 +2928,7 @@ void CPDFSDK_InterForm::OnValidate(CPDF_FormField* pFormField, CFX_WideString& c
FX_BOOL CPDFSDK_InterForm::DoAction_Hide(const CPDF_Action& action)
{
- ASSERT(action != NULL);
+ ASSERT(action);
CPDF_ActionFields af = action.GetWidgets();
CFX_PtrArray fieldObjects;
@@ -2986,13 +2984,13 @@ FX_BOOL CPDFSDK_InterForm::DoAction_Hide(const CPDF_Action& action)
FX_BOOL CPDFSDK_InterForm::DoAction_SubmitForm(const CPDF_Action& action)
{
- ASSERT(action != NULL);
+ ASSERT(action);
ASSERT(m_pInterForm != NULL);
CFX_WideString sDestination = action.GetFilePath();
if (sDestination.IsEmpty()) return FALSE;
- CPDF_Dictionary* pActionDict = action;
+ CPDF_Dictionary* pActionDict = action.GetDict();
if (pActionDict->KeyExist("Fields"))
{
CPDF_ActionFields af = action.GetWidgets();
@@ -3238,29 +3236,22 @@ FX_BOOL CPDFSDK_InterForm::ExportFormToFDFTextBuf(CFX_ByteTextBuf& textBuf)
FX_BOOL CPDFSDK_InterForm::DoAction_ResetForm(const CPDF_Action& action)
{
- ASSERT(action != NULL);
-
- CPDF_Dictionary* pActionDict = action;
+ ASSERT(action);
+ CPDF_Dictionary* pActionDict = action.GetDict();
if (pActionDict->KeyExist("Fields"))
{
CPDF_ActionFields af = action.GetWidgets();
FX_DWORD dwFlags = action.GetFlags();
-
+
CFX_PtrArray fieldObjects;
af.GetAllFields(fieldObjects);
CFX_PtrArray fields;
GetFieldFromObjects(fieldObjects, fields);
-
- ASSERT(m_pInterForm != NULL);
-
return m_pInterForm->ResetForm(fields, !(dwFlags & 0x01), TRUE);
}
- else
- {
- ASSERT(m_pInterForm != NULL);
- return m_pInterForm->ResetForm(TRUE);
- }
+
+ return m_pInterForm->ResetForm(TRUE);
}
FX_BOOL CPDFSDK_InterForm::DoAction_ImportData(const CPDF_Action& action)