OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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/fpdftext/cpdf_linkextract.h" | 7 #include "core/fpdftext/cpdf_linkextract.h" |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "core/fpdftext/cpdf_textpage.h" | 11 #include "core/fpdftext/cpdf_textpage.h" |
12 #include "core/fxcrt/include/fx_ext.h" | 12 #include "core/fxcrt/fx_ext.h" |
13 #include "core/fxcrt/include/fx_string.h" | 13 #include "core/fxcrt/fx_string.h" |
14 #include "core/fxcrt/include/fx_system.h" | 14 #include "core/fxcrt/fx_system.h" |
15 | 15 |
16 CPDF_LinkExtract::CPDF_LinkExtract(const CPDF_TextPage* pTextPage) | 16 CPDF_LinkExtract::CPDF_LinkExtract(const CPDF_TextPage* pTextPage) |
17 : m_pTextPage(pTextPage) {} | 17 : m_pTextPage(pTextPage) {} |
18 | 18 |
19 CPDF_LinkExtract::~CPDF_LinkExtract() {} | 19 CPDF_LinkExtract::~CPDF_LinkExtract() {} |
20 | 20 |
21 void CPDF_LinkExtract::ExtractLinks() { | 21 void CPDF_LinkExtract::ExtractLinks() { |
22 m_LinkArray.clear(); | 22 m_LinkArray.clear(); |
23 if (!m_pTextPage->IsParsed()) | 23 if (!m_pTextPage->IsParsed()) |
24 return; | 24 return; |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 return index < m_LinkArray.size() ? m_LinkArray[index].m_strUrl : L""; | 164 return index < m_LinkArray.size() ? m_LinkArray[index].m_strUrl : L""; |
165 } | 165 } |
166 | 166 |
167 std::vector<CFX_FloatRect> CPDF_LinkExtract::GetRects(size_t index) const { | 167 std::vector<CFX_FloatRect> CPDF_LinkExtract::GetRects(size_t index) const { |
168 if (index >= m_LinkArray.size()) | 168 if (index >= m_LinkArray.size()) |
169 return std::vector<CFX_FloatRect>(); | 169 return std::vector<CFX_FloatRect>(); |
170 | 170 |
171 return m_pTextPage->GetRectArray(m_LinkArray[index].m_Start, | 171 return m_pTextPage->GetRectArray(m_LinkArray[index].m_Start, |
172 m_LinkArray[index].m_Count); | 172 m_LinkArray[index].m_Count); |
173 } | 173 } |
OLD | NEW |