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

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

Issue 1701073002: Split CPDF_PageObjectHolder off from CPDF_PageObjectList (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: m_pPage can never be null, remove checks. Created 4 years, 10 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/fxedit/fxet_pageobjs.cpp ('k') | fpdfsdk/src/pdfwindow/PWL_Edit.cpp » ('j') | 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 0bd754af76c422adc9784b4584e562d95f6fe536..e869e7231000927cf1c36967362d329e1b0b8d1c 100644
--- a/fpdfsdk/src/javascript/Document.cpp
+++ b/fpdfsdk/src/javascript/Document.cpp
@@ -1380,14 +1380,12 @@ FX_BOOL Document::getPageNthWord(IJS_Context* cc,
page.Load(pDocument, pPageDict);
page.ParseContent(nullptr);
- FX_POSITION pos = page.GetFirstObjectPosition();
-
int nWords = 0;
-
CFX_WideString swRet;
-
+ FX_POSITION pos = page.GetPageObjectList()->GetHeadPosition();
while (pos) {
- if (CPDF_PageObject* pPageObj = page.GetNextObject(pos)) {
+ if (CPDF_PageObject* pPageObj =
+ page.GetPageObjectList()->GetNextObject(pos)) {
if (pPageObj->m_Type == CPDF_PageObject::TEXT) {
int nObjWords = CountWords((CPDF_TextObject*)pPageObj);
@@ -1444,9 +1442,10 @@ FX_BOOL Document::getPageNumWords(IJS_Context* cc,
page.ParseContent(nullptr);
int nWords = 0;
- FX_POSITION pos = page.GetFirstObjectPosition();
+ FX_POSITION pos = page.GetPageObjectList()->GetHeadPosition();
while (pos) {
- if (CPDF_PageObject* pPageObj = page.GetNextObject(pos)) {
+ if (CPDF_PageObject* pPageObj =
+ page.GetPageObjectList()->GetNextObject(pos)) {
if (pPageObj->m_Type == CPDF_PageObject::TEXT) {
CPDF_TextObject* pTextObj = (CPDF_TextObject*)pPageObj;
nWords += CountWords(pTextObj);
« no previous file with comments | « fpdfsdk/src/fxedit/fxet_pageobjs.cpp ('k') | fpdfsdk/src/pdfwindow/PWL_Edit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698