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

Side by Side Diff: third_party/WebKit/Source/core/style/QuotesData.cpp

Issue 2617783002: Migrate WTF::Vector::append() to ::push_back() [part 12 of N] (Closed)
Patch Set: rebase Created 3 years, 11 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
OLDNEW
1 /** 1 /**
2 * Copyright (C) 2011 Nokia Inc. All rights reserved. 2 * Copyright (C) 2011 Nokia Inc. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 16 matching lines...) Expand all
27 UChar close1, 27 UChar close1,
28 UChar open2, 28 UChar open2,
29 UChar close2) { 29 UChar close2) {
30 RefPtr<QuotesData> data = QuotesData::create(); 30 RefPtr<QuotesData> data = QuotesData::create();
31 data->addPair(std::make_pair(String(&open1, 1), String(&close1, 1))); 31 data->addPair(std::make_pair(String(&open1, 1), String(&close1, 1)));
32 data->addPair(std::make_pair(String(&open2, 1), String(&close2, 1))); 32 data->addPair(std::make_pair(String(&open2, 1), String(&close2, 1)));
33 return data; 33 return data;
34 } 34 }
35 35
36 void QuotesData::addPair(std::pair<String, String> quotePair) { 36 void QuotesData::addPair(std::pair<String, String> quotePair) {
37 m_quotePairs.append(quotePair); 37 m_quotePairs.push_back(quotePair);
38 } 38 }
39 39
40 const String QuotesData::getOpenQuote(int index) const { 40 const String QuotesData::getOpenQuote(int index) const {
41 ASSERT(index >= 0); 41 ASSERT(index >= 0);
42 if (!m_quotePairs.size() || index < 0) 42 if (!m_quotePairs.size() || index < 0)
43 return emptyString(); 43 return emptyString();
44 if ((size_t)index >= m_quotePairs.size()) 44 if ((size_t)index >= m_quotePairs.size())
45 return m_quotePairs.back().first; 45 return m_quotePairs.back().first;
46 return m_quotePairs.at(index).first; 46 return m_quotePairs.at(index).first;
47 } 47 }
48 48
49 const String QuotesData::getCloseQuote(int index) const { 49 const String QuotesData::getCloseQuote(int index) const {
50 ASSERT(index >= -1); 50 ASSERT(index >= -1);
51 if (!m_quotePairs.size() || index < 0) 51 if (!m_quotePairs.size() || index < 0)
52 return emptyString(); 52 return emptyString();
53 if ((size_t)index >= m_quotePairs.size()) 53 if ((size_t)index >= m_quotePairs.size())
54 return m_quotePairs.back().second; 54 return m_quotePairs.back().second;
55 return m_quotePairs.at(index).second; 55 return m_quotePairs.at(index).second;
56 } 56 }
57 57
58 } // namespace blink 58 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/FilterOperationsTest.cpp ('k') | third_party/WebKit/Source/core/style/ShadowList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698