| 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 "core/src/fpdftext/text_int.h" | 7 #include "core/fpdftext/text_int.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <cctype> | 10 #include <cctype> |
| 11 #include <cwctype> | 11 #include <cwctype> |
| 12 #include <memory> | 12 #include <memory> |
| 13 #include <utility> | 13 #include <utility> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "core/include/fpdfapi/cpdf_dictionary.h" | 16 #include "core/include/fpdfapi/cpdf_dictionary.h" |
| 17 #include "core/include/fpdfapi/cpdf_string.h" | 17 #include "core/include/fpdfapi/cpdf_string.h" |
| (...skipping 2256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2274 return GetCharIndex(m_resStart); | 2274 return GetCharIndex(m_resStart); |
| 2275 } | 2275 } |
| 2276 | 2276 |
| 2277 int CPDF_TextPageFind::GetMatchedCount() const { | 2277 int CPDF_TextPageFind::GetMatchedCount() const { |
| 2278 int resStart = GetCharIndex(m_resStart); | 2278 int resStart = GetCharIndex(m_resStart); |
| 2279 int resEnd = GetCharIndex(m_resEnd); | 2279 int resEnd = GetCharIndex(m_resEnd); |
| 2280 return resEnd - resStart + 1; | 2280 return resEnd - resStart + 1; |
| 2281 } | 2281 } |
| 2282 | 2282 |
| 2283 CPDF_LinkExtract::CPDF_LinkExtract() | 2283 CPDF_LinkExtract::CPDF_LinkExtract() |
| 2284 : m_pTextPage(nullptr), m_bIsParsed(false) { | 2284 : m_pTextPage(nullptr), m_bIsParsed(false) {} |
| 2285 } | |
| 2286 | 2285 |
| 2287 CPDF_LinkExtract::~CPDF_LinkExtract() { | 2286 CPDF_LinkExtract::~CPDF_LinkExtract() { |
| 2288 DeleteLinkList(); | 2287 DeleteLinkList(); |
| 2289 } | 2288 } |
| 2290 | 2289 |
| 2291 FX_BOOL CPDF_LinkExtract::ExtractLinks(const IPDF_TextPage* pTextPage) { | 2290 FX_BOOL CPDF_LinkExtract::ExtractLinks(const IPDF_TextPage* pTextPage) { |
| 2292 if (!pTextPage || !pTextPage->IsParsed()) | 2291 if (!pTextPage || !pTextPage->IsParsed()) |
| 2293 return FALSE; | 2292 return FALSE; |
| 2294 | 2293 |
| 2295 m_pTextPage = (const CPDF_TextPage*)pTextPage; | 2294 m_pTextPage = (const CPDF_TextPage*)pTextPage; |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2492 if (!m_bIsParsed || index < 0 || index >= m_LinkList.GetSize()) { | 2491 if (!m_bIsParsed || index < 0 || index >= m_LinkList.GetSize()) { |
| 2493 return; | 2492 return; |
| 2494 } | 2493 } |
| 2495 CPDF_LinkExt* link = NULL; | 2494 CPDF_LinkExt* link = NULL; |
| 2496 link = m_LinkList.GetAt(index); | 2495 link = m_LinkList.GetAt(index); |
| 2497 if (!link) { | 2496 if (!link) { |
| 2498 return; | 2497 return; |
| 2499 } | 2498 } |
| 2500 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); | 2499 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); |
| 2501 } | 2500 } |
| OLD | NEW |