From 9ccfebd6155af026572beaabb172345793aadc37 Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Fri, 1 Nov 2013 12:01:05 -0500 Subject: [PATCH] usp10: Implement resolveResolved (L1) for Unicode 6.3. --- dlls/usp10/bidi.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/dlls/usp10/bidi.c b/dlls/usp10/bidi.c index 242ad917a93..ceb498e480e 100644 --- a/dlls/usp10/bidi.c +++ b/dlls/usp10/bidi.c @@ -793,6 +793,37 @@ static void resolveImplicit(const WORD * pcls, WORD *plevel, int sos, int eos) } } +static void resolveResolved(unsigned baselevel, const WORD * pcls, WORD *plevel, int sos, int eos) +{ + int i; + + /* L1 */ + for (i = sos; i <= eos; i++) + { + if (pcls[i] == B || pcls[i] == S) + { + int j = i -1; + while (i > sos && j >= sos && + (pcls[j] == WS || pcls[j] == FSI || pcls[j] == LRI || pcls[j] == RLI || + pcls[j] == PDI || pcls[j] == LRE || pcls[j] == RLE || pcls[j] == LRO || + pcls[j] == RLO || pcls[j] == PDF || pcls[j] == BN)) + plevel[j--] = baselevel; + plevel[i] = baselevel; + } + if (i == eos && + (pcls[i] == WS || pcls[i] == FSI || pcls[i] == LRI || pcls[i] == RLI || + pcls[i] == PDI || pcls[i] == LRE || pcls[i] == RLE || pcls[i] == LRO || + pcls[i] == RLO || pcls[i] == PDF || pcls[i] == BN )) + { + int j = i; + while (j >= sos && (pcls[j] == WS || pcls[j] == FSI || pcls[j] == LRI || pcls[j] == RLI || + pcls[j] == PDI || pcls[j] == LRE || pcls[j] == RLE || pcls[j] == LRO || + pcls[j] == RLO || pcls[j] == PDF || pcls[j] == BN)) + plevel[j--] = baselevel; + } + } +} + static void computeIsolatingRunsSet(unsigned baselevel, WORD *pcls, WORD *pLevel, int uCount, struct list *set) { int run_start, run_end, i; @@ -972,6 +1003,10 @@ BOOL BIDI_DetermineLevels( /* resolveImplicit */ resolveImplicit(chartype, lpOutLevels, 0, uCount-1); + /* resolveResolvedLevels*/ + classify(lpString, chartype, uCount, c); + resolveResolved(baselevel, chartype, lpOutLevels, 0, uCount-1); + HeapFree(GetProcessHeap(), 0, chartype); return TRUE; }