ensure insert has worked

This commit is contained in:
artemp 2017-02-17 15:40:37 +01:00
parent e55918788c
commit 20cafae780

View file

@ -151,13 +151,15 @@ static void shape_text(text_line & line,
// if we have a valid codepoint, save rendering info. // if we have a valid codepoint, save rendering info.
auto itr = glyphinfos.find(cluster); auto itr = glyphinfos.find(cluster);
bool status = true;
if (itr == glyphinfos.end()) if (itr == glyphinfos.end())
{ {
std::vector<glyph_face_info> v = {{ face, glyphs[i], positions[i] }}; std::vector<glyph_face_info> v = {{ face, glyphs[i], positions[i] }};
bool result = false; std::tie(itr, status) = glyphinfos.insert(std::make_pair(cluster, v));
std::tie(itr, result) = glyphinfos.insert(std::make_pair(cluster, v));
} }
if (status)
{
if (itr->second.front().glyph.codepoint == 0) if (itr->second.front().glyph.codepoint == 0)
{ {
itr->second.front() = { face, glyphs[i], positions[i] }; itr->second.front() = { face, glyphs[i], positions[i] };
@ -167,6 +169,7 @@ static void shape_text(text_line & line,
itr->second.push_back({ face, glyphs[i], positions[i] }); itr->second.push_back({ face, glyphs[i], positions[i] });
} }
} }
}
bool all_set = true; bool all_set = true;
for (auto c : clusters) for (auto c : clusters)