Henri Verbeet : usp10: Use USP10_FindGlyphInLogClust() in UpdateClusters() .

Alexandre Julliard julliard at winehq.org
Wed Mar 1 16:45:10 CST 2017


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Wed Mar  1 07:14:56 2017 +0100

usp10: Use USP10_FindGlyphInLogClust() in UpdateClusters().

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Aric Stewart <aric at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/usp10/shape.c | 32 +-------------------------------
 1 file changed, 1 insertion(+), 31 deletions(-)

diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c
index 8daefcc..9e0addc 100644
--- a/dlls/usp10/shape.c
+++ b/dlls/usp10/shape.c
@@ -753,11 +753,9 @@ static void UpdateClusters(int nextIndex, int changeCount, int write_dir, int ch
     {
         int i;
         int target_glyph = nextIndex - write_dir;
-        int seeking_glyph;
         int target_index = -1;
         int replacing_glyph = -1;
         int changed = 0;
-        int top_logclust = 0;
 
         if (changeCount > 0)
         {
@@ -767,35 +765,7 @@ static void UpdateClusters(int nextIndex, int changeCount, int write_dir, int ch
                 target_glyph = nextIndex + (changeCount + 1);
         }
 
-        seeking_glyph = target_glyph;
-        for (i = 0; i < chars; i++)
-            if (pwLogClust[i] > top_logclust)
-                top_logclust = pwLogClust[i];
-
-        do {
-            if (write_dir > 0)
-                for (i = 0; i < chars; i++)
-                {
-                    if (pwLogClust[i] == seeking_glyph)
-                    {
-                        target_index = i;
-                        break;
-                    }
-                }
-            else
-                for (i = chars - 1; i >= 0; i--)
-                {
-                    if (pwLogClust[i] == seeking_glyph)
-                    {
-                        target_index = i;
-                        break;
-                    }
-                }
-            if (target_index == -1)
-                seeking_glyph ++;
-        }
-        while (target_index == -1 && seeking_glyph <= top_logclust);
-
+        target_index = USP10_FindGlyphInLogClust(pwLogClust, chars, target_glyph);
         if (target_index == -1)
         {
             ERR("Unable to find target glyph\n");




More information about the wine-cvs mailing list