summaryrefslogtreecommitdiff
path: root/xfa/fde/cfde_txtedtparag.cpp
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-06-10 12:21:53 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-10 12:21:53 -0700
commitcfb77ccb1c057d6beb73f0043e42eee8c4822f84 (patch)
treec71d7097de50879080a237f47b42e22e1d6784db /xfa/fde/cfde_txtedtparag.cpp
parent7f3a15f714c8311b1adb7bdce1ac83c7113af598 (diff)
downloadpdfium-cfb77ccb1c057d6beb73f0043e42eee8c4822f84.tar.xz
Get rid of NULLs in xfa/fde/
Review-Url: https://codereview.chromium.org/2039923004
Diffstat (limited to 'xfa/fde/cfde_txtedtparag.cpp')
-rw-r--r--xfa/fde/cfde_txtedtparag.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/xfa/fde/cfde_txtedtparag.cpp b/xfa/fde/cfde_txtedtparag.cpp
index 63e9a939b5..11015f59fd 100644
--- a/xfa/fde/cfde_txtedtparag.cpp
+++ b/xfa/fde/cfde_txtedtparag.cpp
@@ -17,7 +17,7 @@ CFDE_TxtEdtParag::CFDE_TxtEdtParag(CFDE_TxtEdtEngine* pEngine)
: m_nCharStart(0),
m_nCharCount(0),
m_nLineCount(0),
- m_lpData(NULL),
+ m_lpData(nullptr),
m_pEngine(pEngine) {
ASSERT(m_pEngine);
}
@@ -28,7 +28,7 @@ CFDE_TxtEdtParag::~CFDE_TxtEdtParag() {
}
void CFDE_TxtEdtParag::LoadParag() {
- if (m_lpData != NULL) {
+ if (m_lpData) {
((int32_t*)m_lpData)[0]++;
return;
}
@@ -77,11 +77,11 @@ void CFDE_TxtEdtParag::LoadParag() {
pTxtBreak->ClearBreakPieces();
int32_t nLineCount = LineBaseArr.GetSize();
m_nLineCount = nLineCount;
- if (m_lpData == NULL) {
- m_lpData = FX_Alloc(int32_t, nLineCount + 1);
- } else {
+ if (m_lpData)
m_lpData = FX_Realloc(int32_t, m_lpData, (nLineCount + 1));
- }
+ else
+ m_lpData = FX_Alloc(int32_t, nLineCount + 1);
+
int32_t* pIntArr = (int32_t*)m_lpData;
pIntArr[0] = 1;
m_nLineCount = nLineCount;
@@ -93,12 +93,11 @@ void CFDE_TxtEdtParag::LoadParag() {
}
void CFDE_TxtEdtParag::UnloadParag() {
- ASSERT(m_lpData != NULL);
((int32_t*)m_lpData)[0]--;
ASSERT(((int32_t*)m_lpData)[0] >= 0);
if (((int32_t*)m_lpData)[0] == 0) {
FX_Free(m_lpData);
- m_lpData = NULL;
+ m_lpData = nullptr;
}
}