[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - vcl/source
Justin Luth
justin_luth at sil.org
Wed Feb 24 09:15:34 UTC 2016
vcl/source/glyphs/graphite_layout.cxx | 36 +++++++++++++++++-----------------
1 file changed, 18 insertions(+), 18 deletions(-)
New commits:
commit d0b16f53d3372d4176ea1a119de8d04f2aa05ad4
Author: Justin Luth <justin_luth at sil.org>
Date: Tue Feb 23 13:56:11 2016 +0300
Fix and tidy-up graphite line final diacritics
cherry-pick of commits f2df80410b34faa88740f2c0c2b021c74a19d5ca
and b073d9f2e35dd0b6cdbc66e31050250a6f34cc55
Change-Id: Iff0218255d0631dc7f97e7fa0eb150544a34da5d
Reviewed-on: https://gerrit.libreoffice.org/22640
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Martin Hosken <martin_hosken at sil.org>
diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx
index cb9a962..22eaf94 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -668,24 +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;
- }
- else
- {
- for (--findChar; findChar >= mnMinCharPos; --findChar)
- if ((res = mvChar2Glyph[findChar - mnMinCharPos]) != -1)
- return res;
- }
- fallback = !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;
}
- return unsigned(res);
}
void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDeltaWidth)
@@ -693,8 +693,8 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDelt
bool bRtl(mnLayoutFlags & SalLayoutFlags::BiDiRtl);
int startChar = args.mnMinCharPos < mnMinCharPos ? mnMinCharPos : args.mnMinCharPos;
int endChar = args.mnEndCharPos >= mnEndCharPos ? mnEndCharPos - 1 : args.mnEndCharPos;
- unsigned int startGi = ScanFwdForChar(startChar, !bRtl);
- unsigned int endGi = ScanFwdForChar(endChar, bRtl);
+ unsigned int startGi = ScanFwdForChar(startChar, bRtl);
+ unsigned int endGi = ScanFwdForChar(endChar, !bRtl);
int nChars = endChar - startChar + 1;
if (nChars <= 0) return;
if (startGi > endGi)
More information about the Libreoffice-commits
mailing list