Nikolay Sivov : riched20: Implement SetName().
Alexandre Julliard
julliard at wine.codeweavers.com
Wed May 27 09:30:58 CDT 2015
Module: wine
Branch: master
Commit: aa37c179ad20a9b8461122584bd44d08e5d65c3f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=aa37c179ad20a9b8461122584bd44d08e5d65c3f
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Tue May 26 17:36:23 2015 +0300
riched20: Implement SetName().
---
dlls/riched20/richole.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c
index 8b611d5..a34c210 100644
--- a/dlls/riched20/richole.c
+++ b/dlls/riched20/richole.c
@@ -541,7 +541,12 @@ static HRESULT set_textfont_prop(ITextFontImpl *font, enum textfont_prop_id prop
/* when font is not attached to any range use cache */
if (!font->range || font->set_cache_enabled) {
- font->props[propid] = *value;
+ if (propid == FONT_NAME) {
+ SysFreeString(font->props[propid].str);
+ font->props[propid].str = SysAllocString(value->str);
+ }
+ else
+ font->props[propid] = *value;
return S_OK;
}
@@ -600,6 +605,9 @@ static HRESULT set_textfont_prop(ITextFontImpl *font, enum textfont_prop_id prop
case FONT_WEIGHT:
fmt.wWeight = value->l;
break;
+ case FONT_NAME:
+ lstrcpynW(fmt.szFaceName, value->str, sizeof(fmt.szFaceName)/sizeof(WCHAR));
+ break;
default:
FIXME("unhandled font property %d\n", propid);
return E_FAIL;
@@ -2543,8 +2551,12 @@ static HRESULT WINAPI TextFont_GetName(ITextFont *iface, BSTR *value)
static HRESULT WINAPI TextFont_SetName(ITextFont *iface, BSTR value)
{
ITextFontImpl *This = impl_from_ITextFont(iface);
- FIXME("(%p)->(%s): stub\n", This, debugstr_w(value));
- return E_NOTIMPL;
+ textfont_prop_val v;
+
+ TRACE("(%p)->(%s)\n", This, debugstr_w(value));
+
+ v.str = value;
+ return set_textfont_prop(This, FONT_NAME, &v);
}
static HRESULT WINAPI TextFont_GetOutline(ITextFont *iface, LONG *value)
More information about the wine-cvs
mailing list