| 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 <ctype.h> | 7 #include <ctype.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 | 9 |
| 10 #include "../../../third_party/base/nonstd_unique_ptr.h" | 10 #include "../../../third_party/base/nonstd_unique_ptr.h" |
| (...skipping 2543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2554 int CPDF_TextPageFind::GetMatchedCount() const { | 2554 int CPDF_TextPageFind::GetMatchedCount() const { |
| 2555 int resStart = GetCharIndex(m_resStart); | 2555 int resStart = GetCharIndex(m_resStart); |
| 2556 int resEnd = GetCharIndex(m_resEnd); | 2556 int resEnd = GetCharIndex(m_resEnd); |
| 2557 return resEnd - resStart + 1; | 2557 return resEnd - resStart + 1; |
| 2558 } | 2558 } |
| 2559 CPDF_LinkExtract::CPDF_LinkExtract() : m_pTextPage(NULL), m_IsParserd(FALSE) {} | 2559 CPDF_LinkExtract::CPDF_LinkExtract() : m_pTextPage(NULL), m_IsParserd(FALSE) {} |
| 2560 CPDF_LinkExtract::~CPDF_LinkExtract() { | 2560 CPDF_LinkExtract::~CPDF_LinkExtract() { |
| 2561 DeleteLinkList(); | 2561 DeleteLinkList(); |
| 2562 } | 2562 } |
| 2563 FX_BOOL CPDF_LinkExtract::ExtractLinks(const IPDF_TextPage* pTextPage) { | 2563 FX_BOOL CPDF_LinkExtract::ExtractLinks(const IPDF_TextPage* pTextPage) { |
| 2564 if (!pTextPage || !pTextPage->IsParsered()) { | 2564 if (!pTextPage || !pTextPage->IsParsed()) { |
| 2565 return FALSE; | 2565 return FALSE; |
| 2566 } | 2566 } |
| 2567 m_pTextPage = (const CPDF_TextPage*)pTextPage; | 2567 m_pTextPage = (const CPDF_TextPage*)pTextPage; |
| 2568 m_strPageText = m_pTextPage->GetPageText(0, -1); | 2568 m_strPageText = m_pTextPage->GetPageText(0, -1); |
| 2569 DeleteLinkList(); | 2569 DeleteLinkList(); |
| 2570 if (m_strPageText.IsEmpty()) { | 2570 if (m_strPageText.IsEmpty()) { |
| 2571 return FALSE; | 2571 return FALSE; |
| 2572 } | 2572 } |
| 2573 parserLink(); | 2573 parserLink(); |
| 2574 m_IsParserd = TRUE; | 2574 m_IsParserd = TRUE; |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2769 if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) { | 2769 if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) { |
| 2770 return; | 2770 return; |
| 2771 } | 2771 } |
| 2772 CPDF_LinkExt* link = NULL; | 2772 CPDF_LinkExt* link = NULL; |
| 2773 link = m_LinkList.GetAt(index); | 2773 link = m_LinkList.GetAt(index); |
| 2774 if (!link) { | 2774 if (!link) { |
| 2775 return; | 2775 return; |
| 2776 } | 2776 } |
| 2777 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); | 2777 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); |
| 2778 } | 2778 } |
| OLD | NEW |