diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-03-28 17:02:46 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-03-28 17:02:46 +0000 |
commit | 14094f22d9a7bfde8673689218a88d6feb02f3ee (patch) | |
tree | a4a2016b9984b50e80680a182f52d41b58e8894e /core/fpdfapi/parser/cpdf_syntax_parser.cpp | |
parent | 8eac5ad73918818569859cd0453a1d5a44a1f81b (diff) | |
download | pdfium-14094f22d9a7bfde8673689218a88d6feb02f3ee.tar.xz |
Remove ByteString PDF_NameDecode
This CL removes the ByteString version of PDF_NameDecode and forces the
callers to use the ByteStringView variant.
Change-Id: I5a955d8e909e2045ee45843af54b23e98abe00ed
Reviewed-on: https://pdfium-review.googlesource.com/29350
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_syntax_parser.cpp')
-rw-r--r-- | core/fpdfapi/parser/cpdf_syntax_parser.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.cpp b/core/fpdfapi/parser/cpdf_syntax_parser.cpp index 624bde4ab3..8b8e59fa96 100644 --- a/core/fpdfapi/parser/cpdf_syntax_parser.cpp +++ b/core/fpdfapi/parser/cpdf_syntax_parser.cpp @@ -420,23 +420,22 @@ std::unique_ptr<CPDF_Object> CPDF_SyntaxParser::GetObjectBodyInternal( std::unique_ptr<CPDF_Dictionary> pDict = pdfium::MakeUnique<CPDF_Dictionary>(m_pPool); while (1) { - ByteString key = GetNextWord(nullptr); - if (key.IsEmpty()) + ByteString word = GetNextWord(nullptr); + if (word.IsEmpty()) return nullptr; - FX_FILESIZE SavedPos = m_Pos - key.GetLength(); - if (key == ">>") + FX_FILESIZE SavedPos = m_Pos - word.GetLength(); + if (word == ">>") break; - if (key == "endobj") { + if (word == "endobj") { m_Pos = SavedPos; break; } - if (key[0] != '/') + if (word[0] != '/') continue; - key = PDF_NameDecode(key); - + ByteString key = PDF_NameDecode(word.AsStringView()); if (key.IsEmpty() && parse_type == ParseType::kLoose) continue; |