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

Side by Side Diff: third_party/WebKit/Source/core/layout/api/LineLayoutText.h

Issue 2833343002: Change SelectionStartEnd() returning values instead of assigning into ref args. (Closed)
Patch Set: rebase Created 3 years, 8 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef LineLayoutText_h 5 #ifndef LineLayoutText_h
6 #define LineLayoutText_h 6 #define LineLayoutText_h
7 7
8 #include "core/layout/LayoutText.h" 8 #include "core/layout/LayoutText.h"
9 #include "core/layout/api/LineLayoutItem.h" 9 #include "core/layout/api/LineLayoutItem.h"
10 #include "platform/LayoutUnit.h" 10 #include "platform/LayoutUnit.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 HashSet<const SimpleFontData*>* fallback_fonts = nullptr, 102 HashSet<const SimpleFontData*>* fallback_fonts = nullptr,
103 FloatRect* glyph_bounds = nullptr) const { 103 FloatRect* glyph_bounds = nullptr) const {
104 return ToText()->Width(from, len, x_pos, text_direction, first_line, 104 return ToText()->Width(from, len, x_pos, text_direction, first_line,
105 fallback_fonts, glyph_bounds); 105 fallback_fonts, glyph_bounds);
106 } 106 }
107 107
108 float HyphenWidth(const Font& font, TextDirection text_direction) { 108 float HyphenWidth(const Font& font, TextDirection text_direction) {
109 return ToText()->HyphenWidth(font, text_direction); 109 return ToText()->HyphenWidth(font, text_direction);
110 } 110 }
111 111
112 void SelectionStartEnd(int& spos, int& epos) const { 112 std::pair<int, int> SelectionStartEnd() const {
113 return ToText()->SelectionStartEnd(spos, epos); 113 return ToText()->SelectionStartEnd();
114 } 114 }
115 115
116 unsigned TextStartOffset() const { return ToText()->TextStartOffset(); } 116 unsigned TextStartOffset() const { return ToText()->TextStartOffset(); }
117 117
118 float MinLogicalWidth() const { return ToText()->MinLogicalWidth(); } 118 float MinLogicalWidth() const { return ToText()->MinLogicalWidth(); }
119 119
120 private: 120 private:
121 LayoutText* ToText() { return ToLayoutText(GetLayoutObject()); } 121 LayoutText* ToText() { return ToLayoutText(GetLayoutObject()); }
122 const LayoutText* ToText() const { return ToLayoutText(GetLayoutObject()); } 122 const LayoutText* ToText() const { return ToLayoutText(GetLayoutObject()); }
123 }; 123 };
124 124
125 } // namespace blink 125 } // namespace blink
126 126
127 #endif // LineLayoutText_h 127 #endif // LineLayoutText_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutText.cpp ('k') | third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698