Commit e8c4951a authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Actually set isWhitespace for space clusters.

parent f68f6315
...@@ -495,10 +495,10 @@ static inline void init_cluster_metrics(const struct dwrite_textlayout *layout, ...@@ -495,10 +495,10 @@ static inline void init_cluster_metrics(const struct dwrite_textlayout *layout,
metrics->canWrapLineAfter = breakcondition == DWRITE_BREAK_CONDITION_CAN_BREAK || metrics->canWrapLineAfter = breakcondition == DWRITE_BREAK_CONDITION_CAN_BREAK ||
breakcondition == DWRITE_BREAK_CONDITION_MUST_BREAK; breakcondition == DWRITE_BREAK_CONDITION_MUST_BREAK;
if (metrics->length == 1) { if (metrics->length == 1) {
WORD type; WORD type = 0;
GetStringTypeW(CT_CTYPE1, &layout->str[position], 1, &type); GetStringTypeW(CT_CTYPE1, &layout->str[position], 1, &type);
metrics->isWhitespace = type == C1_SPACE; metrics->isWhitespace = !!(type & C1_SPACE);
metrics->isNewline = FALSE /* FIXME */; metrics->isNewline = FALSE /* FIXME */;
metrics->isSoftHyphen = layout->str[position] == 0x00ad /* Unicode Soft Hyphen */; metrics->isSoftHyphen = layout->str[position] == 0x00ad /* Unicode Soft Hyphen */;
} }
......
...@@ -1716,7 +1716,6 @@ todo_wine ...@@ -1716,7 +1716,6 @@ todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
ok(count == 2, "got %u\n", count); ok(count == 2, "got %u\n", count);
ok(metrics[0].isWhitespace == 0, "got %d\n", metrics[0].isWhitespace); ok(metrics[0].isWhitespace == 0, "got %d\n", metrics[0].isWhitespace);
todo_wine
ok(metrics[1].isWhitespace == 1, "got %d\n", metrics[1].isWhitespace); ok(metrics[1].isWhitespace == 1, "got %d\n", metrics[1].isWhitespace);
IDWriteTextLayout_Release(layout); IDWriteTextLayout_Release(layout);
...@@ -2746,10 +2745,10 @@ static void test_GetLineMetrics(void) ...@@ -2746,10 +2745,10 @@ static void test_GetLineMetrics(void)
memset(&metrics, 0, sizeof(metrics)); memset(&metrics, 0, sizeof(metrics));
hr = IDWriteTextLayout_GetLineMetrics(layout, &metrics, 1, &count); hr = IDWriteTextLayout_GetLineMetrics(layout, &metrics, 1, &count);
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine { todo_wine
ok(metrics.length == 5, "got %u\n", metrics.length); ok(metrics.length == 5, "got %u\n", metrics.length);
ok(metrics.trailingWhitespaceLength == 1, "got %u\n", metrics.trailingWhitespaceLength); ok(metrics.trailingWhitespaceLength == 1, "got %u\n", metrics.trailingWhitespaceLength);
}
ok(metrics.newlineLength == 0, "got %u\n", metrics.newlineLength); ok(metrics.newlineLength == 0, "got %u\n", metrics.newlineLength);
ok(metrics.isTrimmed == FALSE, "got %d\n", metrics.isTrimmed); ok(metrics.isTrimmed == FALSE, "got %d\n", metrics.isTrimmed);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment