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

Unified Diff: ui/views/controls/textfield/textfield_model.cc

Issue 2126433002: Use container::back() and container::pop_back() in ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pre-increment Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_device.cc ('k') | ui/views/layout/grid_layout.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/textfield_model.cc
diff --git a/ui/views/controls/textfield/textfield_model.cc b/ui/views/controls/textfield/textfield_model.cc
index 297ea1978cb84132388d102cbef5833fa8ade271..7c6d5917f209fdcfbc0b5bb6c1c71ad1622e0044 100644
--- a/ui/views/controls/textfield/textfield_model.cc
+++ b/ui/views/controls/textfield/textfield_model.cc
@@ -441,7 +441,7 @@ bool TextfieldModel::CanUndo() {
}
bool TextfieldModel::CanRedo() {
- if (!edit_history_.size())
+ if (edit_history_.empty())
return false;
// There is no redo iff the current edit is the last element in the history.
EditHistory::iterator iter = current_edit_;
@@ -464,7 +464,7 @@ bool TextfieldModel::Undo() {
if (current_edit_ == edit_history_.begin())
current_edit_ = edit_history_.end();
else
- current_edit_--;
+ --current_edit_;
return old != text() || old_cursor != GetCursorPosition();
}
@@ -478,7 +478,7 @@ bool TextfieldModel::Redo() {
if (current_edit_ == edit_history_.end())
current_edit_ = edit_history_.begin();
else
- current_edit_ ++;
+ ++current_edit_;
base::string16 old = text();
size_t old_cursor = GetCursorPosition();
(*current_edit_)->Redo(this);
@@ -716,7 +716,7 @@ void TextfieldModel::ClearRedoHistory() {
return;
}
EditHistory::iterator delete_start = current_edit_;
- delete_start++;
+ ++delete_start;
STLDeleteContainerPointers(delete_start, edit_history_.end());
edit_history_.erase(delete_start, edit_history_.end());
}
@@ -789,7 +789,7 @@ bool TextfieldModel::AddOrMergeEditHistory(Edit* edit) {
DCHECK_EQ(1u, edit_history_.size());
current_edit_ = edit_history_.begin();
} else {
- current_edit_++;
+ ++current_edit_;
}
return false;
}
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_device.cc ('k') | ui/views/layout/grid_layout.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698