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

Side by Side Diff: pdf/pdfium/pdfium_engine.cc

Issue 1200053004: Move more string_util functions to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months 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 | « net/tools/dump_cache/url_utilities.cc ('k') | rlz/lib/rlz_lib.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium 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 #include "pdf/pdfium/pdfium_engine.h" 5 #include "pdf/pdfium/pdfium_engine.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "base/i18n/icu_encoding_detection.h" 9 #include "base/i18n/icu_encoding_detection.h"
10 #include "base/i18n/icu_string_conversions.h" 10 #include "base/i18n/icu_string_conversions.h"
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 const base::char16 kPdfiumHyphenEOL = 0xfffe; 465 const base::char16 kPdfiumHyphenEOL = 0xfffe;
466 466
467 for (size_t i = 0; i < text->size(); ++i) { 467 for (size_t i = 0; i < text->size(); ++i) {
468 const base::char16& current_char = (*text)[i]; 468 const base::char16& current_char = (*text)[i];
469 if (current_char == kPdfiumHyphenEOL) { 469 if (current_char == kPdfiumHyphenEOL) {
470 if (current_hyphen_position_is_valid) 470 if (current_hyphen_position_is_valid)
471 hyphen_positions.push_back(current_hyphen_position); 471 hyphen_positions.push_back(current_hyphen_position);
472 current_hyphen_position = HyphenPosition(); 472 current_hyphen_position = HyphenPosition();
473 current_hyphen_position.position = i; 473 current_hyphen_position.position = i;
474 current_hyphen_position_is_valid = true; 474 current_hyphen_position_is_valid = true;
475 } else if (IsWhitespace(current_char)) { 475 } else if (base::IsUnicodeWhitespace(current_char)) {
476 if (current_hyphen_position_is_valid) { 476 if (current_hyphen_position_is_valid) {
477 if (current_char != L'\r' && current_char != L'\n') 477 if (current_char != L'\r' && current_char != L'\n')
478 current_hyphen_position.next_whitespace_position = i; 478 current_hyphen_position.next_whitespace_position = i;
479 hyphen_positions.push_back(current_hyphen_position); 479 hyphen_positions.push_back(current_hyphen_position);
480 current_hyphen_position_is_valid = false; 480 current_hyphen_position_is_valid = false;
481 } 481 }
482 } 482 }
483 } 483 }
484 if (current_hyphen_position_is_valid) 484 if (current_hyphen_position_is_valid)
485 hyphen_positions.push_back(current_hyphen_position); 485 hyphen_positions.push_back(current_hyphen_position);
(...skipping 3545 matching lines...) Expand 10 before | Expand all | Expand 10 after
4031 double* height) { 4031 double* height) {
4032 FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, NULL); 4032 FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, NULL);
4033 if (!doc) 4033 if (!doc)
4034 return false; 4034 return false;
4035 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; 4035 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0;
4036 FPDF_CloseDocument(doc); 4036 FPDF_CloseDocument(doc);
4037 return success; 4037 return success;
4038 } 4038 }
4039 4039
4040 } // namespace chrome_pdf 4040 } // namespace chrome_pdf
OLDNEW
« no previous file with comments | « net/tools/dump_cache/url_utilities.cc ('k') | rlz/lib/rlz_lib.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698