summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/formfiller/FFL_TextField.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-12-14 18:27:25 -0800
committerLei Zhang <thestig@chromium.org>2015-12-14 18:27:25 -0800
commit96660d6f382204339d6b1aadc3913303d436e252 (patch)
treeb5f84756e1a89251831cebc05b9d4e1f6cb2027b /fpdfsdk/src/formfiller/FFL_TextField.cpp
parentd983b09c3ae29a97cba8e9ec9c6351545f6087ee (diff)
downloadpdfium-96660d6f382204339d6b1aadc3913303d436e252.tar.xz
Merge to XFA: Get rid of most instance of 'foo != NULL'
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1512763013 . (cherry picked from commit e3c7c2b54348da4a6939f6672f6c6bff126815a7) Review URL: https://codereview.chromium.org/1529553003 .
Diffstat (limited to 'fpdfsdk/src/formfiller/FFL_TextField.cpp')
-rw-r--r--fpdfsdk/src/formfiller/FFL_TextField.cpp26
1 files changed, 6 insertions, 20 deletions
diff --git a/fpdfsdk/src/formfiller/FFL_TextField.cpp b/fpdfsdk/src/formfiller/FFL_TextField.cpp
index 3490338a4d..cc2d31827f 100644
--- a/fpdfsdk/src/formfiller/FFL_TextField.cpp
+++ b/fpdfsdk/src/formfiller/FFL_TextField.cpp
@@ -11,10 +11,7 @@
* ------------------------------- */
CFFL_TextField::CFFL_TextField(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot)
- : CFFL_FormFiller(pApp, pAnnot),
- m_pFontMap(NULL) //,
-// m_pSpellCheck(NULL)
-{
+ : CFFL_FormFiller(pApp, pAnnot), m_pFontMap(NULL) {
m_State.nStart = m_State.nEnd = 0;
}
@@ -25,7 +22,6 @@ CFFL_TextField::~CFFL_TextField() {
PWL_CREATEPARAM CFFL_TextField::GetCreateParam() {
PWL_CREATEPARAM cp = CFFL_FormFiller::GetCreateParam();
- ASSERT(m_pWidget != NULL);
int nFlags = m_pWidget->GetFieldFlags();
if (nFlags & FIELDFLAG_PASSWORD) {
@@ -88,11 +84,9 @@ CPWL_Wnd* CFFL_TextField::NewPDFWindow(const PWL_CREATEPARAM& cp,
pWnd->AttachFFLData(this);
pWnd->Create(cp);
- ASSERT(m_pApp != NULL);
CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller();
pWnd->SetFillerNotify(pIFormFiller);
- ASSERT(m_pWidget != NULL);
int32_t nMaxLen = m_pWidget->GetMaxLen();
CFX_WideString swValue = m_pWidget->GetValue();
@@ -116,7 +110,7 @@ FX_BOOL CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot,
case FWL_VKEY_Return:
if (!(m_pWidget->GetFieldFlags() & FIELDFLAG_MULTILINE)) {
CPDFSDK_PageView* pPageView = GetCurPageView();
- ASSERT(pPageView != NULL);
+ ASSERT(pPageView);
m_bValid = !m_bValid;
CPDF_Rect rcAnnot = pAnnot->GetRect();
m_pApp->FFI_Invalidate(pAnnot->GetUnderlyingPage(), rcAnnot.left,
@@ -136,7 +130,7 @@ FX_BOOL CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot,
break;
case FWL_VKEY_Escape: {
CPDFSDK_PageView* pPageView = GetCurPageView();
- ASSERT(pPageView != NULL);
+ ASSERT(pPageView);
EscapeFiller(pPageView, TRUE);
return TRUE;
}
@@ -146,8 +140,6 @@ FX_BOOL CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot,
}
FX_BOOL CFFL_TextField::IsDataChanged(CPDFSDK_PageView* pPageView) {
- ASSERT(m_pWidget != NULL);
-
if (CPWL_Edit* pEdit = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE))
return pEdit->GetText() != m_pWidget->GetValue();
@@ -155,8 +147,6 @@ FX_BOOL CFFL_TextField::IsDataChanged(CPDFSDK_PageView* pPageView) {
}
void CFFL_TextField::SaveData(CPDFSDK_PageView* pPageView) {
- ASSERT(m_pWidget != NULL);
-
if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE)) {
CFX_WideString sOldValue = m_pWidget->GetValue();
CFX_WideString sNewValue = pWnd->GetText();
@@ -191,7 +181,6 @@ void CFFL_TextField::GetActionData(CPDFSDK_PageView* pPageView,
break;
case CPDF_AAction::LoseFocus:
case CPDF_AAction::GetFocus:
- ASSERT(m_pWidget != NULL);
fa.sValue = m_pWidget->GetValue();
break;
default:
@@ -231,7 +220,7 @@ FX_BOOL CFFL_TextField::IsActionDataChanged(CPDF_AAction::AActionType type,
}
void CFFL_TextField::SaveState(CPDFSDK_PageView* pPageView) {
- ASSERT(pPageView != NULL);
+ ASSERT(pPageView);
if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE)) {
pWnd->GetSel(m_State.nStart, m_State.nEnd);
@@ -240,7 +229,7 @@ void CFFL_TextField::SaveState(CPDFSDK_PageView* pPageView) {
}
void CFFL_TextField::RestoreState(CPDFSDK_PageView* pPageView) {
- ASSERT(pPageView != NULL);
+ ASSERT(pPageView);
if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, TRUE)) {
pWnd->SetText(m_State.sValue.c_str());
@@ -279,10 +268,7 @@ FX_BOOL CFFL_TextField::IsFieldFull(CPDFSDK_PageView* pPageView) {
#endif // PDF_ENABLE_XFA
void CFFL_TextField::OnSetFocus(CPWL_Wnd* pWnd) {
- ASSERT(m_pApp != NULL);
-
- ASSERT(pWnd != NULL);
-
+ ASSERT(m_pApp);
if (pWnd->GetClassName() == PWL_CLASSNAME_EDIT) {
CPWL_Edit* pEdit = (CPWL_Edit*)pWnd;
pEdit->SetCharSet(134);