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

Side by Side Diff: app/l10n_util.cc

Issue 347019: Convert ReplaceStringPlaceholders(std::string...) to take a (Closed)
Patch Set: a Created 11 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 | « no previous file | base/string_util.h » ('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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "app/l10n_util.h" 5 #include "app/l10n_util.h"
6 6
7 #include <cstdlib> 7 #include <cstdlib>
8 #include "app/app_paths.h" 8 #include "app/app_paths.h"
9 #include "app/app_switches.h" 9 #include "app/app_switches.h"
10 #include "app/gfx/canvas.h" 10 #include "app/gfx/canvas.h"
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 518 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
519 return rb.GetLocalizedString(message_id); 519 return rb.GetLocalizedString(message_id);
520 } 520 }
521 521
522 static string16 GetStringF(int message_id, 522 static string16 GetStringF(int message_id,
523 const string16& a, 523 const string16& a,
524 const string16& b, 524 const string16& b,
525 const string16& c, 525 const string16& c,
526 const string16& d, 526 const string16& d,
527 std::vector<size_t>* offsets) { 527 std::vector<size_t>* offsets) {
528 // TODO(tc): We could save a string copy if we got the raw string as
529 // a StringPiece and were able to call ReplaceStringPlaceholders with
530 // a StringPiece format string and string16 substitution strings. In
531 // practice, the strings should be relatively short.
528 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 532 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
529 const string16& format_string = rb.GetLocalizedString(message_id); 533 const string16& format_string = rb.GetLocalizedString(message_id);
530 std::vector<string16> subst; 534 std::vector<string16> subst;
531 subst.push_back(a); 535 subst.push_back(a);
532 subst.push_back(b); 536 subst.push_back(b);
533 subst.push_back(c); 537 subst.push_back(c);
534 subst.push_back(d); 538 subst.push_back(d);
535 string16 formatted = ReplaceStringPlaceholders(format_string, subst, 539 string16 formatted = ReplaceStringPlaceholders(format_string, subst,
536 offsets); 540 offsets);
537 return formatted; 541 return formatted;
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 } 1035 }
1032 1036
1033 void BiDiLineIterator::GetLogicalRun(int start, 1037 void BiDiLineIterator::GetLogicalRun(int start,
1034 int* end, 1038 int* end,
1035 UBiDiLevel* level) { 1039 UBiDiLevel* level) {
1036 DCHECK(bidi_ != NULL); 1040 DCHECK(bidi_ != NULL);
1037 ubidi_getLogicalRun(bidi_, start, end, level); 1041 ubidi_getLogicalRun(bidi_, start, end, level);
1038 } 1042 }
1039 1043
1040 } 1044 }
OLDNEW
« no previous file with comments | « no previous file | base/string_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698