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

Side by Side Diff: ui/gfx/selection_model.cc

Issue 8044004: Clean up of SelectionModel (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ui/gfx/selection_model.h" 5 #include "ui/gfx/selection_model.h"
6 6
7 namespace gfx { 7 namespace gfx {
8 8
9 SelectionModel::SelectionModel() { 9 SelectionModel::SelectionModel() {
10 Init(0, 0, 0, LEADING); 10 Init(0, 0, 0, LEADING);
11 } 11 }
12 12
13 SelectionModel::SelectionModel(size_t pos) { 13 SelectionModel::SelectionModel(size_t pos) {
14 Init(pos, pos, pos, LEADING); 14 Init(pos, pos, pos, LEADING);
15 } 15 }
16 16
17 SelectionModel::SelectionModel(size_t start, size_t end) { 17 SelectionModel::SelectionModel(size_t start, size_t end) {
18 Init(start, end, end, LEADING); 18 if (start < end)
msw 2011/09/29 02:20:21 Perhaps this condition deserves an explanation: "T
xji 2011/10/03 23:18:57 this ctor is removed.
19 Init(start, end, end, TRAILING_OF_PREVIOUS_GRAPHEME);
20 else
21 Init(start, end, end, LEADING);
19 } 22 }
20 23
21 SelectionModel::SelectionModel(size_t end, 24 SelectionModel::SelectionModel(size_t end,
22 size_t pos, 25 size_t pos,
23 CaretPlacement placement) { 26 CaretPlacement placement) {
24 Init(end, end, pos, placement); 27 Init(end, end, pos, placement);
25 } 28 }
26 29
27 SelectionModel::SelectionModel(size_t start, 30 SelectionModel::SelectionModel(size_t start,
28 size_t end, 31 size_t end,
(...skipping 16 matching lines...) Expand all
45 size_t end, 48 size_t end,
46 size_t pos, 49 size_t pos,
47 CaretPlacement placement) { 50 CaretPlacement placement) {
48 selection_start_ = start; 51 selection_start_ = start;
49 selection_end_ = end; 52 selection_end_ = end;
50 caret_pos_ = pos; 53 caret_pos_ = pos;
51 caret_placement_ = placement; 54 caret_placement_ = placement;
52 } 55 }
53 56
54 } // namespace gfx 57 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698