From f78a43a4efedbf6d462b518236f79677a5241fc2 Mon Sep 17 00:00:00 2001 From: Ben Konyi Date: Fri, 8 Dec 2017 16:19:44 -0800 Subject: [PATCH] Fixed failure on Windows in paragraph.cc which was surfaced by enabling flutter_tester.exe build on bots. --- third_party/txt/src/txt/paragraph.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/third_party/txt/src/txt/paragraph.cc b/third_party/txt/src/txt/paragraph.cc index f72b347b1025d..c92b4ede3586f 100644 --- a/third_party/txt/src/txt/paragraph.cc +++ b/third_party/txt/src/txt/paragraph.cc @@ -268,8 +268,8 @@ bool Paragraph::ComputeBidiRuns() { ? UBIDI_DEFAULT_RTL : UBIDI_DEFAULT_LTR; UErrorCode status = U_ZERO_ERROR; - ubidi_setPara(bidi.get(), text_.data(), text_.size(), paraLevel, nullptr, - &status); + ubidi_setPara(bidi.get(), reinterpret_cast(text_.data()), + text_.size(), paraLevel, nullptr, &status); if (!U_SUCCESS(status)) return false; @@ -939,9 +939,11 @@ Paragraph::PositionWithAffinity Paragraph::GetGlyphPositionAtCoordinate( const std::vector& line_glyph_position = glyph_lines_[y_index].positions; if (line_glyph_position.empty()) { - int line_start_index = std::accumulate( - glyph_lines_.begin(), glyph_lines_.begin() + y_index, 0, - [](const int a, const GlyphLine& b) { return a + b.total_code_units; }); + int line_start_index = + std::accumulate(glyph_lines_.begin(), glyph_lines_.begin() + y_index, 0, + [](const int a, const GlyphLine& b) { + return a + static_cast(b.total_code_units); + }); return PositionWithAffinity(line_start_index, DOWNSTREAM); }