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 "../../include/fpdfapi/fpdf_resource.h" | 7 #include "../../include/fpdfapi/fpdf_resource.h" |
8 #include "../../include/fpdfapi/fpdf_pageobj.h" | 8 #include "../../include/fpdfapi/fpdf_pageobj.h" |
9 #include "../../include/fpdftext/fpdf_text.h" | 9 #include "../../include/fpdftext/fpdf_text.h" |
10 #include "../../include/fpdfapi/fpdf_page.h" | 10 #include "../../include/fpdfapi/fpdf_page.h" |
(...skipping 1826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1837 charinfo.m_Matrix.Copy(matrix); | 1837 charinfo.m_Matrix.Copy(matrix); |
1838 if (wstrItem.IsEmpty()) { | 1838 if (wstrItem.IsEmpty()) { |
1839 charinfo.m_Unicode = 0; | 1839 charinfo.m_Unicode = 0; |
1840 m_TempCharList.Add(charinfo); | 1840 m_TempCharList.Add(charinfo); |
1841 m_TempTextBuf.AppendChar(0xfffe); | 1841 m_TempTextBuf.AppendChar(0xfffe); |
1842 continue; | 1842 continue; |
1843 } else { | 1843 } else { |
1844 int nTotal = wstrItem.GetLength(); | 1844 int nTotal = wstrItem.GetLength(); |
1845 int n = 0; | 1845 int n = 0; |
1846 FX_BOOL bDel = FALSE; | 1846 FX_BOOL bDel = FALSE; |
| 1847 FX_FLOAT threshold = charinfo.m_Matrix.TransformXDistance((FX_FLOAT)
TEXT_CHARRATIO_GAPDELTA * pTextObj->GetFontSize()); |
1847 while (n < m_TempCharList.GetSize() && n < 7) { | 1848 while (n < m_TempCharList.GetSize() && n < 7) { |
1848 n++; | 1849 n++; |
1849 PAGECHAR_INFO* charinfo1 = (PAGECHAR_INFO*)m_TempCharList.GetAt(
m_TempCharList.GetSize() - n); | 1850 PAGECHAR_INFO* charinfo1 = (PAGECHAR_INFO*)m_TempCharList.GetAt(
m_TempCharList.GetSize() - n); |
1850 if(charinfo1->m_CharCode == charinfo.m_CharCode && | 1851 if(charinfo1->m_CharCode == charinfo.m_CharCode && |
1851 charinfo1->m_pTextObj->GetFont() == charinfo.m_pTextObj-
>GetFont() && | 1852 charinfo1->m_pTextObj->GetFont() == charinfo.m_pTextObj-
>GetFont() && |
1852 FXSYS_fabs(charinfo1->m_OriginX - charinfo.m_OriginX) <
TEXT_CHARRATIO_GAPDELTA * pTextObj->GetFontSize() && | 1853 FXSYS_fabs(charinfo1->m_OriginX - charinfo.m_OriginX) <
threshold && |
1853 FXSYS_fabs(charinfo1->m_OriginY - charinfo.m_OriginY) <
TEXT_CHARRATIO_GAPDELTA * pTextObj->GetFontSize() ) { | 1854 FXSYS_fabs(charinfo1->m_OriginY - charinfo.m_OriginY) <
threshold) { |
1854 bDel = TRUE; | 1855 bDel = TRUE; |
1855 break; | 1856 break; |
1856 } | 1857 } |
1857 } | 1858 } |
1858 if(!bDel) { | 1859 if(!bDel) { |
1859 for (int nIndex = 0; nIndex < nTotal; nIndex++) { | 1860 for (int nIndex = 0; nIndex < nTotal; nIndex++) { |
1860 charinfo.m_Unicode = wstrItem.GetAt(nIndex); | 1861 charinfo.m_Unicode = wstrItem.GetAt(nIndex); |
1861 if (charinfo.m_Unicode) { | 1862 if (charinfo.m_Unicode) { |
1862 charinfo.m_Index = m_TextBuf.GetLength(); | 1863 charinfo.m_Index = m_TextBuf.GetLength(); |
1863 m_TempTextBuf.AppendChar(charinfo.m_Unicode); | 1864 m_TempTextBuf.AppendChar(charinfo.m_Unicode); |
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2848 if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) { | 2849 if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) { |
2849 return; | 2850 return; |
2850 } | 2851 } |
2851 CPDF_LinkExt* link = NULL; | 2852 CPDF_LinkExt* link = NULL; |
2852 link = m_LinkList.GetAt(index); | 2853 link = m_LinkList.GetAt(index); |
2853 if (!link) { | 2854 if (!link) { |
2854 return ; | 2855 return ; |
2855 } | 2856 } |
2856 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); | 2857 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); |
2857 } | 2858 } |
OLD | NEW |