Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Unified Diff: fpdfsdk/src/formfiller/FFL_TextField.cpp

Issue 1512763013: Get rid of most instance of 'foo != NULL' (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: nits Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/src/formfiller/FFL_RadioButton.cpp ('k') | fpdfsdk/src/fpdfformfill.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/formfiller/FFL_TextField.cpp
diff --git a/fpdfsdk/src/formfiller/FFL_TextField.cpp b/fpdfsdk/src/formfiller/FFL_TextField.cpp
index 2dc82a892e48e44e96cffa57100f2e031531d3d7..2e67ebf0f320607a02c8d3a8a4d5bab49cbd0395 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());
@@ -269,10 +258,7 @@ CPWL_Wnd* CFFL_TextField::ResetPDFWindow(CPDFSDK_PageView* pPageView,
}
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);
« no previous file with comments | « fpdfsdk/src/formfiller/FFL_RadioButton.cpp ('k') | fpdfsdk/src/fpdfformfill.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698