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

Unified Diff: core/fxge/ge/fx_ge_text.cpp

Issue 2640143003: Update safe numerics package to get bitwise ops (Closed)
Patch Set: 0 is a perfectly fine value of zero Created 3 years, 11 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
Index: core/fxge/ge/fx_ge_text.cpp
diff --git a/core/fxge/ge/fx_ge_text.cpp b/core/fxge/ge/fx_ge_text.cpp
index ca88879d1087c2d4607e65cc29292f1b29fafe5c..3c919c44f525ac6109078299cc8b25a7c899dcaf 100644
--- a/core/fxge/ge/fx_ge_text.cpp
+++ b/core/fxge/ge/fx_ge_text.cpp
@@ -79,10 +79,14 @@ FX_RECT FXGE_GetGlyphsBBox(const std::vector<FXTEXT_GLYPHPOS>& glyphs,
continue;
if (bStarted) {
- rect.left = std::min(rect.left, char_left.ValueOrDie());
- rect.right = std::max(rect.right, char_right.ValueOrDie());
- rect.top = std::min(rect.top, char_top.ValueOrDie());
- rect.bottom = std::max(rect.bottom, char_bottom.ValueOrDie());
+ rect.left =
+ std::min(rect.left, static_cast<int>(char_left.ValueOrDie<int>()));
jschuh 2017/01/23 17:05:19 Same as above. This is what CheckMax() is for.
Tom Sepez 2017/01/23 18:19:14 Done.
+ rect.right =
+ std::max(rect.right, static_cast<int>(char_right.ValueOrDie<int>()));
+ rect.top =
+ std::min(rect.top, static_cast<int>(char_top.ValueOrDie<int>()));
+ rect.bottom = std::max(rect.bottom,
+ static_cast<int>(char_bottom.ValueOrDie<int>()));
continue;
}

Powered by Google App Engine
This is Rietveld 408576698