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

Side by Side Diff: ui/base/range/range.cc

Issue 10332205: Fix logging of string16s from gfx namespace on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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
« no previous file with comments | « ui/base/range/range.h ('k') | ui/gfx/render_text.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/base/range/range.h" 5 #include "ui/base/range/range.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <ostream>
9 8
9 #include "base/format_macros.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/stringprintf.h"
11 12
12 namespace ui { 13 namespace ui {
13 14
14 Range::Range() 15 Range::Range()
15 : start_(0), 16 : start_(0),
16 end_(0) { 17 end_(0) {
17 } 18 }
18 19
19 Range::Range(size_t start, size_t end) 20 Range::Range(size_t start, size_t end)
20 : start_(start), 21 : start_(start),
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 Range Range::Intersect(const Range& range) const { 69 Range Range::Intersect(const Range& range) const {
69 size_t min = std::max(GetMin(), range.GetMin()); 70 size_t min = std::max(GetMin(), range.GetMin());
70 size_t max = std::min(GetMax(), range.GetMax()); 71 size_t max = std::min(GetMax(), range.GetMax());
71 72
72 if (min >= max) // No intersection. 73 if (min >= max) // No intersection.
73 return InvalidRange(); 74 return InvalidRange();
74 75
75 return Range(min, max); 76 return Range(min, max);
76 } 77 }
77 78
78 std::ostream& operator<<(std::ostream& out, const ui::Range& range) { 79 std::string Range::ToString() const {
79 return out << "{" << range.start() << "," << range.end() << "}"; 80 return base::StringPrintf("{%" PRIuS ",%" PRIuS "}", start(), end());
80 } 81 }
81 82
82 } // namespace gfx 83 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/base/range/range.h ('k') | ui/gfx/render_text.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698