Nikolay Sivov : riched20: Switch font unit is not allowed.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri May 29 05:29:48 CDT 2015
Module: wine
Branch: master
Commit: b4959154caa0908b30673841d7b4f48f66f44080
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b4959154caa0908b30673841d7b4f48f66f44080
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Thu May 28 00:11:49 2015 +0300
riched20: Switch font unit is not allowed.
---
dlls/riched20/richole.c | 6 ++++++
dlls/riched20/tests/richole.c | 23 +++++++++++++++++++++++
2 files changed, 29 insertions(+)
diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c
index 008c124..5b0c7fc 100644
--- a/dlls/riched20/richole.c
+++ b/dlls/riched20/richole.c
@@ -2445,6 +2445,9 @@ static HRESULT WINAPI TextFont_Reset(ITextFont *iface, LONG value)
This->set_cache_enabled = FALSE;
textfont_apply_range_props(This);
break;
+ case tomUsePoints:
+ case tomUseTwips:
+ return E_INVALIDARG;
default:
FIXME("reset mode %d not supported\n", value);
}
@@ -2467,6 +2470,9 @@ static HRESULT WINAPI TextFont_Reset(ITextFont *iface, LONG value)
case tomTrackParms:
case tomCacheParms:
return S_OK;
+ case tomUsePoints:
+ case tomUseTwips:
+ return E_INVALIDARG;
}
}
diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c
index 327b3ac..f2ad6e2 100644
--- a/dlls/riched20/tests/richole.c
+++ b/dlls/riched20/tests/richole.c
@@ -2141,6 +2141,12 @@ static void test_ITextFont(void)
hr = ITextRange_GetFont(range, &font);
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);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
@@ -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(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 */
str = NULL;
hr = ITextFont_GetName(font, &str);
More information about the wine-cvs
mailing list