diff options
author | Artem Strygin <art-snake@yandex-team.ru> | 2018-06-26 16:38:49 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-06-26 16:38:49 +0000 |
commit | 2d868435f4c0d47ded1ea405ad2af6b9d83b6651 (patch) | |
tree | 7e2e931e05b962b049879def3e6793a7c43ee95a /core/fpdfapi/parser/cpdf_parser.cpp | |
parent | 20582f797f3fdc6308141dbed5eed7d3f84619c9 (diff) | |
download | pdfium-2d868435f4c0d47ded1ea405ad2af6b9d83b6651.tar.xz |
Unify CPDF_Document loading methods.
Change-Id: Ibf7aee942027adace7ec0831aefe0fe8c28e41cc
Reviewed-on: https://pdfium-review.googlesource.com/35610
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_parser.cpp')
-rw-r--r-- | core/fpdfapi/parser/cpdf_parser.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/core/fpdfapi/parser/cpdf_parser.cpp b/core/fpdfapi/parser/cpdf_parser.cpp index 6cdd6ab789..599b04199d 100644 --- a/core/fpdfapi/parser/cpdf_parser.cpp +++ b/core/fpdfapi/parser/cpdf_parser.cpp @@ -1287,6 +1287,11 @@ uint32_t CPDF_Parser::GetFirstPageNo() const { return m_pLinearized ? m_pLinearized->GetFirstPageNo() : 0; } +void CPDF_Parser::SetLinearizedHeader( + std::unique_ptr<CPDF_LinearizedHeader> pLinearized) { + m_pLinearized = std::move(pLinearized); +} + std::unique_ptr<CPDF_Dictionary> CPDF_Parser::LoadTrailerV4() { if (m_pSyntax->GetKeyword() != "trailer") return nullptr; @@ -1354,7 +1359,7 @@ CPDF_Parser::Error CPDF_Parser::StartLinearizedParse( if (eRet != SUCCESS) return eRet; - m_pDocument->LoadLinearizedDoc(m_pLinearized.get()); + m_pDocument->LoadDoc(); if (!m_pDocument->GetRoot() || m_pDocument->GetPageCount() == 0) { if (bXRefRebuilt) return FORMAT_ERROR; @@ -1367,7 +1372,7 @@ CPDF_Parser::Error CPDF_Parser::StartLinearizedParse( if (eRet != SUCCESS) return eRet; - m_pDocument->LoadLinearizedDoc(m_pLinearized.get()); + m_pDocument->LoadDoc(); if (!m_pDocument->GetRoot()) return FORMAT_ERROR; } |