summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorOliver-Rainer Wittmann <orw@apache.org>2013-06-11 10:02:35 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-06-11 11:33:08 +0100
commit30a98a585102793b4bc77c4ba4706f8199cfe85e (patch)
tree1f68b582b91cb314de5725cb4fc89ddb3cddafdd /vcl
parentdbc7c605d65cc2dc37af3d2077ac553754bc4f7d (diff)
limit next codepoint index to the minindex..endindex bounds
Patch by: hdu (cherry picked from commit 6115cd0bf8ef8d7e063615636175e148c8d57da1) Change-Id: I62265b3021f86bee1f78a79a2c668c1ce09c5521
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/sallayout.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index bd7a326ef673..4be0ce7c5baa 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -1731,15 +1731,23 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs )
}
mnLevel = nLevel;
- // merge the fallback levels
+ // prepare merge the fallback levels
long nXPos = 0;
double fUnitMul = 1.0;
for( n = 0; n < nLevel; ++n )
maFallbackRuns[n].ResetPos();
+ // get the next codepoint index that needs fallback
+ // and limit it to the minindex..endindex bounds
int nActiveCharPos = nCharPos[0];
+ if( nActiveCharPos < mnMinCharPos)
+ nActiveCharPos = mnMinCharPos;
+ else if( nActiveCharPos >= rArgs.mnEndCharPos )
+ nActiveCharPos = rArgs.mnEndCharPos - 1;
+ // get the end index of the active run
int nLastRunEndChar = (vRtl[nActiveCharPos - mnMinCharPos])?
rArgs.mnEndCharPos : rArgs.mnMinCharPos - 1;
int nRunVisibleEndChar = nCharPos[0];
+ // merge the fallback levels
while( nValid[0] && (nLevel > 0))
{
// find best fallback level