| Index: core/src/fpdftext/fpdf_text_int.cpp
|
| diff --git a/core/src/fpdftext/fpdf_text_int.cpp b/core/src/fpdftext/fpdf_text_int.cpp
|
| index a0f0c6482230ab2d29ed221030b5de90e8f0db77..6c6a27c8aff947312f9e1bc364a895eeae876162 100644
|
| --- a/core/src/fpdftext/fpdf_text_int.cpp
|
| +++ b/core/src/fpdftext/fpdf_text_int.cpp
|
| @@ -108,7 +108,7 @@ IPDF_LinkExtract* IPDF_LinkExtract::CreateLinkExtract() {
|
| #define TEXT_CHARRATIO_GAPDELTA 0.070
|
|
|
| CPDF_TextPage::CPDF_TextPage(const CPDF_Page* pPage, int flags)
|
| - : m_pPage(pPage),
|
| + : m_pPageObjectHolder(pPage),
|
| m_parserflag(flags),
|
| m_pPreTextObj(nullptr),
|
| m_bIsParsed(false),
|
| @@ -137,7 +137,7 @@ bool CPDF_TextPage::IsControlChar(const PAGECHAR_INFO& charInfo) {
|
|
|
| FX_BOOL CPDF_TextPage::ParseTextPage() {
|
| m_bIsParsed = false;
|
| - if (!m_pPage)
|
| + if (!m_pPageObjectHolder)
|
| return FALSE;
|
|
|
| m_TextBuf.Clear();
|
| @@ -756,11 +756,13 @@ int CPDF_TextPage::GetWordBreak(int index, int direction) const {
|
| }
|
|
|
| int32_t CPDF_TextPage::FindTextlineFlowDirection() {
|
| - if (!m_pPage) {
|
| + if (!m_pPageObjectHolder) {
|
| return -1;
|
| }
|
| - const int32_t nPageWidth = (int32_t)((CPDF_Page*)m_pPage)->GetPageWidth();
|
| - const int32_t nPageHeight = (int32_t)((CPDF_Page*)m_pPage)->GetPageHeight();
|
| + const int32_t nPageWidth = static_cast<int32_t>(
|
| + static_cast<const CPDF_Page*>(m_pPageObjectHolder)->GetPageWidth());
|
| + const int32_t nPageHeight = static_cast<int32_t>(
|
| + static_cast<const CPDF_Page*>(m_pPageObjectHolder)->GetPageHeight());
|
| std::vector<uint8_t> nHorizontalMask(nPageWidth);
|
| std::vector<uint8_t> nVerticalMask(nPageHeight);
|
| uint8_t* pDataH = nHorizontalMask.data();
|
| @@ -769,12 +771,12 @@ int32_t CPDF_TextPage::FindTextlineFlowDirection() {
|
| FX_FLOAT fLineHeight = 0.0f;
|
| CPDF_PageObject* pPageObj = NULL;
|
| FX_POSITION pos = NULL;
|
| - pos = m_pPage->GetFirstObjectPosition();
|
| + pos = m_pPageObjectHolder->GetPageObjectList()->GetHeadPosition();
|
| if (!pos) {
|
| return -1;
|
| }
|
| while (pos) {
|
| - pPageObj = m_pPage->GetNextObject(pos);
|
| + pPageObj = m_pPageObjectHolder->GetPageObjectList()->GetNextObject(pos);
|
| if (NULL == pPageObj) {
|
| continue;
|
| }
|
| @@ -855,18 +857,18 @@ int32_t CPDF_TextPage::FindTextlineFlowDirection() {
|
|
|
| void CPDF_TextPage::ProcessObject() {
|
| CPDF_PageObject* pPageObj = NULL;
|
| - if (!m_pPage) {
|
| + if (!m_pPageObjectHolder) {
|
| return;
|
| }
|
| FX_POSITION pos;
|
| - pos = m_pPage->GetFirstObjectPosition();
|
| + pos = m_pPageObjectHolder->GetPageObjectList()->GetHeadPosition();
|
| if (!pos) {
|
| return;
|
| }
|
| m_TextlineDir = FindTextlineFlowDirection();
|
| int nCount = 0;
|
| while (pos) {
|
| - pPageObj = m_pPage->GetNextObject(pos);
|
| + pPageObj = m_pPageObjectHolder->GetPageObjectList()->GetNextObject(pos);
|
| if (pPageObj) {
|
| if (pPageObj->m_Type == CPDF_PageObject::TEXT) {
|
| CFX_Matrix matrix;
|
| @@ -894,7 +896,7 @@ void CPDF_TextPage::ProcessFormObject(CPDF_FormObject* pFormObj,
|
| if (!pFormObj) {
|
| return;
|
| }
|
| - pos = pFormObj->m_pForm->GetFirstObjectPosition();
|
| + pos = pFormObj->m_pForm->GetPageObjectList()->GetHeadPosition();
|
| if (!pos) {
|
| return;
|
| }
|
| @@ -902,7 +904,7 @@ void CPDF_TextPage::ProcessFormObject(CPDF_FormObject* pFormObj,
|
| curFormMatrix.Copy(pFormObj->m_FormMatrix);
|
| curFormMatrix.Concat(formMatrix);
|
| while (pos) {
|
| - pPageObj = pFormObj->m_pForm->GetNextObject(pos);
|
| + pPageObj = pFormObj->m_pForm->GetPageObjectList()->GetNextObject(pos);
|
| if (pPageObj) {
|
| if (pPageObj->m_Type == CPDF_PageObject::TEXT) {
|
| ProcessTextObject((CPDF_TextObject*)pPageObj, curFormMatrix, pos);
|
| @@ -1851,11 +1853,12 @@ FX_BOOL CPDF_TextPage::IsSameAsPreTextObject(CPDF_TextObject* pTextObj,
|
| }
|
| int i = 0;
|
| if (!ObjPos) {
|
| - ObjPos = m_pPage->GetLastObjectPosition();
|
| + ObjPos = m_pPageObjectHolder->GetPageObjectList()->GetTailPosition();
|
| }
|
| - CPDF_PageObject* pObj = m_pPage->GetPrevObject(ObjPos);
|
| + CPDF_PageObject* pObj =
|
| + m_pPageObjectHolder->GetPageObjectList()->GetPrevObject(ObjPos);
|
| while (i < 5 && ObjPos) {
|
| - pObj = m_pPage->GetPrevObject(ObjPos);
|
| + pObj = m_pPageObjectHolder->GetPageObjectList()->GetPrevObject(ObjPos);
|
| if (pObj == pTextObj) {
|
| continue;
|
| }
|
|
|