From 90a4eb7d185e3e234b399d13e21222cf1ba822cf Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Sun, 27 Dec 2009 00:50:04 +0100 Subject: [PATCH] mshtml: Use nscolor_to_str in IHTMLBodyElement::get_text implementation. --- dlls/mshtml/htmlbody.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/dlls/mshtml/htmlbody.c b/dlls/mshtml/htmlbody.c index 8daace173a6..1aa73139723 100644 --- a/dlls/mshtml/htmlbody.c +++ b/dlls/mshtml/htmlbody.c @@ -448,22 +448,21 @@ static HRESULT WINAPI HTMLBodyElement_get_text(IHTMLBodyElement *iface, VARIANT HTMLBodyElement *This = HTMLBODY_THIS(iface); nsAString text; nsresult nsres; + HRESULT hres; TRACE("(%p)->(%p)\n", This, p); nsAString_Init(&text, NULL); - - V_VT(p) = VT_BSTR; - V_BSTR(p) = NULL; - nsres = nsIDOMHTMLBodyElement_GetText(This->nsbody, &text); - if(NS_SUCCEEDED(nsres)) - { - const PRUnichar *sText; - nsAString_GetData(&text, &sText); + if(NS_SUCCEEDED(nsres)) { + const PRUnichar *color; + nsAString_GetData(&text, &color); V_VT(p) = VT_BSTR; - V_BSTR(p) = SysAllocString(sText); + hres = nscolor_to_str(color, &V_BSTR(p)); + }else { + ERR("GetText failed: %08x\n", nsres); + hres = E_FAIL; } nsAString_Finish(&text);