diff options
author | Artem Strygin <art-snake@yandex-team.ru> | 2017-08-23 22:16:13 +0300 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-08-29 22:48:11 +0000 |
commit | 3fab4e35539e29c4ded08a424db3b1c7fbfa03fc (patch) | |
tree | 9fec7999573c13fc0dd9998053b611b14101be49 /core/fpdfapi/parser/cpdf_document.cpp | |
parent | 93e67c955aaa061e80b6fd462592d883051b174c (diff) | |
download | pdfium-3fab4e35539e29c4ded08a424db3b1c7fbfa03fc.tar.xz |
Optimize receiving page, if it have not obj num.
Make all pages dictionary are not inlined.
Original fix:
https://codereview.chromium.org/2491583002
Change-Id: Ie3aa662182a70ef6ef1d6121c0576c171e0060dd
Reviewed-on: https://pdfium-review.googlesource.com/11810
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_document.cpp')
-rw-r--r-- | core/fpdfapi/parser/cpdf_document.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/core/fpdfapi/parser/cpdf_document.cpp b/core/fpdfapi/parser/cpdf_document.cpp index 9bfb16b97e..6aedc09d14 100644 --- a/core/fpdfapi/parser/cpdf_document.cpp +++ b/core/fpdfapi/parser/cpdf_document.cpp @@ -426,6 +426,7 @@ CPDF_Dictionary* CPDF_Document::TraversePDFPages(int iPage, i++) { if (*nPagesToGo == 0) break; + pKidList->ConvertToIndirectObjectAt(i, this); CPDF_Dictionary* pKid = pKidList->GetDictAt(i); if (!pKid) { (*nPagesToGo)--; @@ -499,15 +500,6 @@ CPDF_Dictionary* CPDF_Document::GetPage(int iPage) { if (!pPages) return nullptr; - if (iPage - m_iNextPageToTraverse + 1 <= 0) { - // This can happen when the page does not have an object number. On repeated - // calls to this function for the same page index, this condition causes - // TraversePDFPages() to incorrectly return nullptr. - // Example "testing/corpus/fx/other/jetman_std.pdf" - // We should restart traversing in this case. - // TODO(art-snake): optimize this. - ResetTraversal(); - } if (m_pTreeTraversal.empty()) { ResetTraversal(); m_pTreeTraversal.push_back(std::make_pair(pPages, 0)); |