summaryrefslogtreecommitdiff
path: root/xfa/fde/cfde_texteditengine.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-09-19 11:18:28 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-19 15:38:42 +0000
commit9f374b0a3c8283eb457ce29ade9c0f19643cd1f4 (patch)
treeb448452d762a59636891bbb4fcc902d3dbd936c2 /xfa/fde/cfde_texteditengine.cpp
parentd13f24c08debb293e794ba5a66dd449adf4bc2c8 (diff)
downloadpdfium-9f374b0a3c8283eb457ce29ade9c0f19643cd1f4.tar.xz
Cleanup FindNextBreakPos variables
The ePreType flag is only used if bFirst is true. After the first iteration of the loop bFirst is always false. This CL removes the updating of ePreType as it will never be used. Also bFirst is only set false at the end of the loop and the do {} while is changed into a while {} Change-Id: Iaced1b38bddcc6f5483ae20993ac69c93b2e3f97 Reviewed-on: https://pdfium-review.googlesource.com/14292 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fde/cfde_texteditengine.cpp')
-rw-r--r--xfa/fde/cfde_texteditengine.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/xfa/fde/cfde_texteditengine.cpp b/xfa/fde/cfde_texteditengine.cpp
index a28aeb5f6c..233d958094 100644
--- a/xfa/fde/cfde_texteditengine.cpp
+++ b/xfa/fde/cfde_texteditengine.cpp
@@ -1039,7 +1039,7 @@ void CFDE_TextEditEngine::Iterator::FindNextBreakPos(bool bPrev) {
WordBreakProperty eCurType = GetWordBreakProperty(GetChar());
bool bFirst = true;
- do {
+ while (!IsEOF(bPrev)) {
Next(bPrev);
WordBreakProperty eNextType = GetWordBreakProperty(GetChar());
@@ -1059,7 +1059,6 @@ void CFDE_TextEditEngine::Iterator::FindNextBreakPos(bool bPrev) {
Next(bPrev);
wBreak = false;
}
- bFirst = false;
}
if (wBreak) {
int32_t nFlags = GetBreakFlagsFor(eNextType, eCurType);
@@ -1077,8 +1076,7 @@ void CFDE_TextEditEngine::Iterator::FindNextBreakPos(bool bPrev) {
}
}
}
- ePreType = eCurType;
eCurType = eNextType;
bFirst = false;
- } while (!IsEOF(bPrev));
+ }
}