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/fpdftext/fpdf_text_int.h" | 7 #include "core/fpdftext/fpdf_text_int.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cctype> | 10 #include <cctype> |
(...skipping 1785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1796 } | 1796 } |
1797 if (pTextObj2->GetFontSize() != pTextObj1->GetFontSize()) { | 1797 if (pTextObj2->GetFontSize() != pTextObj1->GetFontSize()) { |
1798 return FALSE; | 1798 return FALSE; |
1799 } | 1799 } |
1800 } | 1800 } |
1801 int nPreCount = pTextObj2->CountItems(); | 1801 int nPreCount = pTextObj2->CountItems(); |
1802 int nCurCount = pTextObj1->CountItems(); | 1802 int nCurCount = pTextObj1->CountItems(); |
1803 if (nPreCount != nCurCount) { | 1803 if (nPreCount != nCurCount) { |
1804 return FALSE; | 1804 return FALSE; |
1805 } | 1805 } |
1806 CPDF_TextObjectItem itemPer, itemCur; | 1806 CPDF_TextObjectItem itemPer; |
| 1807 CPDF_TextObjectItem itemCur; |
1807 for (int i = 0; i < nPreCount; i++) { | 1808 for (int i = 0; i < nPreCount; i++) { |
1808 pTextObj2->GetItemInfo(i, &itemPer); | 1809 pTextObj2->GetItemInfo(i, &itemPer); |
1809 pTextObj1->GetItemInfo(i, &itemCur); | 1810 pTextObj1->GetItemInfo(i, &itemCur); |
1810 if (itemCur.m_CharCode != itemPer.m_CharCode) { | 1811 if (itemCur.m_CharCode != itemPer.m_CharCode) { |
1811 return FALSE; | 1812 return FALSE; |
1812 } | 1813 } |
1813 } | 1814 } |
1814 if (FXSYS_fabs(pTextObj1->GetPosX() - pTextObj2->GetPosX()) > | 1815 if (FXSYS_fabs(pTextObj1->GetPosX() - pTextObj2->GetPosX()) > |
1815 GetCharWidth(itemPer.m_CharCode, pTextObj2->GetFont()) * | 1816 GetCharWidth(itemPer.m_CharCode, pTextObj2->GetFont()) * |
1816 pTextObj2->GetFontSize() / 1000 * 0.9 || | 1817 pTextObj2->GetFontSize() / 1000 * 0.9 || |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2502 if (!m_bIsParsed || index < 0 || index >= m_LinkList.GetSize()) { | 2503 if (!m_bIsParsed || index < 0 || index >= m_LinkList.GetSize()) { |
2503 return; | 2504 return; |
2504 } | 2505 } |
2505 CPDF_LinkExt* link = NULL; | 2506 CPDF_LinkExt* link = NULL; |
2506 link = m_LinkList.GetAt(index); | 2507 link = m_LinkList.GetAt(index); |
2507 if (!link) { | 2508 if (!link) { |
2508 return; | 2509 return; |
2509 } | 2510 } |
2510 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); | 2511 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); |
2511 } | 2512 } |
OLD | NEW |