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

riched20: Implement SetName().

parent 43a80b80
......@@ -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)
......
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