summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorMartin Hosken <martin_hosken@sil.org>2015-09-17 08:04:48 +0700
committerMartin Hosken <martin_hosken@sil.org>2015-09-17 06:10:12 +0000
commit23b9febbd883f9db77ffb0216b050aaabc4c6510 (patch)
treecbd6c0ec4068137e25466f1fe34352ca5e74ab7e /vcl/source
parentf2b93f2e314215d6342e0bd5727e6740cc15e29c (diff)
Fix Graphite windows build static
Change-Id: I6feb3805e79f7cae4a8df7efa665fd97c56411c2 Reviewed-on: https://gerrit.libreoffice.org/18654 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Martin Hosken <martin_hosken@sil.org>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/glyphs/graphite_layout.cxx16
1 files changed, 9 insertions, 7 deletions
diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx
index 07d19cfe6677..bf38a491d232 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -148,14 +148,14 @@ GraphiteLayout::fillFrom(gr_segment * pSegment, ImplLayoutArgs &rArgs, float fSc
for ( ; baseSlot; baseSlot = nextBaseSlot)
{
thisBoundary = nextBoundary;
- int firstChar = gr_slot_before(baseSlot) + mnSegCharOffset;
+ int firstChar = gr_cinfo_base(gr_seg_cinfo(pSegment, gr_slot_before(baseSlot))) + mnSegCharOffset;
nextBaseSlot = get_next_base(bRtl ? gr_slot_prev_in_segment(baseSlot) : gr_slot_next_in_segment(baseSlot), bRtl);
nextBoundary = nextBaseSlot ? gr_slot_origin_X(nextBaseSlot) : gr_seg_advance_X(pSegment);
if (firstChar < mnMinCharPos || firstChar >= mnEndCharPos)
continue;
// handle reordered clusters. Presumes reordered glyphs have monotonic opposite char index until the cluster base.
- bool isReordered = (nextBaseSlot && ((bRtl != (gr_slot_before(nextBaseSlot) < firstChar - mnSegCharOffset))
- || gr_slot_before(nextBaseSlot) == firstChar - mnSegCharOffset));
+ bool isReordered = (nextBaseSlot && ((bRtl != (gr_cinfo_base(gr_seg_cinfo(pSegment, gr_slot_before(nextBaseSlot))) < firstChar - mnSegCharOffset))
+ || gr_cinfo_base(gr_seg_cinfo(pSegment, gr_slot_before(nextBaseSlot))) == firstChar - mnSegCharOffset));
if (clusterStart >= 0 && !isReordered) // we hit the base (end) of a reordered cluster
{
int clusterEnd = mvGlyphs.size();
@@ -189,7 +189,7 @@ GraphiteLayout::fillFrom(gr_segment * pSegment, ImplLayoutArgs &rArgs, float fSc
}
int baseGlyph = mvGlyphs.size();
- mvCharBreaks[firstChar - mnMinCharPos] = gr_cinfo_break_weight(gr_seg_cinfo(pSegment, firstChar - mnSegCharOffset));
+ mvCharBreaks[firstChar - mnMinCharPos] = gr_cinfo_break_weight(gr_seg_cinfo(pSegment, gr_slot_before(baseSlot)));
mvChar2BaseGlyph[firstChar - mnMinCharPos] = baseGlyph;
mvCharDxs[firstChar - mnMinCharPos] = static_cast<int>((bRtl ? thisBoundary : nextBoundary) * fScaling) + mnWidth + nDxOffset;
mvGlyph2Char[baseGlyph] = firstChar;
@@ -265,7 +265,7 @@ GraphiteLayout::append(gr_segment *pSeg, ImplLayoutArgs &rArgs,
{
assert(gi);
// assert(gr_slot_before(gi) <= gr_slot_after(gi));
- int firstChar = gr_slot_before(gi) + mnSegCharOffset;
+ int firstChar = gr_cinfo_base(gr_seg_cinfo(pSeg, gr_slot_before(gi))) + mnSegCharOffset;
assert(mvGlyphs.size() < mvGlyph2Char.size());
if (firstChar < mnMinCharPos || firstChar >= mnEndCharPos)
return nextGlyphOrigin;
@@ -274,7 +274,7 @@ GraphiteLayout::append(gr_segment *pSeg, ImplLayoutArgs &rArgs,
{
mvChar2BaseGlyph[firstChar - mnMinCharPos] = baseGlyph;
mvCharDxs[firstChar - mnMinCharPos] = mvCharDxs[baseChar - mnMinCharPos];
- mvCharBreaks[firstChar - mnMinCharPos] = gr_cinfo_break_weight(gr_seg_cinfo(pSeg, firstChar - mnSegCharOffset));
+ mvCharBreaks[firstChar - mnMinCharPos] = gr_cinfo_break_weight(gr_seg_cinfo(pSeg, gr_slot_before(gi)));
}
long glyphId = gr_slot_gid(gi);
long deltaOffset = 0;
@@ -639,7 +639,8 @@ void GraphiteLayout::expandOrCondense(ImplLayoutArgs &rArgs)
int GraphiteLayout::ScanFwdForChar(int &findChar, bool fallback) const
{
int res = mvChar2Glyph[findChar - mnMinCharPos];
- if (res == -1)
+ int done = 3;
+ while (res == -1 && --done)
{
if (fallback)
{
@@ -653,6 +654,7 @@ int GraphiteLayout::ScanFwdForChar(int &findChar, bool fallback) const
if ((res = mvChar2Glyph[findChar - mnMinCharPos]) != -1)
return res;
}
+ fallback = !fallback;
}
return res;
}