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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 if (!m_IsParsered) { | 705 if (!m_IsParsered) { |
706 return -1; | 706 return -1; |
707 } | 707 } |
708 CFX_FloatRect rect(left, bottom, right, top); | 708 CFX_FloatRect rect(left, bottom, right, top); |
709 rect.Normalize(); | 709 rect.Normalize(); |
710 int nCount = m_charList.GetSize(); | 710 int nCount = m_charList.GetSize(); |
711 int pos = 0; | 711 int pos = 0; |
712 FPDF_SEGMENT segment; | 712 FPDF_SEGMENT segment; |
713 segment.m_Start = 0; | 713 segment.m_Start = 0; |
714 segment.m_nCount = 0; | 714 segment.m_nCount = 0; |
715 FX_BOOL» » segmentStatus = 0; | 715 int » » segmentStatus = 0; |
716 FX_BOOL IsContainPreChar = FALSE; | 716 FX_BOOL IsContainPreChar = FALSE; |
717 while (pos < nCount) { | 717 while (pos < nCount) { |
718 PAGECHAR_INFO charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(pos); | 718 PAGECHAR_INFO charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(pos); |
719 if(bContains && rect.Contains(charinfo.m_CharBox)) { | 719 if(bContains && rect.Contains(charinfo.m_CharBox)) { |
720 if (segmentStatus == 0 || segmentStatus == 2) { | 720 if (segmentStatus == 0 || segmentStatus == 2) { |
721 segment.m_Start = pos; | 721 segment.m_Start = pos; |
722 segment.m_nCount = 1; | 722 segment.m_nCount = 1; |
723 segmentStatus = 1; | 723 segmentStatus = 1; |
724 } else if (segmentStatus == 1) { | 724 } else if (segmentStatus == 1) { |
725 segment.m_nCount++; | 725 segment.m_nCount++; |
(...skipping 1964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2690 if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) { | 2690 if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) { |
2691 return; | 2691 return; |
2692 } | 2692 } |
2693 CPDF_LinkExt* link = NULL; | 2693 CPDF_LinkExt* link = NULL; |
2694 link = m_LinkList.GetAt(index); | 2694 link = m_LinkList.GetAt(index); |
2695 if (!link) { | 2695 if (!link) { |
2696 return ; | 2696 return ; |
2697 } | 2697 } |
2698 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); | 2698 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); |
2699 } | 2699 } |
OLD | NEW |