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

dwrite: Fix identical ranges merging.

parent 3c16587e
...@@ -2136,7 +2136,7 @@ static HRESULT set_layout_range_attr(struct dwrite_textlayout *layout, enum layo ...@@ -2136,7 +2136,7 @@ static HRESULT set_layout_range_attr(struct dwrite_textlayout *layout, enum layo
/* for all existing ranges covered by new one update value */ /* for all existing ranges covered by new one update value */
while (cur && is_in_layout_range(&value->range, &cur->range)) { while (cur && is_in_layout_range(&value->range, &cur->range)) {
changed = set_layout_range_attrval(cur, attr, value); changed |= set_layout_range_attrval(cur, attr, value);
cur = LIST_ENTRY(list_next(ranges, &cur->entry), struct layout_range_header, entry); cur = LIST_ENTRY(list_next(ranges, &cur->entry), struct layout_range_header, entry);
} }
...@@ -2145,7 +2145,7 @@ static HRESULT set_layout_range_attr(struct dwrite_textlayout *layout, enum layo ...@@ -2145,7 +2145,7 @@ static HRESULT set_layout_range_attr(struct dwrite_textlayout *layout, enum layo
r.startPosition = cur->range.startPosition; r.startPosition = cur->range.startPosition;
r.length = value->range.startPosition + value->range.length - cur->range.startPosition; r.length = value->range.startPosition + value->range.length - cur->range.startPosition;
left = alloc_layout_range_from(cur, &r); left = alloc_layout_range_from(cur, &r);
changed = set_layout_range_attrval(left, attr, value); changed |= set_layout_range_attrval(left, attr, value);
cur->range.startPosition += left->range.length; cur->range.startPosition += left->range.length;
cur->range.length -= left->range.length; cur->range.length -= left->range.length;
list_add_before(&cur->entry, &left->entry); list_add_before(&cur->entry, &left->entry);
......
...@@ -2056,17 +2056,17 @@ if (0) /* crashes on native */ ...@@ -2056,17 +2056,17 @@ if (0) /* crashes on native */
range.length = 0; range.length = 0;
hr = IDWriteTextLayout_GetLocaleName(layout, 0, buffW, sizeof(buffW)/sizeof(WCHAR), &range); hr = IDWriteTextLayout_GetLocaleName(layout, 0, buffW, sizeof(buffW)/sizeof(WCHAR), &range);
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine { todo_wine
ok(!lstrcmpW(buffW, enusW), "got %s\n", wine_dbgstr_w(buffW)); ok(!lstrcmpW(buffW, enusW), "got %s\n", wine_dbgstr_w(buffW));
ok(range.startPosition == 0 && range.length == ~0u, "got %u,%u\n", range.startPosition, range.length); ok(range.startPosition == 0 && range.length == ~0u, "got %u,%u\n", range.startPosition, range.length);
}
/* check what's returned for positions after the text */ /* check what's returned for positions after the text */
buffW[0] = 0; buffW[0] = 0;
range.length = 0; range.length = 0;
hr = IDWriteTextLayout_GetLocaleName(layout, 100, buffW, sizeof(buffW)/sizeof(WCHAR), &range); hr = IDWriteTextLayout_GetLocaleName(layout, 100, buffW, sizeof(buffW)/sizeof(WCHAR), &range);
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
ok(!lstrcmpW(buffW, enusW), "got %s\n", wine_dbgstr_w(buffW));
todo_wine todo_wine
ok(!lstrcmpW(buffW, enusW), "got %s\n", wine_dbgstr_w(buffW));
ok(range.startPosition == 0 && range.length == ~0u, "got %u,%u\n", range.startPosition, range.length); ok(range.startPosition == 0 && range.length == ~0u, "got %u,%u\n", range.startPosition, range.length);
IDWriteTextLayout_Release(layout); IDWriteTextLayout_Release(layout);
......
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