diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-01-21 11:04:37 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-01-21 11:04:37 -0800 |
commit | b5b2a9162e3e5d17b233d912399daca9be5ed51b (patch) | |
tree | e1ccbe8a5f965cfed2edbcba0cdc889e4404246e /fpdfsdk/src/javascript | |
parent | e19e06e430f76f1cdb126e772602c9fbc4dd1e8f (diff) | |
download | pdfium-b5b2a9162e3e5d17b233d912399daca9be5ed51b.tar.xz |
Mege to XFA: Redo CPDF_PageObjects - part 1
Original Review URL: https://codereview.chromium.org/1601093009 .
(cherry picked from commit da9355139b5dce270be02af31db326d60f488e8c)
Trivial conflicts/changes in fpdfeditpage.cpp and fpdfxfa_page.cpp.
TBR=ochang@chromium.org
Review URL: https://codereview.chromium.org/1613823003 .
Diffstat (limited to 'fpdfsdk/src/javascript')
-rw-r--r-- | fpdfsdk/src/javascript/Document.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp index 1040c34770..ab733375ee 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; } |