summaryrefslogtreecommitdiff
path: root/fxjs/cjs_document.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-06-04 18:26:07 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-04 18:26:07 +0000
commitf06ed6d3578fff9e1d2990e5757dc460e60e5dd3 (patch)
tree80a0b51c34053bcce961d43905afaef33b33c4da /fxjs/cjs_document.cpp
parent168c763539e70bea450701470c47a8991f578336 (diff)
downloadpdfium-f06ed6d3578fff9e1d2990e5757dc460e60e5dd3.tar.xz
Revert "Make CPDF_Document cache CPDF_Pages"
This reverts commit f0d9d28a034fe3650c3c2d662090c1e8687ddb16. Reason for revert: avoid parsing page. Change-Id: Id3478f7e38f1cbe95d098e00158b1d7d9dc6f76e Reviewed-on: https://pdfium-review.googlesource.com/33750 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/cjs_document.cpp')
-rw-r--r--fxjs/cjs_document.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/fxjs/cjs_document.cpp b/fxjs/cjs_document.cpp
index b2cc1eb72c..533decf1dc 100644
--- a/fxjs/cjs_document.cpp
+++ b/fxjs/cjs_document.cpp
@@ -1256,7 +1256,8 @@ CJS_Return CJS_Document::getPageNthWord(
if (!pPageDict)
return CJS_Return(false);
- RetainPtr<CPDF_Page> page = pDocument->GetOrCreatePDFPage(pPageDict);
+ auto page = pdfium::MakeRetain<CPDF_Page>(pDocument, pPageDict, true);
+ page->ParseContent();
int nWords = 0;
WideString swRet;
@@ -1304,7 +1305,8 @@ CJS_Return CJS_Document::getPageNumWords(
if (!pPageDict)
return CJS_Return(false);
- RetainPtr<CPDF_Page> page = pDocument->GetOrCreatePDFPage(pPageDict);
+ auto page = pdfium::MakeRetain<CPDF_Page>(pDocument, pPageDict, true);
+ page->ParseContent();
int nWords = 0;
for (auto& pPageObj : *page->GetPageObjectList()) {