diff options
author | Martin Hosken <martin_hosken@sil.org> | 2016-02-15 10:08:19 +0700 |
---|---|---|
committer | Martin Hosken <martin_hosken@sil.org> | 2016-02-15 04:17:39 +0000 |
commit | b073d9f2e35dd0b6cdbc66e31050250a6f34cc55 (patch) | |
tree | 443820c3d05334173328b58211051aeeca982888 | |
parent | a8232b30687879f31768b89f4ff0bcf9457a7e77 (diff) |
Tidy up graphite layout code after fixing line ending diacritics
Change-Id: I1efafbd64539ac6d71de0be41ecaa71533143590
Reviewed-on: https://gerrit.libreoffice.org/22362
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Martin Hosken <martin_hosken@sil.org>
-rw-r--r-- | vcl/source/glyphs/graphite_layout.cxx | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx index 8226c9c0e2ee..dcdd31dafd1b 100644 --- a/vcl/source/glyphs/graphite_layout.cxx +++ b/vcl/source/glyphs/graphite_layout.cxx @@ -668,27 +668,24 @@ void GraphiteLayout::expandOrCondense(ImplLayoutArgs &rArgs) unsigned int GraphiteLayout::ScanFwdForChar(int &findChar, bool fallback) const { int res = mvChar2Glyph[findChar - mnMinCharPos]; - int done = 3; - while (res == -1 && --done) + if (res >= 0) + return unsigned(res); + if (fallback) { - if (fallback) - { - for (++findChar; findChar - mnMinCharPos < int(mvChar2Glyph.size()); ++findChar) - if ((res = mvChar2Glyph[findChar - mnMinCharPos]) != -1) - return res; - --findChar; - return mvGlyphs.size() - 1; - } - else - { - for (--findChar; findChar >= mnMinCharPos; --findChar) - if ((res = mvChar2Glyph[findChar - mnMinCharPos]) != -1) - return res; - ++findChar; - return 0; - } + for (++findChar; findChar - mnMinCharPos < int(mvChar2Glyph.size()); ++findChar) + if ((res = mvChar2Glyph[findChar - mnMinCharPos]) != -1) + return res; + --findChar; + return mvGlyphs.size() - 1; + } + else + { + for (--findChar; findChar >= mnMinCharPos; --findChar) + if ((res = mvChar2Glyph[findChar - mnMinCharPos]) != -1) + return res; + ++findChar; + return 0; } - return unsigned(res); } void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDeltaWidth) |