Chromium Code Reviews| Index: fpdfsdk/src/fsdk_baseform.cpp |
| diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp |
| index 6203f8566244277be556b590cf462dd175fb0fd9..99d273394b4602f537f7b3c004428d2bd2a9f077 100644 |
| --- a/fpdfsdk/src/fsdk_baseform.cpp |
| +++ b/fpdfsdk/src/fsdk_baseform.cpp |
| @@ -1623,24 +1623,23 @@ CPDF_Action CPDFSDK_Widget::GetAAction(CPDF_AAction::AActionType eAAT) |
| case CPDF_AAction::PageVisible: |
| case CPDF_AAction::PageInvisible: |
| return CPDFSDK_Annot::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_Annot::GetAAction(eAAT); |
| + |
| + return CPDFSDK_Annot::GetAAction(eAAT); |
|
Lei Zhang
2015/03/06 00:17:05
weird indentation, ditto below
|
| } |
| default: |
| - return NULL; |
| + break; |
| } |
| - return NULL; |
| + return CPDF_Action(); |
| } |
| @@ -2161,7 +2160,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; |
| @@ -2217,13 +2216,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(); |
| @@ -2448,29 +2447,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) |