Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(660)

Side by Side Diff: core/src/fpdftext/fpdf_text_int.cpp

Issue 1431683008: Revert "Revert "Revert "Cleanup some numeric code.""" (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/src/fpdftext/fpdf_text.cpp ('k') | core/src/fxcodec/codec/fx_codec.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2415 matching lines...) Expand 10 before | Expand all | Expand 10 after
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) || std::isdigit(char_left) || 2436 (char_left > 0xfb00 && char_left < 0xfb06) ||
2437 (char_left >= '0' && char_left <= '9') ||
2437 (char_right > 'A' && char_right < 'a') || 2438 (char_right > 'A' && char_right < 'a') ||
2438 (char_right > 'a' && char_right < 'z') || 2439 (char_right > 'a' && char_right < 'z') ||
2439 (char_right > 0xfb00 && char_right < 0xfb06) || 2440 (char_right > 0xfb00 && char_right < 0xfb06) ||
2440 std::isdigit(char_right)) { 2441 (char_right >= '0' && char_right <= '9')) {
2441 return FALSE; 2442 return FALSE;
2442 } 2443 }
2443 if (!(('A' > char_left || char_left > 'Z') && 2444 if (!(('A' > char_left || char_left > 'Z') &&
2444 ('a' > char_left || char_left > 'z') && 2445 ('a' > char_left || char_left > 'z') &&
2445 ('A' > char_right || char_right > 'Z') && 2446 ('A' > char_right || char_right > 'Z') &&
2446 ('a' > char_right || char_right > 'z'))) { 2447 ('a' > char_right || char_right > 'z'))) {
2447 return FALSE; 2448 return FALSE;
2448 } 2449 }
2449 if (char_count > 0) { 2450 if (char_count > 0) {
2450 if (csPageText.GetAt(startPos) >= L'0' && 2451 if (csPageText.GetAt(startPos) >= L'0' &&
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
2725 if (!m_bIsParsed || index < 0 || index >= m_LinkList.GetSize()) { 2726 if (!m_bIsParsed || index < 0 || index >= m_LinkList.GetSize()) {
2726 return; 2727 return;
2727 } 2728 }
2728 CPDF_LinkExt* link = NULL; 2729 CPDF_LinkExt* link = NULL;
2729 link = m_LinkList.GetAt(index); 2730 link = m_LinkList.GetAt(index);
2730 if (!link) { 2731 if (!link) {
2731 return; 2732 return;
2732 } 2733 }
2733 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); 2734 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects);
2734 } 2735 }
OLDNEW
« no previous file with comments | « core/src/fpdftext/fpdf_text.cpp ('k') | core/src/fxcodec/codec/fx_codec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698