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

riched20: Switch font unit is not allowed.

parent eecb7572
...@@ -2445,6 +2445,9 @@ static HRESULT WINAPI TextFont_Reset(ITextFont *iface, LONG value) ...@@ -2445,6 +2445,9 @@ static HRESULT WINAPI TextFont_Reset(ITextFont *iface, LONG value)
This->set_cache_enabled = FALSE; This->set_cache_enabled = FALSE;
textfont_apply_range_props(This); textfont_apply_range_props(This);
break; break;
case tomUsePoints:
case tomUseTwips:
return E_INVALIDARG;
default: default:
FIXME("reset mode %d not supported\n", value); FIXME("reset mode %d not supported\n", value);
} }
...@@ -2467,6 +2470,9 @@ static HRESULT WINAPI TextFont_Reset(ITextFont *iface, LONG value) ...@@ -2467,6 +2470,9 @@ static HRESULT WINAPI TextFont_Reset(ITextFont *iface, LONG value)
case tomTrackParms: case tomTrackParms:
case tomCacheParms: case tomCacheParms:
return S_OK; return S_OK;
case tomUsePoints:
case tomUseTwips:
return E_INVALIDARG;
} }
} }
......
...@@ -2141,6 +2141,12 @@ static void test_ITextFont(void) ...@@ -2141,6 +2141,12 @@ static void test_ITextFont(void)
hr = ITextRange_GetFont(range, &font); hr = ITextRange_GetFont(range, &font);
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
hr = ITextFont_Reset(font, tomUseTwips);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
hr = ITextFont_Reset(font, tomUsePoints);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
hr = ITextFont_GetName(font, NULL); hr = ITextFont_GetName(font, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
...@@ -2176,6 +2182,23 @@ static void test_ITextFont(void) ...@@ -2176,6 +2182,23 @@ static void test_ITextFont(void)
ok(position == twips_to_points(cf.yOffset), "got yOffset %d, position %.2f\n", cf.yOffset, position); ok(position == twips_to_points(cf.yOffset), "got yOffset %d, position %.2f\n", cf.yOffset, position);
ok(kerning == twips_to_points(cf.wKerning), "got wKerning %d, kerning %.2f\n", cf.wKerning, kerning); ok(kerning == twips_to_points(cf.wKerning), "got wKerning %d, kerning %.2f\n", cf.wKerning, kerning);
hr = ITextFont_Reset(font, tomUseTwips);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
hr = ITextFont_Reset(font, tomUsePoints);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
hr = ITextFont_GetDuplicate(font, &font2);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = ITextFont_Reset(font2, tomUseTwips);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
hr = ITextFont_Reset(font2, tomUsePoints);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
ITextFont_Release(font2);
/* default font name */ /* default font name */
str = NULL; str = NULL;
hr = ITextFont_GetName(font, &str); hr = ITextFont_GetName(font, &str);
......
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