diff options
author | weili <weili@chromium.org> | 2016-05-20 15:38:29 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-20 15:38:30 -0700 |
commit | 038aa531bcf1a76764d3cef46fd9b8e08b166dae (patch) | |
tree | d1ef7d15ff37e4c98d1d7522b225755ba99bc330 /xfa/fde/cfde_txtedtengine.cpp | |
parent | dc3ccdfb49c4d533d524d2084a7ebe5117f35934 (diff) | |
download | pdfium-038aa531bcf1a76764d3cef46fd9b8e08b166dae.tar.xz |
Clean up XFA code which causes warnings
This is part of efforts to bring XFA to chromium_code standard.
The warnings are from unreachable code, or using potentially
uninitialized variables, or using assignment within a condition.
This change list only contains easy to fix cases. More cleanups
will follow.
BUG=pdfium:29
Review-Url: https://codereview.chromium.org/1998873002
Diffstat (limited to 'xfa/fde/cfde_txtedtengine.cpp')
-rw-r--r-- | xfa/fde/cfde_txtedtengine.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/xfa/fde/cfde_txtedtengine.cpp b/xfa/fde/cfde_txtedtengine.cpp index a99d8087c5..ecdaf67120 100644 --- a/xfa/fde/cfde_txtedtengine.cpp +++ b/xfa/fde/cfde_txtedtengine.cpp @@ -1023,21 +1023,15 @@ void CFDE_TxtEdtEngine::UpdatePages() { return; if (nSize > nPageCount) { - IFDE_TxtEdtPage* pPage = NULL; - int32_t i = 0; - for (i = nSize - 1; i >= nPageCount; i--) { + for (int32_t i = nSize - 1; i >= nPageCount; i--) { delete m_PagePtrArray[i]; m_PagePtrArray.RemoveAt(i); } return; } if (nSize < nPageCount) { - IFDE_TxtEdtPage* pPage = NULL; - int32_t i = 0; - for (i = nSize; i < nPageCount; i++) { - pPage = IFDE_TxtEdtPage::Create(this, i); - m_PagePtrArray.Add(pPage); - } + for (int32_t i = nSize; i < nPageCount; i++) + m_PagePtrArray.Add(IFDE_TxtEdtPage::Create(this, i)); return; } } @@ -1606,10 +1600,9 @@ FX_BOOL CFDE_TxtEdtEngine::IsSelect() { void CFDE_TxtEdtEngine::DeleteSelect() { int32_t nCountRange = CountSelRanges(); if (nCountRange > 0) { - int32_t nSelStart; - int32_t nSelCount; + int32_t nSelStart = 0; while (nCountRange > 0) { - nSelCount = GetSelRange(--nCountRange, nSelStart); + int32_t nSelCount = GetSelRange(--nCountRange, nSelStart); delete m_SelRangePtrArr[nCountRange]; m_SelRangePtrArr.RemoveAt(nCountRange); DeleteRange_DoRecord(nSelStart, nSelCount, TRUE); |