summaryrefslogtreecommitdiff
path: root/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-12-01 22:52:42 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-01 22:52:42 +0000
commitb8d86800487df4021860f08407c323ed82243c79 (patch)
treeac91e7e9405cf47594316623b26a0aadd9544e79 /fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp
parentdca380ffe0571be4023b11b06b8aecad9934bb06 (diff)
downloadpdfium-b8d86800487df4021860f08407c323ed82243c79.tar.xz
Get rid of else after break/continue/return.chromium/3284chromium/3283
Change-Id: I3efc57cd7325d16e3ca8ebdeeaec06012b2c56e3 Reviewed-on: https://pdfium-review.googlesource.com/20110 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp')
-rw-r--r--fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp106
1 files changed, 52 insertions, 54 deletions
diff --git a/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp b/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp
index 1450b37ea9..059287a665 100644
--- a/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp
+++ b/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp
@@ -157,26 +157,24 @@ int32_t CBC_PDF417HighLevelEncoder::encodeText(WideString msg,
switch (submode) {
case SUBMODE_ALPHA:
if (isAlphaUpper(ch)) {
- if (ch == ' ') {
+ if (ch == ' ')
tmp += (wchar_t)26;
- } else {
+ else
tmp += (wchar_t)(ch - 65);
- }
- } else {
- if (isAlphaLower(ch)) {
- submode = SUBMODE_LOWER;
- tmp += (wchar_t)27;
- continue;
- } else if (isMixed(ch)) {
- submode = SUBMODE_MIXED;
- tmp += (wchar_t)28;
- continue;
- } else {
- tmp += (wchar_t)29;
- tmp += PUNCTUATION[ch];
- break;
- }
+ break;
+ }
+ if (isAlphaLower(ch)) {
+ submode = SUBMODE_LOWER;
+ tmp += (wchar_t)27;
+ continue;
}
+ if (isMixed(ch)) {
+ submode = SUBMODE_MIXED;
+ tmp += (wchar_t)28;
+ continue;
+ }
+ tmp += (wchar_t)29;
+ tmp += PUNCTUATION[ch];
break;
case SUBMODE_LOWER:
if (isAlphaLower(ch)) {
@@ -185,56 +183,56 @@ int32_t CBC_PDF417HighLevelEncoder::encodeText(WideString msg,
} else {
tmp += (wchar_t)(ch - 97);
}
- } else {
- if (isAlphaUpper(ch)) {
- tmp += (wchar_t)27;
- tmp += (wchar_t)(ch - 65);
- break;
- } else if (isMixed(ch)) {
- submode = SUBMODE_MIXED;
- tmp += (wchar_t)28;
- continue;
- } else {
- tmp += (wchar_t)29;
- tmp += PUNCTUATION[ch];
- break;
- }
+ break;
}
+ if (isAlphaUpper(ch)) {
+ tmp += (wchar_t)27;
+ tmp += (wchar_t)(ch - 65);
+ break;
+ }
+ if (isMixed(ch)) {
+ submode = SUBMODE_MIXED;
+ tmp += (wchar_t)28;
+ continue;
+ }
+
+ tmp += (wchar_t)29;
+ tmp += PUNCTUATION[ch];
break;
case SUBMODE_MIXED:
if (isMixed(ch)) {
tmp += MIXED[ch];
- } else {
- if (isAlphaUpper(ch)) {
- submode = SUBMODE_ALPHA;
- tmp += (wchar_t)28;
- continue;
- } else if (isAlphaLower(ch)) {
- submode = SUBMODE_LOWER;
- tmp += (wchar_t)27;
+ break;
+ }
+ if (isAlphaUpper(ch)) {
+ submode = SUBMODE_ALPHA;
+ tmp += (wchar_t)28;
+ continue;
+ }
+ if (isAlphaLower(ch)) {
+ submode = SUBMODE_LOWER;
+ tmp += (wchar_t)27;
+ continue;
+ }
+ if (startpos + idx + 1 < count) {
+ wchar_t next = msg[startpos + idx + 1];
+ if (isPunctuation(next)) {
+ submode = SUBMODE_PUNCTUATION;
+ tmp += (wchar_t)25;
continue;
- } else {
- if (startpos + idx + 1 < count) {
- wchar_t next = msg[startpos + idx + 1];
- if (isPunctuation(next)) {
- submode = SUBMODE_PUNCTUATION;
- tmp += (wchar_t)25;
- continue;
- }
- }
- tmp += (wchar_t)29;
- tmp += PUNCTUATION[ch];
}
}
+ tmp += (wchar_t)29;
+ tmp += PUNCTUATION[ch];
break;
default:
if (isPunctuation(ch)) {
tmp += PUNCTUATION[ch];
- } else {
- submode = SUBMODE_ALPHA;
- tmp += (wchar_t)29;
- continue;
+ break;
}
+ submode = SUBMODE_ALPHA;
+ tmp += (wchar_t)29;
+ continue;
}
idx++;
if (idx >= count) {