mshtml: Use return_nsstr helper in IHTMLDocument5::get_compatMode.

This commit is contained in:
Jacek Caban 2015-02-27 17:31:48 +01:00 committed by Alexandre Julliard
parent e56e9c11fa
commit 25b4d6be68
1 changed files with 3 additions and 8 deletions

View File

@ -2882,7 +2882,7 @@ static HRESULT WINAPI HTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *
{ {
HTMLDocument *This = impl_from_IHTMLDocument5(iface); HTMLDocument *This = impl_from_IHTMLDocument5(iface);
nsAString mode_str; nsAString mode_str;
const PRUnichar *mode; nsresult nsres;
TRACE("(%p)->(%p)\n", This, p); TRACE("(%p)->(%p)\n", This, p);
@ -2892,13 +2892,8 @@ static HRESULT WINAPI HTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *
} }
nsAString_Init(&mode_str, NULL); nsAString_Init(&mode_str, NULL);
nsIDOMHTMLDocument_GetCompatMode(This->doc_node->nsdoc, &mode_str); nsres = nsIDOMHTMLDocument_GetCompatMode(This->doc_node->nsdoc, &mode_str);
return return_nsstr(nsres, &mode_str, p);
nsAString_GetData(&mode_str, &mode);
*p = SysAllocString(mode);
nsAString_Finish(&mode_str);
return S_OK;
} }
static const IHTMLDocument5Vtbl HTMLDocument5Vtbl = { static const IHTMLDocument5Vtbl HTMLDocument5Vtbl = {