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 <cctype> |
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" |
11 #include "../../include/fpdfapi/fpdf_module.h" | 11 #include "../../include/fpdfapi/fpdf_module.h" |
12 #include "../../include/fpdfapi/fpdf_page.h" | 12 #include "../../include/fpdfapi/fpdf_page.h" |
13 #include "../../include/fpdfapi/fpdf_pageobj.h" | 13 #include "../../include/fpdfapi/fpdf_pageobj.h" |
14 #include "../../include/fpdfapi/fpdf_resource.h" | 14 #include "../../include/fpdfapi/fpdf_resource.h" |
15 #include "../../include/fpdftext/fpdf_text.h" | 15 #include "../../include/fpdftext/fpdf_text.h" |
16 #include "../../include/fxcrt/fx_bidi.h" | 16 #include "../../include/fxcrt/fx_bidi.h" |
17 #include "../../include/fxcrt/fx_ucd.h" | 17 #include "../../include/fxcrt/fx_ucd.h" |
(...skipping 2408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2426 return TRUE; | 2426 return TRUE; |
2427 } | 2427 } |
2428 if (startPos - 1 >= 0) { | 2428 if (startPos - 1 >= 0) { |
2429 char_left = csPageText.GetAt(startPos - 1); | 2429 char_left = csPageText.GetAt(startPos - 1); |
2430 } | 2430 } |
2431 if (startPos + char_count < csPageText.GetLength()) { | 2431 if (startPos + char_count < csPageText.GetLength()) { |
2432 char_right = csPageText.GetAt(startPos + char_count); | 2432 char_right = csPageText.GetAt(startPos + char_count); |
2433 } | 2433 } |
2434 if ((char_left > 'A' && char_left < 'a') || | 2434 if ((char_left > 'A' && char_left < 'a') || |
2435 (char_left > 'a' && char_left < 'z') || | 2435 (char_left > 'a' && char_left < 'z') || |
2436 (char_left > 0xfb00 && char_left < 0xfb06) || | 2436 (char_left > 0xfb00 && char_left < 0xfb06) || std::isdigit(char_left) || |
Tom Sepez
2015/11/04 18:42:45
again, these are wide chars. so std:iswdigit() Us
dsinclair
2015/11/04 20:16:24
Done.
| |
2437 (char_left >= '0' && char_left <= '9') || | |
2438 (char_right > 'A' && char_right < 'a') || | 2437 (char_right > 'A' && char_right < 'a') || |
2439 (char_right > 'a' && char_right < 'z') || | 2438 (char_right > 'a' && char_right < 'z') || |
2440 (char_right > 0xfb00 && char_right < 0xfb06) || | 2439 (char_right > 0xfb00 && char_right < 0xfb06) || |
2441 (char_right >= '0' && char_right <= '9')) { | 2440 std::isdigit(char_right)) { |
2442 return FALSE; | 2441 return FALSE; |
2443 } | 2442 } |
2444 if (!(('A' > char_left || char_left > 'Z') && | 2443 if (!(('A' > char_left || char_left > 'Z') && |
2445 ('a' > char_left || char_left > 'z') && | 2444 ('a' > char_left || char_left > 'z') && |
2446 ('A' > char_right || char_right > 'Z') && | 2445 ('A' > char_right || char_right > 'Z') && |
2447 ('a' > char_right || char_right > 'z'))) { | 2446 ('a' > char_right || char_right > 'z'))) { |
2448 return FALSE; | 2447 return FALSE; |
2449 } | 2448 } |
2450 if (char_count > 0) { | 2449 if (char_count > 0) { |
2451 if (csPageText.GetAt(startPos) >= L'0' && | 2450 if (csPageText.GetAt(startPos) >= L'0' && |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2726 if (!m_bIsParsed || index < 0 || index >= m_LinkList.GetSize()) { | 2725 if (!m_bIsParsed || index < 0 || index >= m_LinkList.GetSize()) { |
2727 return; | 2726 return; |
2728 } | 2727 } |
2729 CPDF_LinkExt* link = NULL; | 2728 CPDF_LinkExt* link = NULL; |
2730 link = m_LinkList.GetAt(index); | 2729 link = m_LinkList.GetAt(index); |
2731 if (!link) { | 2730 if (!link) { |
2732 return; | 2731 return; |
2733 } | 2732 } |
2734 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); | 2733 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); |
2735 } | 2734 } |
OLD | NEW |