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

Unified Diff: xfa/fwl/lightwidget/cfwl_listbox.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/lightwidget/cfwl_listbox.h ('k') | xfa/fwl/lightwidget/cfwl_picturebox.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/lightwidget/cfwl_listbox.cpp
diff --git a/xfa/fwl/lightwidget/cfwl_listbox.cpp b/xfa/fwl/lightwidget/cfwl_listbox.cpp
index d51db44f3b96669ce299a6a0b7a41c83497389ed..e1f12b520be332feca27013f552bd70a1280fa70 100644
--- a/xfa/fwl/lightwidget/cfwl_listbox.cpp
+++ b/xfa/fwl/lightwidget/cfwl_listbox.cpp
@@ -81,7 +81,7 @@ int32_t CFWL_ListBox::CountSelItems() {
IFWL_ListItem* CFWL_ListBox::GetSelItem(int32_t nIndexSel) {
if (!m_pIface)
- return NULL;
+ return nullptr;
return static_cast<IFWL_ListBox*>(m_pIface)->GetSelItem(nIndexSel);
}
@@ -164,9 +164,7 @@ FWL_Error CFWL_ListBox::SetItemData(IFWL_ListItem* pItem, void* pData) {
}
void* CFWL_ListBox::GetItemData(IFWL_ListItem* pItem) {
- if (!pItem)
- return NULL;
- return static_cast<CFWL_ListItem*>(pItem)->m_pData;
+ return pItem ? static_cast<CFWL_ListItem*>(pItem)->m_pData : nullptr;
}
IFWL_ListItem* CFWL_ListBox::GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy) {
@@ -178,20 +176,20 @@ IFWL_ListItem* CFWL_ListBox::GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy) {
FX_FLOAT fPosY = 0;
static_cast<IFWL_ListBox*>(m_pIface)->GetScrollPos(fx);
static_cast<IFWL_ListBox*>(m_pIface)->GetScrollPos(fy, FALSE);
- int32_t nCount = m_ListBoxDP.CountItems(NULL);
+ int32_t nCount = m_ListBoxDP.CountItems(nullptr);
for (int32_t i = 0; i < nCount; i++) {
- IFWL_ListItem* pItem = m_ListBoxDP.GetItem(NULL, i);
- if (!pItem) {
+ IFWL_ListItem* pItem = m_ListBoxDP.GetItem(nullptr, i);
+ if (!pItem)
continue;
- }
+
CFX_RectF rtItem;
- m_ListBoxDP.GetItemRect(NULL, pItem, rtItem);
+ m_ListBoxDP.GetItemRect(nullptr, pItem, rtItem);
rtItem.Offset(-fPosX, -fPosY);
if (rtItem.Contains(fx, fy)) {
return pItem;
}
}
- return NULL;
+ return nullptr;
}
uint32_t CFWL_ListBox::GetItemStates(IFWL_ListItem* pItem) {
@@ -273,9 +271,7 @@ FWL_Error CFWL_ListBox::CFWL_ListBoxDP::GetItemRect(IFWL_Widget* pWidget,
void* CFWL_ListBox::CFWL_ListBoxDP::GetItemData(IFWL_Widget* pWidget,
IFWL_ListItem* pItem) {
- if (!pItem)
- return NULL;
- return static_cast<CFWL_ListItem*>(pItem)->m_pData;
+ return pItem ? static_cast<CFWL_ListItem*>(pItem)->m_pData : nullptr;
}
FWL_Error CFWL_ListBox::CFWL_ListBoxDP::SetItemStyles(IFWL_Widget* pWidget,
« no previous file with comments | « xfa/fwl/lightwidget/cfwl_listbox.h ('k') | xfa/fwl/lightwidget/cfwl_picturebox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698