Aric Stewart : usp10: Implement resolveResolved (L1) for Unicode 6.3.

Alexandre Julliard julliard at winehq.org
Mon Nov 4 13:59:19 CST 2013


Module: wine
Branch: master
Commit: 9ccfebd6155af026572beaabb172345793aadc37
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9ccfebd6155af026572beaabb172345793aadc37

Author: Aric Stewart <aric at codeweavers.com>
Date:   Fri Nov  1 12:01:05 2013 -0500

usp10: Implement resolveResolved (L1) for Unicode 6.3.

---

 dlls/usp10/bidi.c |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/dlls/usp10/bidi.c b/dlls/usp10/bidi.c
index 242ad91..ceb498e 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;
 }




More information about the wine-cvs mailing list