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

Unified Diff: core/fpdfapi/fpdf_parser/cpdf_syntax_parser.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_security_handler.cpp ('k') | core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp
diff --git a/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp b/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp
index 13a9972425445410ba2bdd62fd57dbe7260298dc..0eeb4a1afa92f684e434520d03cd6644e285ad42 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp
@@ -381,7 +381,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObject(CPDF_IndirectObjectHolder* pObjList,
if (++s_CurrentRecursionDepth > kParserMaxRecursionDepth)
return nullptr;
- FX_FILESIZE SavedPos = m_Pos;
+ FX_FILESIZE SavedObjPos = m_Pos;
bool bIsNumber;
CFX_ByteString word = GetNextWord(&bIsNumber);
if (word.GetLength() == 0)
@@ -392,10 +392,8 @@ CPDF_Object* CPDF_SyntaxParser::GetObject(CPDF_IndirectObjectHolder* pObjList,
CFX_ByteString nextword = GetNextWord(&bIsNumber);
if (bIsNumber) {
CFX_ByteString nextword2 = GetNextWord(nullptr);
- if (nextword2 == "R") {
- uint32_t objnum = FXSYS_atoui(word.c_str());
- return new CPDF_Reference(pObjList, objnum);
- }
+ if (nextword2 == "R")
+ return new CPDF_Reference(pObjList, FXSYS_atoui(word.c_str()));
}
m_Pos = SavedPos;
return new CPDF_Number(word.AsStringC());
@@ -492,7 +490,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObject(CPDF_IndirectObjectHolder* pObjList,
}
if (word == ">>")
- m_Pos = SavedPos;
+ m_Pos = SavedObjPos;
return nullptr;
}
@@ -505,7 +503,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObjectByStrict(
if (++s_CurrentRecursionDepth > kParserMaxRecursionDepth)
return nullptr;
- FX_FILESIZE SavedPos = m_Pos;
+ FX_FILESIZE SavedObjPos = m_Pos;
bool bIsNumber;
CFX_ByteString word = GetNextWord(&bIsNumber);
if (word.GetLength() == 0)
@@ -605,7 +603,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObjectByStrict(
}
if (word == ">>")
- m_Pos = SavedPos;
+ m_Pos = SavedObjPos;
return nullptr;
}
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_security_handler.cpp ('k') | core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698