Module: wine Branch: master Commit: e8c4951a2a81e0f3ec162998390ce38e635b6613 URL: http://source.winehq.org/git/wine.git/?a=commit;h=e8c4951a2a81e0f3ec16299839...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Wed Jun 17 21:52:53 2015 +0300
dwrite: Actually set isWhitespace for space clusters.
---
dlls/dwrite/layout.c | 4 ++-- dlls/dwrite/tests/layout.c | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c index e001e49..a8adb2a 100644 --- a/dlls/dwrite/layout.c +++ b/dlls/dwrite/layout.c @@ -495,10 +495,10 @@ static inline void init_cluster_metrics(const struct dwrite_textlayout *layout, metrics->canWrapLineAfter = breakcondition == DWRITE_BREAK_CONDITION_CAN_BREAK || breakcondition == DWRITE_BREAK_CONDITION_MUST_BREAK; if (metrics->length == 1) { - WORD type; + WORD type = 0;
GetStringTypeW(CT_CTYPE1, &layout->str[position], 1, &type); - metrics->isWhitespace = type == C1_SPACE; + metrics->isWhitespace = !!(type & C1_SPACE); metrics->isNewline = FALSE /* FIXME */; metrics->isSoftHyphen = layout->str[position] == 0x00ad /* Unicode Soft Hyphen */; } diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c index 5d655b6..e8450df 100644 --- a/dlls/dwrite/tests/layout.c +++ b/dlls/dwrite/tests/layout.c @@ -1716,7 +1716,6 @@ todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); ok(count == 2, "got %u\n", count); ok(metrics[0].isWhitespace == 0, "got %d\n", metrics[0].isWhitespace); -todo_wine ok(metrics[1].isWhitespace == 1, "got %d\n", metrics[1].isWhitespace); IDWriteTextLayout_Release(layout);
@@ -2746,10 +2745,10 @@ static void test_GetLineMetrics(void) memset(&metrics, 0, sizeof(metrics)); hr = IDWriteTextLayout_GetLineMetrics(layout, &metrics, 1, &count); ok(hr == S_OK, "got 0x%08x\n", hr); -todo_wine { +todo_wine ok(metrics.length == 5, "got %u\n", metrics.length); ok(metrics.trailingWhitespaceLength == 1, "got %u\n", metrics.trailingWhitespaceLength); -} + ok(metrics.newlineLength == 0, "got %u\n", metrics.newlineLength); ok(metrics.isTrimmed == FALSE, "got %d\n", metrics.isTrimmed);