Henri Verbeet : usp10: Itemise ZWSP like ZWNJ and ZWJ.
Alexandre Julliard
julliard at winehq.org
Wed Feb 15 16:06:24 CST 2017
Module: wine
Branch: master
Commit: d00f7315e0cec0c2fe34ba5ab2b55cf5718860dd
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d00f7315e0cec0c2fe34ba5ab2b55cf5718860dd
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Mon Feb 13 22:57:14 2017 +0100
usp10: Itemise ZWSP like ZWNJ and ZWJ.
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/tests/usp10.c | 2 +-
dlls/usp10/usp10.c | 10 ++++++----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c
index 2e87d3c..c5cc401 100644
--- a/dlls/usp10/tests/usp10.c
+++ b/dlls/usp10/tests/usp10.c
@@ -1799,7 +1799,7 @@ static void test_ScriptShape(HDC hdc)
chars[1] = c;
hr = ScriptItemize(chars, 3, 4, NULL, NULL, items, &nb);
ok(hr == S_OK, "%s: [%02x] expected S_OK, got %08x\n", lf.lfFaceName, c, hr);
- todo_wine_if(c == 0x200b) ok(nb == test_data[j].item_count, "%s: [%02x] Got unexpected item count %d.\n",
+ ok(nb == test_data[j].item_count, "%s: [%02x] Got unexpected item count %d.\n",
lf.lfFaceName, c, nb);
item = &items[test_data[j].item];
diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c
index 221aab4..3595ca2 100644
--- a/dlls/usp10/usp10.c
+++ b/dlls/usp10/usp10.c
@@ -1363,7 +1363,7 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars,
for (i = 0; i < cInChars; i++)
{
/* Joiners get merged preferencially right */
- if (i > 0 && (pwcInChars[i] == ZWJ || pwcInChars[i] == ZWNJ))
+ if (i > 0 && (pwcInChars[i] == ZWJ || pwcInChars[i] == ZWNJ || pwcInChars[i] == ZWSP))
{
int j;
if (i+1 == cInChars)
@@ -1372,7 +1372,8 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars,
{
for (j = i+1; j < cInChars; j++)
{
- if (pwcInChars[j] != ZWJ && pwcInChars[j] != ZWNJ && pwcInChars[j] != Numeric_space)
+ if (pwcInChars[j] != ZWJ && pwcInChars[j] != ZWNJ
+ && pwcInChars[j] != ZWSP && pwcInChars[j] != Numeric_space)
{
scripts[i] = scripts[j];
break;
@@ -1497,14 +1498,15 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars,
}
/* Joiners get merged preferencially right */
- if (i > 0 && (pwcInChars[i] == ZWJ || pwcInChars[i] == ZWNJ))
+ if (i > 0 && (pwcInChars[i] == ZWJ || pwcInChars[i] == ZWNJ || pwcInChars[i] == ZWSP))
{
int j;
if (i+1 == cInChars && levels[i-1] == levels[i])
strength[i] = strength[i-1];
else
for (j = i+1; j < cInChars && levels[i] == levels[j]; j++)
- if (pwcInChars[j] != ZWJ && pwcInChars[j] != ZWNJ && pwcInChars[j] != Numeric_space)
+ if (pwcInChars[j] != ZWJ && pwcInChars[j] != ZWNJ
+ && pwcInChars[j] != ZWSP && pwcInChars[j] != Numeric_space)
{
strength[i] = strength[j];
break;
More information about the wine-cvs
mailing list