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 19 matching lines...) Expand all Loading... |
30 || curChar == 8467 | 30 || curChar == 8467 |
31 || (curChar >= 0x2000 && curChar <= 0x206F)) { | 31 || (curChar >= 0x2000 && curChar <= 0x206F)) { |
32 return FALSE; | 32 return FALSE; |
33 } | 33 } |
34 return TRUE; | 34 return TRUE; |
35 } | 35 } |
36 | 36 |
37 FX_FLOAT _NormalizeThreshold(FX_FLOAT threshold) | 37 FX_FLOAT _NormalizeThreshold(FX_FLOAT threshold) |
38 { | 38 { |
39 if (threshold < 300) { | 39 if (threshold < 300) { |
40 return threshold / 2.0; | 40 return threshold / 2.0f; |
41 } else if (threshold < 500) { | 41 } else if (threshold < 500) { |
42 return threshold / 4.0; | 42 return threshold / 4.0f; |
43 } else if (threshold < 700) { | 43 } else if (threshold < 700) { |
44 return threshold / 5.0; | 44 return threshold / 5.0f; |
45 } | 45 } |
46 return threshold / 6.0; | 46 return threshold / 6.0f; |
47 } | 47 } |
48 | 48 |
49 FX_FLOAT _CalculateBaseSpace(const CPDF_TextObject* pTextObj, | 49 FX_FLOAT _CalculateBaseSpace(const CPDF_TextObject* pTextObj, |
50 const CFX_AffineMatrix& matrix) | 50 const CFX_AffineMatrix& matrix) |
51 { | 51 { |
52 FX_FLOAT baseSpace = 0.0; | 52 FX_FLOAT baseSpace = 0.0; |
53 const int nItems = pTextObj->CountItems(); | 53 const int nItems = pTextObj->CountItems(); |
54 if (pTextObj->m_TextState.GetObject()->m_CharSpace && nItems >= 3) { | 54 if (pTextObj->m_TextState.GetObject()->m_CharSpace && nItems >= 3) { |
55 FX_BOOL bAllChar = TRUE; | 55 FX_BOOL bAllChar = TRUE; |
56 FX_FLOAT spacing = matrix.TransformDistance( | 56 FX_FLOAT spacing = matrix.TransformDistance( |
(...skipping 2783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2840 if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) { | 2840 if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) { |
2841 return; | 2841 return; |
2842 } | 2842 } |
2843 CPDF_LinkExt* link = NULL; | 2843 CPDF_LinkExt* link = NULL; |
2844 link = m_LinkList.GetAt(index); | 2844 link = m_LinkList.GetAt(index); |
2845 if (!link) { | 2845 if (!link) { |
2846 return ; | 2846 return ; |
2847 } | 2847 } |
2848 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); | 2848 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); |
2849 } | 2849 } |
OLD | NEW |