dwrite: Actually set isWhitespace for space clusters.

This commit is contained in:
Nikolay Sivov 2015-06-17 21:52:53 +03:00 committed by Alexandre Julliard
parent f68f63152f
commit e8c4951a2a
2 changed files with 4 additions and 5 deletions

View File

@ -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 */;
}

View File

@ -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);