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

Side by Side Diff: third_party/WebKit/Source/platform/text/LocaleWin.cpp

Issue 2502413004: WTF/std normalization: replace WTF::Vector::last with ::back (Closed)
Patch Set: rebase Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 LOCALE_SABBREVMONTHNAME1, LOCALE_SABBREVMONTHNAME2, 142 LOCALE_SABBREVMONTHNAME1, LOCALE_SABBREVMONTHNAME2,
143 LOCALE_SABBREVMONTHNAME3, LOCALE_SABBREVMONTHNAME4, 143 LOCALE_SABBREVMONTHNAME3, LOCALE_SABBREVMONTHNAME4,
144 LOCALE_SABBREVMONTHNAME5, LOCALE_SABBREVMONTHNAME6, 144 LOCALE_SABBREVMONTHNAME5, LOCALE_SABBREVMONTHNAME6,
145 LOCALE_SABBREVMONTHNAME7, LOCALE_SABBREVMONTHNAME8, 145 LOCALE_SABBREVMONTHNAME7, LOCALE_SABBREVMONTHNAME8,
146 LOCALE_SABBREVMONTHNAME9, LOCALE_SABBREVMONTHNAME10, 146 LOCALE_SABBREVMONTHNAME9, LOCALE_SABBREVMONTHNAME10,
147 LOCALE_SABBREVMONTHNAME11, LOCALE_SABBREVMONTHNAME12, 147 LOCALE_SABBREVMONTHNAME11, LOCALE_SABBREVMONTHNAME12,
148 }; 148 };
149 m_shortMonthLabels.reserveCapacity(WTF_ARRAY_LENGTH(types)); 149 m_shortMonthLabels.reserveCapacity(WTF_ARRAY_LENGTH(types));
150 for (unsigned i = 0; i < WTF_ARRAY_LENGTH(types); ++i) { 150 for (unsigned i = 0; i < WTF_ARRAY_LENGTH(types); ++i) {
151 m_shortMonthLabels.append(getLocaleInfoString(types[i])); 151 m_shortMonthLabels.append(getLocaleInfoString(types[i]));
152 if (m_shortMonthLabels.last().isEmpty()) { 152 if (m_shortMonthLabels.back().isEmpty()) {
153 m_shortMonthLabels.shrink(0); 153 m_shortMonthLabels.shrink(0);
154 m_shortMonthLabels.reserveCapacity(WTF_ARRAY_LENGTH(WTF::monthName)); 154 m_shortMonthLabels.reserveCapacity(WTF_ARRAY_LENGTH(WTF::monthName));
155 for (unsigned m = 0; m < WTF_ARRAY_LENGTH(WTF::monthName); ++m) 155 for (unsigned m = 0; m < WTF_ARRAY_LENGTH(WTF::monthName); ++m)
156 m_shortMonthLabels.append(WTF::monthName[m]); 156 m_shortMonthLabels.append(WTF::monthName[m]);
157 return; 157 return;
158 } 158 }
159 } 159 }
160 } 160 }
161 161
162 // -------------------------------- Tokenized date format 162 // -------------------------------- Tokenized date format
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 return; 268 return;
269 const LCTYPE types[12] = { 269 const LCTYPE types[12] = {
270 LOCALE_SMONTHNAME1, LOCALE_SMONTHNAME2, LOCALE_SMONTHNAME3, 270 LOCALE_SMONTHNAME1, LOCALE_SMONTHNAME2, LOCALE_SMONTHNAME3,
271 LOCALE_SMONTHNAME4, LOCALE_SMONTHNAME5, LOCALE_SMONTHNAME6, 271 LOCALE_SMONTHNAME4, LOCALE_SMONTHNAME5, LOCALE_SMONTHNAME6,
272 LOCALE_SMONTHNAME7, LOCALE_SMONTHNAME8, LOCALE_SMONTHNAME9, 272 LOCALE_SMONTHNAME7, LOCALE_SMONTHNAME8, LOCALE_SMONTHNAME9,
273 LOCALE_SMONTHNAME10, LOCALE_SMONTHNAME11, LOCALE_SMONTHNAME12, 273 LOCALE_SMONTHNAME10, LOCALE_SMONTHNAME11, LOCALE_SMONTHNAME12,
274 }; 274 };
275 m_monthLabels.reserveCapacity(WTF_ARRAY_LENGTH(types)); 275 m_monthLabels.reserveCapacity(WTF_ARRAY_LENGTH(types));
276 for (unsigned i = 0; i < WTF_ARRAY_LENGTH(types); ++i) { 276 for (unsigned i = 0; i < WTF_ARRAY_LENGTH(types); ++i) {
277 m_monthLabels.append(getLocaleInfoString(types[i])); 277 m_monthLabels.append(getLocaleInfoString(types[i]));
278 if (m_monthLabels.last().isEmpty()) { 278 if (m_monthLabels.back().isEmpty()) {
279 m_monthLabels.shrink(0); 279 m_monthLabels.shrink(0);
280 m_monthLabels.reserveCapacity(WTF_ARRAY_LENGTH(WTF::monthFullName)); 280 m_monthLabels.reserveCapacity(WTF_ARRAY_LENGTH(WTF::monthFullName));
281 for (unsigned m = 0; m < WTF_ARRAY_LENGTH(WTF::monthFullName); ++m) 281 for (unsigned m = 0; m < WTF_ARRAY_LENGTH(WTF::monthFullName); ++m)
282 m_monthLabels.append(WTF::monthFullName[m]); 282 m_monthLabels.append(WTF::monthFullName[m]);
283 return; 283 return;
284 } 284 }
285 } 285 }
286 } 286 }
287 287
288 void LocaleWin::ensureWeekDayShortLabels() { 288 void LocaleWin::ensureWeekDayShortLabels() {
289 if (!m_weekDayShortLabels.isEmpty()) 289 if (!m_weekDayShortLabels.isEmpty())
290 return; 290 return;
291 const LCTYPE types[7] = {LOCALE_SABBREVDAYNAME7, // Sunday 291 const LCTYPE types[7] = {LOCALE_SABBREVDAYNAME7, // Sunday
292 LOCALE_SABBREVDAYNAME1, // Monday 292 LOCALE_SABBREVDAYNAME1, // Monday
293 LOCALE_SABBREVDAYNAME2, LOCALE_SABBREVDAYNAME3, 293 LOCALE_SABBREVDAYNAME2, LOCALE_SABBREVDAYNAME3,
294 LOCALE_SABBREVDAYNAME4, LOCALE_SABBREVDAYNAME5, 294 LOCALE_SABBREVDAYNAME4, LOCALE_SABBREVDAYNAME5,
295 LOCALE_SABBREVDAYNAME6}; 295 LOCALE_SABBREVDAYNAME6};
296 m_weekDayShortLabels.reserveCapacity(WTF_ARRAY_LENGTH(types)); 296 m_weekDayShortLabels.reserveCapacity(WTF_ARRAY_LENGTH(types));
297 for (unsigned i = 0; i < WTF_ARRAY_LENGTH(types); ++i) { 297 for (unsigned i = 0; i < WTF_ARRAY_LENGTH(types); ++i) {
298 m_weekDayShortLabels.append(getLocaleInfoString(types[i])); 298 m_weekDayShortLabels.append(getLocaleInfoString(types[i]));
299 if (m_weekDayShortLabels.last().isEmpty()) { 299 if (m_weekDayShortLabels.back().isEmpty()) {
300 m_weekDayShortLabels.shrink(0); 300 m_weekDayShortLabels.shrink(0);
301 m_weekDayShortLabels.reserveCapacity(WTF_ARRAY_LENGTH(WTF::weekdayName)); 301 m_weekDayShortLabels.reserveCapacity(WTF_ARRAY_LENGTH(WTF::weekdayName));
302 for (unsigned w = 0; w < WTF_ARRAY_LENGTH(WTF::weekdayName); ++w) { 302 for (unsigned w = 0; w < WTF_ARRAY_LENGTH(WTF::weekdayName); ++w) {
303 // weekdayName starts with Monday. 303 // weekdayName starts with Monday.
304 m_weekDayShortLabels.append(WTF::weekdayName[(w + 6) % 7]); 304 m_weekDayShortLabels.append(WTF::weekdayName[(w + 6) % 7]);
305 } 305 }
306 return; 306 return;
307 } 307 }
308 } 308 }
309 } 309 }
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 case NegativeFormatSignPrefix: // Fall through. 489 case NegativeFormatSignPrefix: // Fall through.
490 default: 490 default:
491 negativePrefix = negativeSign; 491 negativePrefix = negativeSign;
492 break; 492 break;
493 } 493 }
494 m_didInitializeNumberData = true; 494 m_didInitializeNumberData = true;
495 setLocaleData(symbols, emptyString(), emptyString(), negativePrefix, 495 setLocaleData(symbols, emptyString(), emptyString(), negativePrefix,
496 negativeSuffix); 496 negativeSuffix);
497 } 497 }
498 } 498 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/text/BidiContext.cpp ('k') | third_party/WebKit/Source/wtf/Vector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698