Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: fpdfsdk/src/javascript/Document.cpp

Issue 1601093009: Redo CPDF_PageObjects - part 1 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/src/fpdfview.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/javascript/Document.cpp
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp
index 1040c3477032bccc6fe6cd9017a7617e1796d42a..ab733375eed95674bacb566292970ddcc5f05d6f 100644
--- a/fpdfsdk/src/javascript/Document.cpp
+++ b/fpdfsdk/src/javascript/Document.cpp
@@ -1378,8 +1378,7 @@ FX_BOOL Document::getPageNthWord(IJS_Context* cc,
CPDF_Page page;
page.Load(pDocument, pPageDict);
- page.StartParse();
- page.ParseContent();
+ page.ParseContent(nullptr);
FX_POSITION pos = page.GetFirstObjectPosition();
@@ -1429,7 +1428,6 @@ FX_BOOL Document::getPageNumWords(IJS_Context* cc,
return FALSE;
int nPageNo = params.size() > 0 ? params[0].ToInt() : 0;
-
CPDF_Document* pDocument = m_pDocument->GetPDFDocument();
CJS_Context* pContext = static_cast<CJS_Context*>(cc);
if (nPageNo < 0 || nPageNo >= pDocument->GetPageCount()) {
@@ -1443,13 +1441,10 @@ FX_BOOL Document::getPageNumWords(IJS_Context* cc,
CPDF_Page page;
page.Load(pDocument, pPageDict);
- page.StartParse();
- page.ParseContent();
-
- FX_POSITION pos = page.GetFirstObjectPosition();
+ page.ParseContent(nullptr);
int nWords = 0;
-
+ FX_POSITION pos = page.GetFirstObjectPosition();
while (pos) {
if (CPDF_PageObject* pPageObj = page.GetNextObject(pos)) {
if (pPageObj->m_Type == PDFPAGE_TEXT) {
@@ -1460,7 +1455,6 @@ FX_BOOL Document::getPageNumWords(IJS_Context* cc,
}
vRet = nWords;
-
return TRUE;
}
« no previous file with comments | « fpdfsdk/src/fpdfview.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698