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

Unified Diff: xfa/fde/cfde_txtedtpage.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/fde/cfde_txtedtengine.cpp ('k') | xfa/fde/cfde_txtedtparag.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fde/cfde_txtedtpage.cpp
diff --git a/xfa/fde/cfde_txtedtpage.cpp b/xfa/fde/cfde_txtedtpage.cpp
index 9ab5386e496788b3841d0c37afc181dab0abb2eb..b8c547fadded5925a0f7dfa23a6629b734bee8b1 100644
--- a/xfa/fde/cfde_txtedtpage.cpp
+++ b/xfa/fde/cfde_txtedtpage.cpp
@@ -138,7 +138,7 @@ int32_t CFDE_TxtEdtPage::GetCharIndex(const CFX_PointF& fPoint,
}
NormalizePt2Rect(ptF, rtLine, kTolerance);
int32_t nCaret = 0;
- FDE_TEXTEDITPIECE* pPiece = NULL;
+ FDE_TEXTEDITPIECE* pPiece = nullptr;
for (i = nBgn; i <= nEnd; i++) {
pPiece = m_PieceMassArr.GetPtrAt(i);
nCaret = m_nPageStart + pPiece->nStart;
@@ -193,7 +193,7 @@ int32_t CFDE_TxtEdtPage::GetDisplayPos(const CFX_RectF& rtClip,
CFX_RectF* pBBox) const {
pCharPos = FX_Alloc(FXTEXT_CHARPOS, m_nCharCount);
int32_t nCharPosCount = 0;
- FDE_HVISUALOBJ hVisualObj = NULL;
+ FDE_HVISUALOBJ hVisualObj = nullptr;
int32_t nVisualObjCount = m_PieceMassArr.GetSize();
FXTEXT_CHARPOS* pos = pCharPos;
CFX_RectF rtObj;
@@ -323,15 +323,12 @@ int32_t CFDE_TxtEdtPage::LoadPage(const CFX_RectF* pClipBox,
FX_FLOAT fLineStep =
(bVertial && bLineReserve) ? (-pParams->fLineSpace) : pParams->fLineSpace;
FX_FLOAT fLinePos = fLineStart;
- if (m_pTextSet == NULL) {
+ if (!m_pTextSet)
m_pTextSet = new CFDE_TxtEdtTextSet(this);
- }
m_PieceMassArr.RemoveAll(TRUE);
uint32_t dwBreakStatus = FX_TXTBREAK_None;
int32_t nPieceStart = 0;
- if (m_pCharWidth != NULL) {
- delete[] m_pCharWidth;
- }
+ delete[] m_pCharWidth;
m_pCharWidth = new int32_t[nPageEnd - nPageStart + 1];
pBreak->EndBreak(FX_TXTBREAK_ParagraphBreak);
pBreak->ClearBreakPieces();
@@ -486,7 +483,7 @@ const CFX_RectF& CFDE_TxtEdtPage::GetContentsBox() {
FX_POSITION CFDE_TxtEdtPage::GetFirstPosition(FDE_HVISUALOBJ hCanvas) {
if (m_PieceMassArr.GetSize() < 1) {
- return NULL;
+ return nullptr;
}
return (FX_POSITION)1;
}
@@ -494,14 +491,14 @@ FX_POSITION CFDE_TxtEdtPage::GetFirstPosition(FDE_HVISUALOBJ hCanvas) {
FDE_HVISUALOBJ CFDE_TxtEdtPage::GetNext(FDE_HVISUALOBJ hCanvas,
FX_POSITION& pos,
IFDE_VisualSet*& pVisualSet) {
- if (m_pTextSet == NULL) {
- pos = NULL;
- return NULL;
+ if (!m_pTextSet) {
+ pos = nullptr;
+ return nullptr;
}
int32_t nPos = (int32_t)(uintptr_t)pos;
pVisualSet = m_pTextSet;
if (nPos + 1 > m_PieceMassArr.GetSize()) {
- pos = NULL;
+ pos = nullptr;
} else {
pos = (FX_POSITION)(uintptr_t)(nPos + 1);
}
@@ -510,7 +507,7 @@ FDE_HVISUALOBJ CFDE_TxtEdtPage::GetNext(FDE_HVISUALOBJ hCanvas,
FDE_HVISUALOBJ CFDE_TxtEdtPage::GetParentCanvas(FDE_HVISUALOBJ hCanvas,
IFDE_VisualSet*& pVisualSet) {
- return NULL;
+ return nullptr;
}
FX_WCHAR CFDE_TxtEdtPage::GetChar(void* pIdentity, int32_t index) const {
« no previous file with comments | « xfa/fde/cfde_txtedtengine.cpp ('k') | xfa/fde/cfde_txtedtparag.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698