Jacek Caban : mshtml: Use return_nsstr helper in IHTMLBodyElement:: get_background implementation.

Alexandre Julliard julliard at winehq.org
Fri Apr 13 11:03:21 CDT 2012


Module: wine
Branch: master
Commit: b43cd188df54e2546d8b03e2b49842ac6ee29d2f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b43cd188df54e2546d8b03e2b49842ac6ee29d2f

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Apr 13 12:02:11 2012 +0200

mshtml: Use return_nsstr helper in IHTMLBodyElement::get_background implementation.

---

 dlls/mshtml/htmlbody.c |   15 +--------------
 1 files changed, 1 insertions(+), 14 deletions(-)

diff --git a/dlls/mshtml/htmlbody.c b/dlls/mshtml/htmlbody.c
index d96142a..fb22128 100644
--- a/dlls/mshtml/htmlbody.c
+++ b/dlls/mshtml/htmlbody.c
@@ -293,21 +293,8 @@ static HRESULT WINAPI HTMLBodyElement_get_background(IHTMLBodyElement *iface, BS
     TRACE("(%p)->(%p)\n", This, p);
 
     nsAString_Init(&background_str, NULL);
-
     nsres = nsIDOMHTMLBodyElement_GetBackground(This->nsbody, &background_str);
-    if(NS_SUCCEEDED(nsres)) {
-        const PRUnichar *background;
-        nsAString_GetData(&background_str, &background);
-        *p = *background ? SysAllocString(background) : NULL;
-    }else {
-        ERR("GetBackground failed: %08x\n", nsres);
-        *p = NULL;
-    }
-
-    nsAString_Finish(&background_str);
-
-    TRACE("*p = %s\n", debugstr_w(*p));
-    return S_OK;
+    return return_nsstr(nsres, &background_str, p);
 }
 
 static HRESULT WINAPI HTMLBodyElement_put_bgProperties(IHTMLBodyElement *iface, BSTR v)




More information about the wine-cvs mailing list