{
intstate = odd(baselevel) ? xr : xl;
int cls;
intlevel = baselevel;
intaction, clsRun, clsNew;
int cchRun = 0;
int ich = 0;
for (; ich < cch; ich++)
{
/* ignore boundary neutrals */if (pcls[ich] == BN)
{
/* must flatten levels unless at a level change; */
plevel[ich] = level;
/* lookahead for level changes */if (ich + 1 == cch && level != baselevel)
{
/* have to fixup last BN before end of the loop, since * its fix-upped value will be needed below the assert */
pcls[ich] = EmbeddingDirection(level);
}
elseif (ich + 1 < cch && level != plevel[ich+1] && pcls[ich+1] != BN)
{
/* fixup LAST BN in front / after a level run to make * it act like the SOR/EOR in rule X10 */int newlevel = plevel[ich+1];
if (level > newlevel) {
newlevel = level;
}
plevel[ich] = newlevel;
/* must match assigned level */
pcls[ich] = EmbeddingDirection(newlevel);
level = plevel[ich+1];
}
else
{
/* don't interrupt runs */if (cchRun)
{
cchRun++;
}
continue;
}
}
ASSERT(pcls[ich] <= BN);
cls = pcls[ich];
action = actionWeak[state][cls];
/* resolve the directionality for deferred runs */
clsRun = GetDeferredType(action);
if (clsRun != XX)
{
SetDeferredRun(pcls, cchRun, ich, clsRun);
cchRun = 0;
}
/* resolve the directionality class at the current location */
clsNew = GetResolvedType(action);
if (clsNew != XX)
pcls[ich] = clsNew;
/* increment a deferred run */if (IX & action)
cchRun++;
state = stateWeak[state][cls];
}
/* resolve any deferred runs * use the direction of the current level to emulate PDF */
cls = EmbeddingDirection(level);
/* resolve the directionality for deferred runs */
clsRun = GetDeferredType(actionWeak[state][cls]);
if (clsRun != XX)
SetDeferredRun(pcls, cchRun, ich, clsRun);
}
Generated on Sat May 26 2012 05:19:01 for ReactOS by
1.7.6.1
ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.