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

Unified Diff: core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp

Issue 2027273002: Fix all the code which has duplicate variable declarations (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase 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 | « core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp ('k') | core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
diff --git a/core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp b/core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
index e9f5a6d468e891cd5582c88a6e3536cf34dfbf09..7c489a35dc625ad28272b31135db9bfa21ec6c7c 100644
--- a/core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
+++ b/core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
@@ -447,12 +447,11 @@ CFX_WideString PDF_DecodeText(const uint8_t* src_data, uint32_t src_len) {
if (unicode == 0x1b) {
i += 2;
while (i < max_chars * 2) {
- uint16_t unicode = bBE ? (uni_str[i] << 8 | uni_str[i + 1])
- : (uni_str[i + 1] << 8 | uni_str[i]);
+ uint16_t unicode2 = bBE ? (uni_str[i] << 8 | uni_str[i + 1])
+ : (uni_str[i + 1] << 8 | uni_str[i]);
i += 2;
- if (unicode == 0x1b) {
+ if (unicode2 == 0x1b)
break;
- }
}
} else {
dest_buf[dest_pos++] = unicode;
@@ -506,9 +505,9 @@ CFX_ByteString PDF_EncodeText(const FX_WCHAR* pString, int len) {
dest_buf2[0] = 0xfe;
dest_buf2[1] = 0xff;
dest_buf2 += 2;
- for (int i = 0; i < len; i++) {
+ for (int j = 0; j < len; j++) {
*dest_buf2++ = pString[i] >> 8;
- *dest_buf2++ = (uint8_t)pString[i];
+ *dest_buf2++ = (uint8_t)pString[j];
}
result.ReleaseBuffer(encLen);
return result;
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp ('k') | core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698