diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-01-21 10:51:51 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-01-21 10:51:51 -0800 |
commit | da9355139b5dce270be02af31db326d60f488e8c (patch) | |
tree | 87198aca65808477b8eb425af1296c17c72452d4 /fpdfsdk | |
parent | ca6d98f4dfe7d4fc506b72c91f122f471a53c878 (diff) | |
download | pdfium-da9355139b5dce270be02af31db326d60f488e8c.tar.xz |
Redo CPDF_PageObjects - part 1
Remove default args.
Remove unreachable code.
R=ochang@chromium.org
Review URL: https://codereview.chromium.org/1601093009 .
Diffstat (limited to 'fpdfsdk')
-rw-r--r-- | fpdfsdk/src/fpdf_flatten.cpp | 3 | ||||
-rw-r--r-- | fpdfsdk/src/fpdfeditpage.cpp | 3 | ||||
-rw-r--r-- | fpdfsdk/src/fpdfview.cpp | 2 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/Document.cpp | 12 |
4 files changed, 6 insertions, 14 deletions
diff --git a/fpdfsdk/src/fpdf_flatten.cpp b/fpdfsdk/src/fpdf_flatten.cpp index 50d5036724..c81955d6ca 100644 --- a/fpdfsdk/src/fpdf_flatten.cpp +++ b/fpdfsdk/src/fpdf_flatten.cpp @@ -40,10 +40,9 @@ FX_BOOL GetContentsRect(CPDF_Document* pDoc, CPDF_RectArray* pRectArray) { CPDF_Page* pPDFPage = new CPDF_Page; pPDFPage->Load(pDoc, pDict, FALSE); - pPDFPage->ParseContent(); + pPDFPage->ParseContent(nullptr); FX_POSITION pos = pPDFPage->GetFirstObjectPosition(); - while (pos) { CPDF_PageObject* pPageObject = pPDFPage->GetNextObject(pos); if (!pPageObject) diff --git a/fpdfsdk/src/fpdfeditpage.cpp b/fpdfsdk/src/fpdfeditpage.cpp index 240724fe48..0a44724f98 100644 --- a/fpdfsdk/src/fpdfeditpage.cpp +++ b/fpdfsdk/src/fpdfeditpage.cpp @@ -80,8 +80,7 @@ DLLEXPORT FPDF_PAGE STDCALL FPDFPage_New(FPDF_DOCUMENT document, CPDF_Page* pPage = new CPDF_Page; pPage->Load(pDoc, pPageDict); - pPage->ParseContent(); - + pPage->ParseContent(nullptr); return pPage; } diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp index e59515a863..d713e9773d 100644 --- a/fpdfsdk/src/fpdfview.cpp +++ b/fpdfsdk/src/fpdfview.cpp @@ -297,7 +297,7 @@ DLLEXPORT FPDF_PAGE STDCALL FPDF_LoadPage(FPDF_DOCUMENT document, return NULL; CPDF_Page* pPage = new CPDF_Page; pPage->Load(pDoc, pDict); - pPage->ParseContent(); + pPage->ParseContent(nullptr); return pPage; } 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; } |