OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "Document.h" | 7 #include "Document.h" |
8 | 8 |
9 #include "Field.h" | 9 #include "Field.h" |
10 #include "Icon.h" | 10 #include "Icon.h" |
(...skipping 1370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1381 page.ParseContent(nullptr); | 1381 page.ParseContent(nullptr); |
1382 | 1382 |
1383 FX_POSITION pos = page.GetFirstObjectPosition(); | 1383 FX_POSITION pos = page.GetFirstObjectPosition(); |
1384 | 1384 |
1385 int nWords = 0; | 1385 int nWords = 0; |
1386 | 1386 |
1387 CFX_WideString swRet; | 1387 CFX_WideString swRet; |
1388 | 1388 |
1389 while (pos) { | 1389 while (pos) { |
1390 if (CPDF_PageObject* pPageObj = page.GetNextObject(pos)) { | 1390 if (CPDF_PageObject* pPageObj = page.GetNextObject(pos)) { |
1391 if (pPageObj->m_Type == PDFPAGE_TEXT) { | 1391 if (pPageObj->m_Type == CPDF_PageObject::TEXT) { |
1392 int nObjWords = CountWords((CPDF_TextObject*)pPageObj); | 1392 int nObjWords = CountWords((CPDF_TextObject*)pPageObj); |
1393 | 1393 |
1394 if (nWords + nObjWords >= nWordNo) { | 1394 if (nWords + nObjWords >= nWordNo) { |
1395 swRet = GetObjWordStr((CPDF_TextObject*)pPageObj, nWordNo - nWords); | 1395 swRet = GetObjWordStr((CPDF_TextObject*)pPageObj, nWordNo - nWords); |
1396 break; | 1396 break; |
1397 } | 1397 } |
1398 | 1398 |
1399 nWords += nObjWords; | 1399 nWords += nObjWords; |
1400 } | 1400 } |
1401 } | 1401 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1440 return FALSE; | 1440 return FALSE; |
1441 | 1441 |
1442 CPDF_Page page; | 1442 CPDF_Page page; |
1443 page.Load(pDocument, pPageDict); | 1443 page.Load(pDocument, pPageDict); |
1444 page.ParseContent(nullptr); | 1444 page.ParseContent(nullptr); |
1445 | 1445 |
1446 int nWords = 0; | 1446 int nWords = 0; |
1447 FX_POSITION pos = page.GetFirstObjectPosition(); | 1447 FX_POSITION pos = page.GetFirstObjectPosition(); |
1448 while (pos) { | 1448 while (pos) { |
1449 if (CPDF_PageObject* pPageObj = page.GetNextObject(pos)) { | 1449 if (CPDF_PageObject* pPageObj = page.GetNextObject(pos)) { |
1450 if (pPageObj->m_Type == PDFPAGE_TEXT) { | 1450 if (pPageObj->m_Type == CPDF_PageObject::TEXT) { |
1451 CPDF_TextObject* pTextObj = (CPDF_TextObject*)pPageObj; | 1451 CPDF_TextObject* pTextObj = (CPDF_TextObject*)pPageObj; |
1452 nWords += CountWords(pTextObj); | 1452 nWords += CountWords(pTextObj); |
1453 } | 1453 } |
1454 } | 1454 } |
1455 } | 1455 } |
1456 | 1456 |
1457 vRet = nWords; | 1457 vRet = nWords; |
1458 return TRUE; | 1458 return TRUE; |
1459 } | 1459 } |
1460 | 1460 |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1636 CJS_DelayData* pData = DelayDataForFieldAndControlIndex.GetAt(i); | 1636 CJS_DelayData* pData = DelayDataForFieldAndControlIndex.GetAt(i); |
1637 Field::DoDelay(m_pDocument, pData); | 1637 Field::DoDelay(m_pDocument, pData); |
1638 DelayDataForFieldAndControlIndex.SetAt(i, NULL); | 1638 DelayDataForFieldAndControlIndex.SetAt(i, NULL); |
1639 delete pData; | 1639 delete pData; |
1640 } | 1640 } |
1641 } | 1641 } |
1642 | 1642 |
1643 CJS_Document* Document::GetCJSDoc() const { | 1643 CJS_Document* Document::GetCJSDoc() const { |
1644 return static_cast<CJS_Document*>(m_pJSObject); | 1644 return static_cast<CJS_Document*>(m_pJSObject); |
1645 } | 1645 } |
OLD | NEW |