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

Unified Diff: fpdfsdk/fsdk_annothandler.cpp

Issue 2031653003: Get rid of NULLs in fpdfsdk/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@nullptr_core
Patch Set: rebase 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 | « fpdfsdk/fsdk_actionhandler.cpp ('k') | fpdfsdk/fsdk_baseannot.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fsdk_annothandler.cpp
diff --git a/fpdfsdk/fsdk_annothandler.cpp b/fpdfsdk/fsdk_annothandler.cpp
index cbcb53e1691a863b3c98115f7cef1c53d9a9ab80..eda3b49058034dccaba177dafcf5ac2c9a123e3e 100644
--- a/fpdfsdk/fsdk_annothandler.cpp
+++ b/fpdfsdk/fsdk_annothandler.cpp
@@ -88,7 +88,7 @@ CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::NewAnnot(CXFA_FFWidget* pAnnot,
return pAnnotHandler->NewAnnot(pAnnot, pPageView);
}
- return NULL;
+ return nullptr;
}
#endif // PDF_ENABLE_XFA
@@ -367,8 +367,8 @@ CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::GetNextAnnot(CPDFSDK_Annot* pSDKAnnot,
#ifdef PDF_ENABLE_XFA
CPDFSDK_PageView* pPageView = pSDKAnnot->GetPageView();
CPDFXFA_Page* pPage = pPageView->GetPDFXFAPage();
- if (pPage == NULL)
- return NULL;
+ if (!pPage)
+ return nullptr;
if (pPage->GetPDFPage()) { // for pdf annots.
CBA_AnnotIterator ai(pSDKAnnot->GetPageView(), pSDKAnnot->GetType(), "");
CPDFSDK_Annot* pNext =
@@ -441,7 +441,7 @@ CPDFSDK_Annot* CPDFSDK_BFAnnotHandler::NewAnnot(CPDF_Annot* pAnnot,
#ifdef PDF_ENABLE_XFA
CPDFSDK_Annot* CPDFSDK_BFAnnotHandler::NewAnnot(CXFA_FFWidget* hWidget,
CPDFSDK_PageView* pPage) {
- return NULL;
+ return nullptr;
}
#endif // PDF_ENABLE_XFA
@@ -653,7 +653,7 @@ void CPDFSDK_BFAnnotHandler::OnLoad(CPDFSDK_Annot* pAnnot) {
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
if (!pWidget->IsAppearanceValid())
- pWidget->ResetAppearance(NULL, FALSE);
+ pWidget->ResetAppearance(nullptr, FALSE);
int nFieldType = pWidget->GetFieldType();
if (nFieldType == FIELDTYPE_TEXTFIELD || nFieldType == FIELDTYPE_COMBOBOX) {
@@ -736,7 +736,7 @@ CPDFSDK_Annot* CPDFSDK_XFAAnnotHandler::NewAnnot(CXFA_FFWidget* pAnnot,
}
FX_BOOL CPDFSDK_XFAAnnotHandler::CanAnswer(CPDFSDK_Annot* pAnnot) {
- return pAnnot->GetXFAWidget() != NULL;
+ return !!pAnnot->GetXFAWidget();
}
void CPDFSDK_XFAAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView,
@@ -744,8 +744,8 @@ void CPDFSDK_XFAAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView,
CFX_RenderDevice* pDevice,
CFX_Matrix* pUser2Device,
uint32_t dwFlags) {
- ASSERT(pPageView != NULL);
- ASSERT(pAnnot != NULL);
+ ASSERT(pPageView);
+ ASSERT(pAnnot);
CPDFSDK_Document* pSDKDoc = pPageView->GetSDKDocument();
CXFA_FFWidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
@@ -982,7 +982,7 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot,
FX_BOOL CPDFSDK_XFAAnnotHandler::OnXFAChangedFocus(CPDFSDK_Annot* pOldAnnot,
CPDFSDK_Annot* pNewAnnot) {
- CXFA_FFWidgetHandler* pWidgetHandler = NULL;
+ CXFA_FFWidgetHandler* pWidgetHandler = nullptr;
if (pOldAnnot)
pWidgetHandler = GetXFAWidgetHandler(pOldAnnot);
@@ -991,7 +991,7 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnXFAChangedFocus(CPDFSDK_Annot* pOldAnnot,
if (pWidgetHandler) {
FX_BOOL bRet = TRUE;
- CXFA_FFWidget* hWidget = pNewAnnot ? pNewAnnot->GetXFAWidget() : NULL;
+ CXFA_FFWidget* hWidget = pNewAnnot ? pNewAnnot->GetXFAWidget() : nullptr;
if (hWidget) {
CXFA_FFPageView* pXFAPageView = hWidget->GetPageView();
if (pXFAPageView) {
@@ -1009,23 +1009,23 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnXFAChangedFocus(CPDFSDK_Annot* pOldAnnot,
CXFA_FFWidgetHandler* CPDFSDK_XFAAnnotHandler::GetXFAWidgetHandler(
CPDFSDK_Annot* pAnnot) {
if (!pAnnot)
- return NULL;
+ return nullptr;
CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
if (!pPageView)
- return NULL;
+ return nullptr;
CPDFSDK_Document* pSDKDoc = pPageView->GetSDKDocument();
if (!pSDKDoc)
- return NULL;
+ return nullptr;
CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument();
if (!pDoc)
- return NULL;
+ return nullptr;
CXFA_FFDocView* pDocView = pDoc->GetXFADocView();
if (!pDocView)
- return NULL;
+ return nullptr;
return pDocView->GetWidgetHandler();
}
« no previous file with comments | « fpdfsdk/fsdk_actionhandler.cpp ('k') | fpdfsdk/fsdk_baseannot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698