diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-03-28 20:00:35 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-03-28 20:00:35 +0000 |
commit | 53a8093c6ef694ec520fe0b087fbac86af97f5e8 (patch) | |
tree | 519a805d66eed415e310eb67a05212c6d217025d /core/fpdfapi/parser/cpdf_simple_parser.cpp | |
parent | 971a674ef17526ad37ce55ba90110830b94889d0 (diff) | |
download | pdfium-53a8093c6ef694ec520fe0b087fbac86af97f5e8.tar.xz |
Use CPDF_DefaultAppearance instead of custom parsing
This CL moves code over to using CPDF_DefaultAppearance instead of
calling the CPDF_SimpleParser directly. This means the code for finding
a specific tag start can move into CPDF_DefaultAppearance directly.
Change-Id: I1dc64e54aedd03d059b963121d466f3eb75c17db
Reviewed-on: https://pdfium-review.googlesource.com/28410
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_simple_parser.cpp')
-rw-r--r-- | core/fpdfapi/parser/cpdf_simple_parser.cpp | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/core/fpdfapi/parser/cpdf_simple_parser.cpp b/core/fpdfapi/parser/cpdf_simple_parser.cpp index 47ce1ad55e..45ea0d4528 100644 --- a/core/fpdfapi/parser/cpdf_simple_parser.cpp +++ b/core/fpdfapi/parser/cpdf_simple_parser.cpp @@ -6,8 +6,6 @@ #include "core/fpdfapi/parser/cpdf_simple_parser.h" -#include <vector> - #include "core/fpdfapi/parser/fpdf_parser_utility.h" CPDF_SimpleParser::CPDF_SimpleParser(const ByteStringView& str) : data_(str) {} @@ -129,35 +127,3 @@ ByteStringView CPDF_SimpleParser::GetWord() { } return data_.Mid(start_pos, dwSize); } - -bool CPDF_SimpleParser::FindTagParamFromStart(const ByteStringView& token, - int nParams) { - nParams++; - - std::vector<uint32_t> pBuf(nParams); - int buf_index = 0; - int buf_count = 0; - cur_pos_ = 0; - while (1) { - pBuf[buf_index++] = cur_pos_; - if (buf_index == nParams) - buf_index = 0; - - buf_count++; - if (buf_count > nParams) - buf_count = nParams; - - ByteStringView word = GetWord(); - if (word.IsEmpty()) - return false; - - if (word == token) { - if (buf_count < nParams) - continue; - - cur_pos_ = pBuf[buf_index]; - return true; - } - } - return false; -} |