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

Unified Diff: xfa/fwl/basewidget/fwl_comboboximp.cpp

Issue 2031873003: Get rid of NULLs in xfa/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@nullptr_fpdfsdk
Patch Set: Created 4 years, 6 months 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 | « xfa/fwl/basewidget/fwl_comboboximp.h ('k') | xfa/fwl/basewidget/fwl_datetimepickerimp.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/basewidget/fwl_comboboximp.cpp
diff --git a/xfa/fwl/basewidget/fwl_comboboximp.cpp b/xfa/fwl/basewidget/fwl_comboboximp.cpp
index 8d4ac452f7201342ad3c91cb106405981c8e99b8..4233b41bc7fe476e0a93ca84a3aecb9199723d6f 100644
--- a/xfa/fwl/basewidget/fwl_comboboximp.cpp
+++ b/xfa/fwl/basewidget/fwl_comboboximp.cpp
@@ -199,7 +199,7 @@ void CFWL_ComboEditImp::SetComboBoxFocus(FX_BOOL bSet) {
CFWL_ComboListImp::CFWL_ComboListImp(const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter)
: CFWL_ListBoxImp(properties, pOuter), m_bNotifyOwner(TRUE) {
- ASSERT(pOuter != NULL);
+ ASSERT(pOuter);
}
FWL_Error CFWL_ComboListImp::Initialize() {
if (CFWL_ListBoxImp::Initialize() != FWL_Error::Succeeded)
@@ -303,7 +303,7 @@ void CFWL_ComboListImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {
pMsg->m_fx -= rect.left;
pMsg->m_fy -= rect.top;
IFWL_WidgetDelegate* pDelegate =
- m_pOwner->m_pVertScrollBar->SetDelegate(NULL);
+ m_pOwner->m_pVertScrollBar->SetDelegate(nullptr);
pDelegate->OnProcessMessage(pMsg);
return;
}
@@ -472,7 +472,7 @@ void CFWL_ComboListImpDelegate::OnDropListKeyDown(CFWL_MsgKey* pKey) {
CFWL_ComboBoxImp::CFWL_ComboBoxImp(const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter)
: CFWL_WidgetImp(properties, pOuter),
- m_pForm(NULL),
+ m_pForm(nullptr),
m_bLButtonDown(FALSE),
m_iCurSel(-1),
m_iBtnState(CFWL_PartState_Normal),
@@ -587,9 +587,9 @@ FWL_Error CFWL_ComboBoxImp::Update() {
if (bDropDown && m_pEdit) {
ReSetEditAlignment();
}
- if (m_pProperties->m_pThemeProvider == NULL) {
+ if (!m_pProperties->m_pThemeProvider)
m_pProperties->m_pThemeProvider = GetAvailableTheme();
- }
+
Layout();
CFWL_ThemePart part;
part.m_pWidget = m_pInterface;
@@ -638,9 +638,8 @@ FWL_Error CFWL_ComboBoxImp::DrawWidget(CFX_Graphics* pGraphics,
->m_pProperties->m_pDataProvider);
void* p = pData->GetItemData(m_pListBox.get(),
pData->GetItem(m_pListBox.get(), m_iCurSel));
- if (p != NULL) {
+ if (p)
param.m_pData = p;
- }
}
if (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) {
param.m_dwStates = CFWL_PartState_Disabled;
@@ -873,11 +872,9 @@ FWL_Error CFWL_ComboBoxImp::GetBBox(CFX_RectF& rect) {
}
FWL_Error CFWL_ComboBoxImp::EditModifyStylesEx(uint32_t dwStylesExAdded,
uint32_t dwStylesExRemoved) {
- if (m_pEdit != NULL) {
+ if (m_pEdit)
return m_pEdit->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved);
- } else {
- return FWL_Error::ParameterInvalid;
- }
+ return FWL_Error::ParameterInvalid;
}
FX_FLOAT CFWL_ComboBoxImp::GetListHeight() {
return static_cast<IFWL_ComboBoxDP*>(m_pProperties->m_pDataProvider)
@@ -938,7 +935,7 @@ void CFWL_ComboBoxImp::ShowDropList(FX_BOOL bActivate) {
if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_ListDrag) {
FX_FLOAT fx = 0;
FX_FLOAT fy = m_rtClient.top + m_rtClient.height / 2;
- TransformTo(NULL, fx, fy);
+ TransformTo(nullptr, fx, fy);
m_bUpFormHandler = fy > m_rtProxy.top;
if (m_bUpFormHandler) {
m_rtHandler.Set(0, 0, m_rtList.width, m_fComboFormHandler);
@@ -1598,7 +1595,7 @@ void CFWL_ComboBoxImpDelegate::DoSubCtrlKey(CFWL_MsgKey* pMsg) {
}
FX_BOOL bDropDown = m_pOwner->IsDropDownStyle();
if (bDropDown) {
- IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(NULL);
+ IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(nullptr);
pDelegate->OnProcessMessage(pMsg);
}
}
@@ -1649,7 +1646,7 @@ void CFWL_ComboBoxImpDelegate::DisForm_OnProcessMessage(
pKey->m_dwKeyCode == FWL_VKEY_Escape;
if (bListKey) {
IFWL_WidgetDelegate* pDelegate =
- m_pOwner->m_pListBox->SetDelegate(NULL);
+ m_pOwner->m_pListBox->SetDelegate(nullptr);
pDelegate->OnProcessMessage(pMessage);
break;
}
@@ -1688,17 +1685,17 @@ void CFWL_ComboBoxImpDelegate::DisForm_OnFocusChanged(CFWL_Message* pMsg,
if ((m_pOwner->m_pEdit->GetStates() & FWL_WGTSTATE_Focused) == 0) {
CFWL_MsgSetFocus msg;
msg.m_pDstTarget = m_pOwner->m_pEdit.get();
- msg.m_pSrcTarget = NULL;
- IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(NULL);
+ msg.m_pSrcTarget = nullptr;
+ IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(nullptr);
pDelegate->OnProcessMessage(&msg);
}
} else {
m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused;
m_pOwner->DisForm_ShowDropList(FALSE);
CFWL_MsgKillFocus msg;
- msg.m_pDstTarget = NULL;
+ msg.m_pDstTarget = nullptr;
msg.m_pSrcTarget = m_pOwner->m_pEdit.get();
- IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(NULL);
+ IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(nullptr);
pDelegate->OnProcessMessage(&msg);
}
}
@@ -1743,7 +1740,7 @@ void CFWL_ComboBoxImpDelegate::DisForm_OnKey(CFWL_MsgKey* pMsg) {
return;
}
if (m_pOwner->m_pEdit) {
- IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(NULL);
+ IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(nullptr);
pDelegate->OnProcessMessage(pMsg);
}
}
@@ -1851,9 +1848,8 @@ void CFWL_ComboProxyImpDelegate::OnDeactive(CFWL_MsgDeactivate* pMsg) {
}
void CFWL_ComboProxyImpDelegate::OnFocusChanged(CFWL_MsgKillFocus* pMsg,
FX_BOOL bSet) {
- if (!bSet) {
- if (pMsg->m_pSetFocus == NULL) {
- m_pComboBox->ShowDropList(FALSE);
- }
- }
+ if (bSet)
+ return;
+ if (!pMsg->m_pSetFocus)
+ m_pComboBox->ShowDropList(FALSE);
}
« no previous file with comments | « xfa/fwl/basewidget/fwl_comboboximp.h ('k') | xfa/fwl/basewidget/fwl_datetimepickerimp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698