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

Unified Diff: ui/gfx/selection_model.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/selection_model.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/selection_model.cc
===================================================================
--- ui/gfx/selection_model.cc (revision 137657)
+++ ui/gfx/selection_model.cc (working copy)
@@ -4,7 +4,8 @@
#include "ui/gfx/selection_model.h"
-#include <ostream>
+#include "base/format_macros.h"
+#include "base/stringprintf.h"
namespace gfx {
@@ -23,14 +24,14 @@
caret_affinity_ == sel.caret_affinity();
}
-std::ostream& operator<<(std::ostream& out, const SelectionModel& sel) {
- out << '{';
- if (sel.selection().is_empty())
- out << sel.caret_pos();
+std::string SelectionModel::ToString() const {
+ std::string str = "{";
+ if (selection().is_empty())
+ base::StringAppendF(&str, "%" PRIuS, caret_pos());
else
- out << sel.selection();
- bool backward = sel.caret_affinity() == CURSOR_BACKWARD;
- return out << (backward ? ",BACKWARD}" : ",FORWARD}");
+ str += selection().ToString();
+ const bool backward = caret_affinity() == CURSOR_BACKWARD;
+ return str + (backward ? ",BACKWARD}" : ",FORWARD}");
}
} // namespace gfx
« no previous file with comments | « ui/gfx/selection_model.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698