summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/formfiller
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
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')
-rw-r--r--fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp2
-rw-r--r--fpdfsdk/src/formfiller/FFL_CheckBox.cpp18
-rw-r--r--fpdfsdk/src/formfiller/FFL_ComboBox.cpp18
-rw-r--r--fpdfsdk/src/formfiller/FFL_FormFiller.cpp22
-rw-r--r--fpdfsdk/src/formfiller/FFL_IFormFiller.cpp95
-rw-r--r--fpdfsdk/src/formfiller/FFL_ListBox.cpp8
-rw-r--r--fpdfsdk/src/formfiller/FFL_RadioButton.cpp11
-rw-r--r--fpdfsdk/src/formfiller/FFL_TextField.cpp26
8 files changed, 44 insertions, 156 deletions
diff --git a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp
index 97b061f56a..743c90e817 100644
--- a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp
+++ b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp
@@ -14,8 +14,6 @@ CBA_FontMap::CBA_FontMap(CPDFSDK_Annot* pAnnot,
m_pAnnotDict(NULL),
m_pDefaultFont(NULL),
m_sAPType("N") {
- ASSERT(pAnnot != NULL);
-
CPDF_Page* pPage = pAnnot->GetPDFPage();
m_pDocument = pPage->m_pDocument;
diff --git a/fpdfsdk/src/formfiller/FFL_CheckBox.cpp b/fpdfsdk/src/formfiller/FFL_CheckBox.cpp
index b0fc906f98..0129707340 100644
--- a/fpdfsdk/src/formfiller/FFL_CheckBox.cpp
+++ b/fpdfsdk/src/formfiller/FFL_CheckBox.cpp
@@ -20,10 +20,7 @@ CPWL_Wnd* CFFL_CheckBox::NewPDFWindow(const PWL_CREATEPARAM& cp,
CPDFSDK_PageView* pPageView) {
CPWL_CheckBox* pWnd = new CPWL_CheckBox();
pWnd->Create(cp);
-
- ASSERT(m_pWidget != NULL);
pWnd->SetCheck(m_pWidget->IsChecked());
-
return pWnd;
}
@@ -45,10 +42,10 @@ FX_BOOL CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot,
case FWL_VKEY_Return:
case FWL_VKEY_Space: {
CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller();
- ASSERT(pIFormFiller != NULL);
+ ASSERT(pIFormFiller);
CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
- ASSERT(pPageView != NULL);
+ ASSERT(pPageView);
FX_BOOL bReset = FALSE;
FX_BOOL bExit = FALSE;
@@ -94,18 +91,11 @@ FX_BOOL CFFL_CheckBox::OnLButtonUp(CPDFSDK_PageView* pPageView,
}
FX_BOOL CFFL_CheckBox::IsDataChanged(CPDFSDK_PageView* pPageView) {
- ASSERT(m_pWidget != NULL);
-
- if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, FALSE)) {
- return pWnd->IsChecked() != m_pWidget->IsChecked();
- }
-
- return FALSE;
+ CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, FALSE);
+ return pWnd && pWnd->IsChecked() != m_pWidget->IsChecked();
}
void CFFL_CheckBox::SaveData(CPDFSDK_PageView* pPageView) {
- ASSERT(m_pWidget != NULL);
-
if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, FALSE)) {
FX_BOOL bNewChecked = pWnd->IsChecked();
diff --git a/fpdfsdk/src/formfiller/FFL_ComboBox.cpp b/fpdfsdk/src/formfiller/FFL_ComboBox.cpp
index 84992ae5c5..8d801c8352 100644
--- a/fpdfsdk/src/formfiller/FFL_ComboBox.cpp
+++ b/fpdfsdk/src/formfiller/FFL_ComboBox.cpp
@@ -27,10 +27,7 @@ CFFL_ComboBox::~CFFL_ComboBox() {
PWL_CREATEPARAM CFFL_ComboBox::GetCreateParam() {
PWL_CREATEPARAM cp = CFFL_FormFiller::GetCreateParam();
- ASSERT(m_pWidget != NULL);
-
int nFlags = m_pWidget->GetFieldFlags();
-
if (nFlags & FIELDFLAG_EDIT) {
cp.dwFlags |= PCBS_ALLOWCUSTOMTEXT;
}
@@ -93,8 +90,6 @@ FX_BOOL CFFL_ComboBox::IsDataChanged(CPDFSDK_PageView* pPageView) {
}
void CFFL_ComboBox::SaveData(CPDFSDK_PageView* pPageView) {
- ASSERT(m_pWidget != NULL);
-
if (CPWL_ComboBox* pWnd = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE)) {
CFX_WideString swText = pWnd->GetText();
int32_t nCurSel = pWnd->GetSelect();
@@ -165,7 +160,6 @@ void CFFL_ComboBox::GetActionData(CPDFSDK_PageView* pPageView,
break;
case CPDF_AAction::LoseFocus:
case CPDF_AAction::GetFocus:
- ASSERT(m_pWidget != NULL);
fa.sValue = m_pWidget->GetValue();
break;
default:
@@ -207,7 +201,7 @@ FX_BOOL CFFL_ComboBox::IsActionDataChanged(CPDF_AAction::AActionType type,
}
void CFFL_ComboBox::SaveState(CPDFSDK_PageView* pPageView) {
- ASSERT(pPageView != NULL);
+ ASSERT(pPageView);
if (CPWL_ComboBox* pComboBox =
static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, FALSE))) {
@@ -221,7 +215,7 @@ void CFFL_ComboBox::SaveState(CPDFSDK_PageView* pPageView) {
}
void CFFL_ComboBox::RestoreState(CPDFSDK_PageView* pPageView) {
- ASSERT(pPageView != NULL);
+ ASSERT(pPageView);
if (CPWL_ComboBox* pComboBox =
static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, TRUE))) {
@@ -268,9 +262,7 @@ FX_BOOL CFFL_ComboBox::IsFieldFull(CPDFSDK_PageView* pPageView) {
#endif // PDF_ENABLE_XFA
void CFFL_ComboBox::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;
@@ -290,11 +282,11 @@ void CFFL_ComboBox::OnSetFocus(CPWL_Wnd* pWnd) {
}
void CFFL_ComboBox::OnKillFocus(CPWL_Wnd* pWnd) {
- ASSERT(m_pApp != NULL);
+ ASSERT(m_pApp);
}
void CFFL_ComboBox::OnAddUndo(CPWL_Edit* pEdit) {
- ASSERT(pEdit != NULL);
+ ASSERT(pEdit);
}
CFX_WideString CFFL_ComboBox::GetSelectExportText() {
diff --git a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp
index 8b030a51a2..0e74d91fab 100644
--- a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp
+++ b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp
@@ -49,8 +49,8 @@ CPDF_Rect CFFL_FormFiller::GetWindowRect(CPDFSDK_PageView* pPageView) {
FX_RECT CFFL_FormFiller::GetViewBBox(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot) {
- ASSERT(pPageView != NULL);
- ASSERT(pAnnot != NULL);
+ ASSERT(pPageView);
+ ASSERT(pAnnot);
CPDF_Rect rcAnnot = m_pWidget->GetRect();
@@ -109,7 +109,7 @@ void CFFL_FormFiller::OnMouseEnter(CPDFSDK_PageView* pPageView,
void CFFL_FormFiller::OnMouseExit(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot) {
EndTimer();
- ASSERT(m_pWidget != NULL);
+ ASSERT(m_pWidget);
}
FX_BOOL CFFL_FormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView,
@@ -216,7 +216,7 @@ FX_BOOL CFFL_FormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot,
FX_UINT nFlags) {
if (IsValid()) {
CPDFSDK_PageView* pPageView = GetCurPageView();
- ASSERT(pPageView != NULL);
+ ASSERT(pPageView);
if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) {
return pWnd->OnKeyDown(nKeyCode, nFlags);
@@ -231,7 +231,7 @@ FX_BOOL CFFL_FormFiller::OnChar(CPDFSDK_Annot* pAnnot,
FX_UINT nFlags) {
if (IsValid()) {
CPDFSDK_PageView* pPageView = GetCurPageView();
- ASSERT(pPageView != NULL);
+ ASSERT(pPageView);
if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) {
return pWnd->OnChar(nChar, nFlags);
@@ -284,7 +284,7 @@ FX_BOOL CFFL_FormFiller::IsValid() const {
}
PWL_CREATEPARAM CFFL_FormFiller::GetCreateParam() {
- ASSERT(m_pApp != NULL);
+ ASSERT(m_pApp);
PWL_CREATEPARAM cp;
cp.pParentWnd = NULL;
@@ -415,8 +415,6 @@ CFX_Matrix CFFL_FormFiller::GetWindowMatrix(void* pAttachedData) {
CFX_Matrix CFFL_FormFiller::GetCurMatrix() {
CFX_Matrix mt;
- ASSERT(m_pWidget != NULL);
-
CPDF_Rect rcDA;
m_pWidget->GetPDFAnnot()->GetRect(rcDA);
@@ -443,7 +441,7 @@ CFX_Matrix CFFL_FormFiller::GetCurMatrix() {
}
CFX_WideString CFFL_FormFiller::LoadPopupMenuString(int nIndex) {
- ASSERT(m_pApp != NULL);
+ ASSERT(m_pApp);
return L"";
}
@@ -643,7 +641,7 @@ void CFFL_Button::OnMouseExit(CPDFSDK_PageView* pPageView,
FX_RECT rect = GetViewBBox(pPageView, pAnnot);
InvalidateRect(rect.left, rect.top, rect.right, rect.bottom);
EndTimer();
- ASSERT(m_pWidget != NULL);
+ ASSERT(m_pWidget);
}
FX_BOOL CFFL_Button::OnLButtonDown(CPDFSDK_PageView* pPageView,
@@ -681,7 +679,7 @@ FX_BOOL CFFL_Button::OnMouseMove(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
const CPDF_Point& point) {
- ASSERT(m_pApp != NULL);
+ ASSERT(m_pApp);
return TRUE;
}
@@ -691,7 +689,7 @@ void CFFL_Button::OnDraw(CPDFSDK_PageView* pPageView,
CFX_RenderDevice* pDevice,
CFX_Matrix* pUser2Device,
FX_DWORD dwFlags) {
- ASSERT(pPageView != NULL);
+ ASSERT(pPageView);
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
CPDF_FormControl* pCtrl = pWidget->GetFormControl();
CPDF_FormControl::HighlightingMode eHM = pCtrl->GetHighlightingMode();
diff --git a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
index 352097d2ff..b8893e872f 100644
--- a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
+++ b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
@@ -15,12 +15,6 @@
#define FFL_MAXLISTBOXHEIGHT 140.0f
-// HHOOK CFFL_IFormFiller::m_hookSheet = NULL;
-// MSG CFFL_IFormFiller::g_Msg;
-
-/* ----------------------------- CFFL_IFormFiller -----------------------------
- */
-
CFFL_IFormFiller::CFFL_IFormFiller(CPDFDoc_Environment* pApp)
: m_pApp(pApp), m_bNotifying(FALSE) {}
@@ -44,7 +38,7 @@ FX_RECT CFFL_IFormFiller::GetViewBBox(CPDFSDK_PageView* pPageView,
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
return pFormFiller->GetViewBBox(pPageView, pAnnot);
- ASSERT(pPageView != NULL);
+ ASSERT(pPageView);
CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot();
CPDF_Rect rcAnnot;
@@ -55,11 +49,11 @@ FX_RECT CFFL_IFormFiller::GetViewBBox(CPDFSDK_PageView* pPageView,
}
void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView,
- /*HDC hDC,*/ CPDFSDK_Annot* pAnnot,
+ CPDFSDK_Annot* pAnnot,
CFX_RenderDevice* pDevice,
CFX_Matrix* pUser2Device,
- /*const CRect& rcWindow,*/ FX_DWORD dwFlags) {
- ASSERT(pPageView != NULL);
+ FX_DWORD dwFlags) {
+ ASSERT(pPageView);
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
if (IsVisible(pWidget)) {
@@ -127,7 +121,6 @@ void CFFL_IFormFiller::OnDelete(CPDFSDK_Annot* pAnnot) {
void CFFL_IFormFiller::OnMouseEnter(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlag) {
- ASSERT(pAnnot != NULL);
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
if (!m_bNotifying) {
@@ -139,7 +132,7 @@ void CFFL_IFormFiller::OnMouseEnter(CPDFSDK_PageView* pPageView,
pWidget->ClearAppModified();
- ASSERT(pPageView != NULL);
+ ASSERT(pPageView);
PDFSDK_FieldAction fa;
fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
@@ -147,8 +140,6 @@ void CFFL_IFormFiller::OnMouseEnter(CPDFSDK_PageView* pPageView,
pWidget->OnAAction(CPDF_AAction::CursorEnter, fa, pPageView);
m_bNotifying = FALSE;
- // if ( !IsValidAnnot(pPageView, pAnnot) ) return;
-
if (pWidget->IsAppModified()) {
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) {
pFormFiller->ResetPDFWindow(pPageView,
@@ -166,7 +157,6 @@ void CFFL_IFormFiller::OnMouseEnter(CPDFSDK_PageView* pPageView,
void CFFL_IFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlag) {
- ASSERT(pAnnot != NULL);
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
if (!m_bNotifying) {
@@ -177,7 +167,7 @@ void CFFL_IFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView,
int nValueAge = pWidget->GetValueAge();
pWidget->ClearAppModified();
- ASSERT(pPageView != NULL);
+ ASSERT(pPageView);
PDFSDK_FieldAction fa;
fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
@@ -186,8 +176,6 @@ void CFFL_IFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView,
pWidget->OnAAction(CPDF_AAction::CursorExit, fa, pPageView);
m_bNotifying = FALSE;
- // if (!IsValidAnnot(pPageView, pAnnot)) return;
-
if (pWidget->IsAppModified()) {
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) {
pFormFiller->ResetPDFWindow(pPageView,
@@ -206,7 +194,6 @@ FX_BOOL CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
const CPDF_Point& point) {
- ASSERT(pAnnot != NULL);
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
if (!m_bNotifying) {
@@ -218,7 +205,7 @@ FX_BOOL CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView,
int nValueAge = pWidget->GetValueAge();
pWidget->ClearAppModified();
- ASSERT(pPageView != NULL);
+ ASSERT(pPageView);
PDFSDK_FieldAction fa;
fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlags);
@@ -291,7 +278,7 @@ void CFFL_IFormFiller::OnButtonUp(CPDFSDK_Widget* pWidget,
FX_BOOL& bReset,
FX_BOOL& bExit,
FX_UINT nFlag) {
- ASSERT(pWidget != NULL);
+ ASSERT(pWidget);
if (!m_bNotifying) {
if (pWidget->GetAAction(CPDF_AAction::ButtonUp)) {
@@ -299,9 +286,7 @@ void CFFL_IFormFiller::OnButtonUp(CPDFSDK_Widget* pWidget,
int nAge = pWidget->GetAppearanceAge();
int nValueAge = pWidget->GetValueAge();
- ASSERT(pPageView != NULL);
- // CReader_DocView* pDocView = pPageView->GetDocView();
- // ASSERT(pDocView != NULL);
+ ASSERT(pPageView);
PDFSDK_FieldAction fa;
fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
@@ -331,7 +316,6 @@ FX_BOOL CFFL_IFormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
const CPDF_Point& point) {
- ASSERT(pAnnot != NULL);
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
@@ -345,7 +329,6 @@ FX_BOOL CFFL_IFormFiller::OnMouseMove(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
const CPDF_Point& point) {
- ASSERT(pAnnot != NULL);
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
// change cursor
@@ -361,7 +344,6 @@ FX_BOOL CFFL_IFormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView,
FX_UINT nFlags,
short zDelta,
const CPDF_Point& point) {
- ASSERT(pAnnot != NULL);
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
@@ -375,7 +357,6 @@ FX_BOOL CFFL_IFormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
const CPDF_Point& point) {
- ASSERT(pAnnot != NULL);
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
@@ -389,7 +370,6 @@ FX_BOOL CFFL_IFormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
const CPDF_Point& point) {
- ASSERT(pAnnot != NULL);
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
@@ -402,7 +382,6 @@ FX_BOOL CFFL_IFormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView,
FX_BOOL CFFL_IFormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot,
FX_UINT nKeyCode,
FX_UINT nFlags) {
- ASSERT(pAnnot != NULL);
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
@@ -441,7 +420,7 @@ FX_BOOL CFFL_IFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) {
pWidget->ClearAppModified();
CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
- ASSERT(pPageView != NULL);
+ ASSERT(pPageView);
PDFSDK_FieldAction fa;
fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
@@ -484,7 +463,7 @@ FX_BOOL CFFL_IFormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) {
pWidget->ClearAppModified();
CPDFSDK_PageView* pPageView = pWidget->GetPageView();
- ASSERT(pPageView != NULL);
+ ASSERT(pPageView);
PDFSDK_FieldAction fa;
fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
@@ -506,10 +485,7 @@ FX_BOOL CFFL_IFormFiller::IsVisible(CPDFSDK_Widget* pWidget) {
}
FX_BOOL CFFL_IFormFiller::IsReadOnly(CPDFSDK_Widget* pWidget) {
- ASSERT(pWidget != NULL);
-
int nFieldFlags = pWidget->GetFieldFlags();
-
return (nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY;
}
@@ -589,8 +565,6 @@ void CFFL_IFormFiller::QueryWherePopup(void* pPrivateData,
FX_FLOAT fPopupMax,
int32_t& nRet,
FX_FLOAT& fPopupRet) {
- ASSERT(pPrivateData != NULL);
-
CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
CPDF_Rect rcPageView(0, 0, 0, 0);
@@ -598,7 +572,6 @@ void CFFL_IFormFiller::QueryWherePopup(void* pPrivateData,
rcPageView.bottom = pData->pWidget->GetPDFPage()->GetPageHeight();
rcPageView.Normalize();
- ASSERT(pData->pWidget != NULL);
CPDF_Rect rcAnnot = pData->pWidget->GetRect();
FX_FLOAT fTop = 0.0f;
@@ -665,12 +638,11 @@ void CFFL_IFormFiller::OnKeyStrokeCommit(CPDFSDK_Widget* pWidget,
FX_BOOL& bExit,
FX_DWORD nFlag) {
if (!m_bNotifying) {
- ASSERT(pWidget != NULL);
if (pWidget->GetAAction(CPDF_AAction::KeyStroke)) {
m_bNotifying = TRUE;
pWidget->ClearAppModified();
- ASSERT(pPageView != NULL);
+ ASSERT(pPageView);
PDFSDK_FieldAction fa;
fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
@@ -680,8 +652,6 @@ void CFFL_IFormFiller::OnKeyStrokeCommit(CPDFSDK_Widget* pWidget,
fa.bRC = TRUE;
CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE);
- ASSERT(pFormFiller != NULL);
-
pFormFiller->GetActionData(pPageView, CPDF_AAction::KeyStroke, fa);
pFormFiller->SaveState(pPageView);
@@ -689,9 +659,6 @@ void CFFL_IFormFiller::OnKeyStrokeCommit(CPDFSDK_Widget* pWidget,
pWidget->OnAAction(CPDF_AAction::KeyStroke, fa, pPageView);
bRC = fa.bRC;
- // bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView,
- // pWidget);
-
m_bNotifying = FALSE;
}
}
@@ -703,14 +670,11 @@ void CFFL_IFormFiller::OnValidate(CPDFSDK_Widget* pWidget,
FX_BOOL& bExit,
FX_DWORD nFlag) {
if (!m_bNotifying) {
- ASSERT(pWidget != NULL);
if (pWidget->GetAAction(CPDF_AAction::Validate)) {
m_bNotifying = TRUE;
pWidget->ClearAppModified();
- ASSERT(pPageView != NULL);
- // CReader_DocView* pDocView = pPageView->GetDocView();
- // ASSERT(pDocView != NULL);
+ ASSERT(pPageView);
PDFSDK_FieldAction fa;
fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
@@ -719,8 +683,6 @@ void CFFL_IFormFiller::OnValidate(CPDFSDK_Widget* pWidget,
fa.bRC = TRUE;
CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE);
- ASSERT(pFormFiller != NULL);
-
pFormFiller->GetActionData(pPageView, CPDF_AAction::Validate, fa);
pFormFiller->SaveState(pPageView);
@@ -728,9 +690,6 @@ void CFFL_IFormFiller::OnValidate(CPDFSDK_Widget* pWidget,
pWidget->OnAAction(CPDF_AAction::Validate, fa, pPageView);
bRC = fa.bRC;
- // bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView,
- // pWidget);
-
m_bNotifying = FALSE;
}
}
@@ -741,22 +700,12 @@ void CFFL_IFormFiller::OnCalculate(CPDFSDK_Widget* pWidget,
FX_BOOL& bExit,
FX_DWORD nFlag) {
if (!m_bNotifying) {
- ASSERT(pWidget != NULL);
- ASSERT(pPageView != NULL);
- // CReader_DocView* pDocView = pPageView->GetDocView();
- // ASSERT(pDocView != NULL);
+ ASSERT(pWidget);
CPDFSDK_Document* pDocument = pPageView->GetSDKDocument();
- ASSERT(pDocument != NULL);
-
CPDFSDK_InterForm* pInterForm =
(CPDFSDK_InterForm*)pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
pInterForm->OnCalculate(pWidget->GetFormField());
- // bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView,
- // pWidget);
-
m_bNotifying = FALSE;
}
}
@@ -766,24 +715,15 @@ void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget,
FX_BOOL& bExit,
FX_DWORD nFlag) {
if (!m_bNotifying) {
- ASSERT(pWidget != NULL);
- ASSERT(pPageView != NULL);
- // CReader_DocView* pDocView = pPageView->GetDocView();
- // ASSERT(pDocView != NULL);
+ ASSERT(pWidget);
CPDFSDK_Document* pDocument = pPageView->GetSDKDocument();
- ASSERT(pDocument != NULL);
-
CPDFSDK_InterForm* pInterForm =
(CPDFSDK_InterForm*)pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
FX_BOOL bFormated = FALSE;
CFX_WideString sValue =
pInterForm->OnFormat(pWidget->GetFormField(), bFormated);
- // bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView,
- // pWidget);
-
if (bExit)
return;
@@ -998,12 +938,10 @@ void CFFL_IFormFiller::OnBeforeKeyStroke(void* pPrivateData,
FX_BOOL& bRC,
FX_BOOL& bExit,
FX_DWORD nFlag) {
- ASSERT(pPrivateData != NULL);
CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
- ASSERT(pData->pWidget != NULL);
+ ASSERT(pData->pWidget);
CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE);
- ASSERT(pFormFiller != NULL);
#ifdef PDF_ENABLE_XFA
if (pFormFiller->IsFieldFull(pData->pPageView)) {
@@ -1024,7 +962,6 @@ void CFFL_IFormFiller::OnBeforeKeyStroke(void* pPrivateData,
int nAge = pData->pWidget->GetAppearanceAge();
int nValueAge = pData->pWidget->GetValueAge();
- ASSERT(pData->pPageView != NULL);
CPDFSDK_Document* pDocument = pData->pPageView->GetSDKDocument();
PDFSDK_FieldAction fa;
diff --git a/fpdfsdk/src/formfiller/FFL_ListBox.cpp b/fpdfsdk/src/formfiller/FFL_ListBox.cpp
index 53a7570716..d00bfb12ff 100644
--- a/fpdfsdk/src/formfiller/FFL_ListBox.cpp
+++ b/fpdfsdk/src/formfiller/FFL_ListBox.cpp
@@ -25,7 +25,6 @@ CFFL_ListBox::~CFFL_ListBox() {
PWL_CREATEPARAM CFFL_ListBox::GetCreateParam() {
PWL_CREATEPARAM cp = CFFL_FormFiller::GetCreateParam();
- ASSERT(m_pWidget != NULL);
FX_DWORD dwFieldFlag = m_pWidget->GetFieldFlags();
if (dwFieldFlag & FIELDFLAG_MULTISELECT) {
@@ -52,7 +51,6 @@ CPWL_Wnd* CFFL_ListBox::NewPDFWindow(const PWL_CREATEPARAM& cp,
pWnd->AttachFFLData(this);
pWnd->Create(cp);
- ASSERT(m_pApp != NULL);
CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller();
pWnd->SetFillerNotify(pIFormFiller);
@@ -115,7 +113,7 @@ FX_BOOL CFFL_ListBox::IsDataChanged(CPDFSDK_PageView* pPageView) {
}
void CFFL_ListBox::SaveData(CPDFSDK_PageView* pPageView) {
- ASSERT(m_pWidget != NULL);
+ ASSERT(m_pWidget);
if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE)) {
CFX_IntArray aOldSelect, aNewSelect;
@@ -161,7 +159,6 @@ void CFFL_ListBox::GetActionData(CPDFSDK_PageView* pPageView,
} else {
if (CPWL_ListBox* pListBox =
(CPWL_ListBox*)GetPDFWindow(pPageView, FALSE)) {
- ASSERT(m_pWidget != NULL);
int32_t nCurSel = pListBox->GetCurSel();
if (nCurSel >= 0)
fa.sValue = m_pWidget->GetOptionLabel(nCurSel);
@@ -173,7 +170,6 @@ void CFFL_ListBox::GetActionData(CPDFSDK_PageView* pPageView,
if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT) {
fa.sValue = L"";
} else {
- ASSERT(m_pWidget != NULL);
int32_t nCurSel = m_pWidget->GetSelectedIndex(0);
if (nCurSel >= 0)
fa.sValue = m_pWidget->GetOptionLabel(nCurSel);
@@ -189,7 +185,7 @@ void CFFL_ListBox::SetActionData(CPDFSDK_PageView* pPageView,
const PDFSDK_FieldAction& fa) {}
void CFFL_ListBox::SaveState(CPDFSDK_PageView* pPageView) {
- ASSERT(pPageView != NULL);
+ ASSERT(pPageView);
if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE)) {
for (int32_t i = 0, sz = pListBox->GetCount(); i < sz; i++) {
diff --git a/fpdfsdk/src/formfiller/FFL_RadioButton.cpp b/fpdfsdk/src/formfiller/FFL_RadioButton.cpp
index 572cfeb29a..609e043024 100644
--- a/fpdfsdk/src/formfiller/FFL_RadioButton.cpp
+++ b/fpdfsdk/src/formfiller/FFL_RadioButton.cpp
@@ -22,7 +22,6 @@ CPWL_Wnd* CFFL_RadioButton::NewPDFWindow(const PWL_CREATEPARAM& cp,
CPWL_RadioButton* pWnd = new CPWL_RadioButton();
pWnd->Create(cp);
- ASSERT(m_pWidget != NULL);
pWnd->SetCheck(m_pWidget->IsChecked());
return pWnd;
@@ -47,10 +46,8 @@ FX_BOOL CFFL_RadioButton::OnChar(CPDFSDK_Annot* pAnnot,
case FWL_VKEY_Return:
case FWL_VKEY_Space: {
CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller();
- ASSERT(pIFormFiller != NULL);
-
CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
- ASSERT(pPageView != NULL);
+ ASSERT(pPageView);
FX_BOOL bReset = FALSE;
FX_BOOL bExit = FALSE;
@@ -94,8 +91,6 @@ FX_BOOL CFFL_RadioButton::OnLButtonUp(CPDFSDK_PageView* pPageView,
}
FX_BOOL CFFL_RadioButton::IsDataChanged(CPDFSDK_PageView* pPageView) {
- ASSERT(m_pWidget != NULL);
-
if (CPWL_RadioButton* pWnd =
(CPWL_RadioButton*)GetPDFWindow(pPageView, FALSE)) {
return pWnd->IsChecked() != m_pWidget->IsChecked();
@@ -105,16 +100,12 @@ FX_BOOL CFFL_RadioButton::IsDataChanged(CPDFSDK_PageView* pPageView) {
}
void CFFL_RadioButton::SaveData(CPDFSDK_PageView* pPageView) {
- ASSERT(m_pWidget != NULL);
-
if (CPWL_RadioButton* pWnd =
(CPWL_RadioButton*)GetPDFWindow(pPageView, FALSE)) {
FX_BOOL bNewChecked = pWnd->IsChecked();
if (bNewChecked) {
CPDF_FormField* pField = m_pWidget->GetFormField();
- ASSERT(pField != NULL);
-
for (int32_t i = 0, sz = pField->CountControls(); i < sz; i++) {
if (CPDF_FormControl* pCtrl = pField->GetControl(i)) {
if (pCtrl->IsChecked()) {
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);