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

Unified Diff: xfa/fde/cfde_txtedtengine.cpp

Issue 1998873002: Clean up XFA code which causes warnings (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | xfa/fde/css/fde_cssstyleselector.cpp » ('j') | xfa/fwl/core/fwl_widgetmgrimp.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fde/cfde_txtedtengine.cpp
diff --git a/xfa/fde/cfde_txtedtengine.cpp b/xfa/fde/cfde_txtedtengine.cpp
index a99d8087c54b986381aea21f4effaf761f4bc2e6..a006cc76edf840830244501d16314ba659c832ae 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;
}
}
@@ -1608,12 +1602,12 @@ void CFDE_TxtEdtEngine::DeleteSelect() {
if (nCountRange > 0) {
int32_t nSelStart;
int32_t nSelCount;
Lei Zhang 2016/05/20 03:48:01 Merge with line 1606.
Wei Li 2016/05/20 16:33:14 Done.
- while (nCountRange > 0) {
Lei Zhang 2016/05/20 03:48:01 What's wrong here? Should you initialize |nSelStar
Wei Li 2016/05/20 16:33:14 Yes, the warning is about |nSelStart| may not be i
+ do {
nSelCount = GetSelRange(--nCountRange, nSelStart);
delete m_SelRangePtrArr[nCountRange];
m_SelRangePtrArr.RemoveAt(nCountRange);
DeleteRange_DoRecord(nSelStart, nSelCount, TRUE);
- }
+ } while (nCountRange > 0);
ClearSelection();
m_Param.pEventSink->On_TextChanged(this, m_ChangeInfo);
m_Param.pEventSink->On_SelChanged(this);
« no previous file with comments | « no previous file | xfa/fde/css/fde_cssstyleselector.cpp » ('j') | xfa/fwl/core/fwl_widgetmgrimp.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698