Aric Stewart : usp10: In ScriptXtoX use cChars as the item is the character index.

Alexandre Julliard julliard at winehq.org
Wed Aug 24 14:05:25 CDT 2011


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

Author: Aric Stewart <aric at codeweavers.com>
Date:   Mon Aug 22 07:18:47 2011 -0500

usp10: In ScriptXtoX use cChars as the item is the character index.

---

 dlls/usp10/usp10.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c
index e6933bc..38f6c3a 100644
--- a/dlls/usp10/usp10.c
+++ b/dlls/usp10/usp10.c
@@ -1320,7 +1320,7 @@ HRESULT WINAPI ScriptCPtoX(int iCP,
     }
 
     iPosX = 0.0;
-    for (item=0; item < iCP && item < cGlyphs; item++)
+    for (item=0; item < iCP && item < cChars; item++)
     {
         if (iSpecial == -1 && (iCluster == -1 || (iCluster != -1 && iCluster+clust_size <= item)))
         {
@@ -1330,7 +1330,7 @@ HRESULT WINAPI ScriptCPtoX(int iCP,
             clust_size = 1;
             iCluster = -1;
 
-            for (check = item+1; check < cGlyphs; check++)
+            for (check = item+1; check < cChars; check++)
             {
                 if (pwLogClust[check] == clust)
                 {
@@ -1341,9 +1341,9 @@ HRESULT WINAPI ScriptCPtoX(int iCP,
                 else break;
             }
 
-            if (check >= cGlyphs && !iMaxPos)
+            if (check >= cChars && !iMaxPos)
             {
-                for (check = clust; check < cGlyphs; check++)
+                for (check = clust; check < cChars; check++)
                     special_size += piAdvance[check];
                 iSpecial = item;
                 special_size /= (cChars - item);
@@ -1406,12 +1406,12 @@ HRESULT WINAPI ScriptXtoCP(int iX,
 
         if (iX < 0)
         {
-            *piCP = cGlyphs;
+            *piCP = cChars;
             *piTrailing = 0;
             return S_OK;
         }
 
-        for (item=0; item < cGlyphs; item++)
+        for (item=0; item < cChars; item++)
             if (pwLogClust[item] > max_clust)
             {
                 ERR("We do not handle non reversed clusters properly\n");
@@ -1430,8 +1430,8 @@ HRESULT WINAPI ScriptXtoCP(int iX,
     if (direction > 0)
         item = 0;
     else
-        item = cGlyphs - 1;
-    for (; iPosX <= iX && item < cGlyphs && item >= 0; item+=direction)
+        item = cChars - 1;
+    for (; iPosX <= iX && item < cChars && item >= 0; item+=direction)
     {
         iLastPosX = iPosX;
         if (iSpecial == -1 &&
@@ -1449,7 +1449,7 @@ HRESULT WINAPI ScriptXtoCP(int iX,
             clust_size = 1;
             iCluster = -1;
 
-            for (check = item+direction; check < cGlyphs && check >= 0; check+=direction)
+            for (check = item+direction; check < cChars && check >= 0; check+=direction)
             {
                 if (pwLogClust[check] == clust)
                 {
@@ -1460,9 +1460,9 @@ HRESULT WINAPI ScriptXtoCP(int iX,
                 else break;
             }
 
-            if (check >= cGlyphs && direction > 0)
+            if (check >= cChars && direction > 0)
             {
-                for (check = clust; check < cGlyphs; check++)
+                for (check = clust; check < cChars; check++)
                     special_size += piAdvance[check];
                 iSpecial = item;
                 special_size /= (cChars - item);
@@ -1481,7 +1481,7 @@ HRESULT WINAPI ScriptXtoCP(int iX,
     {
         if (iPosX > iX)
             item--;
-        if (item < cGlyphs && ((iPosX - iLastPosX) / 2.0) + iX > iPosX)
+        if (item < cChars && ((iPosX - iLastPosX) / 2.0) + iX > iPosX)
             *piTrailing = 1;
         else
             *piTrailing = 0;




More information about the wine-cvs mailing list