Jacek Caban : mshtml: Use get_elem helper in IHTMLDocument2:: get_body implementation.

Alexandre Julliard julliard at winehq.org
Tue Feb 13 13:57:55 CST 2018


Module: wine
Branch: master
Commit: 06d54a6eb3fc7f7375983fbd4cc88e537abbeec9
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=06d54a6eb3fc7f7375983fbd4cc88e537abbeec9

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Feb 12 23:27:02 2018 +0100

mshtml: Use get_elem helper in IHTMLDocument2::get_body implementation.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mshtml/htmldoc.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index 5e3ed75..174ef20 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -261,7 +261,7 @@ static HRESULT WINAPI HTMLDocument_get_body(IHTMLDocument2 *iface, IHTMLElement
 {
     HTMLDocument *This = impl_from_IHTMLDocument2(iface);
     nsIDOMHTMLElement *nsbody = NULL;
-    HTMLDOMNode *node;
+    HTMLElement *element;
     HRESULT hres;
 
     TRACE("(%p)->(%p)\n", This, p);
@@ -281,14 +281,13 @@ static HRESULT WINAPI HTMLDocument_get_body(IHTMLDocument2 *iface, IHTMLElement
         return S_OK;
     }
 
-    hres = get_node(This->doc_node, (nsIDOMNode*)nsbody, TRUE, &node);
+    hres = get_elem(This->doc_node, (nsIDOMElement*)nsbody, &element);
     nsIDOMHTMLElement_Release(nsbody);
     if(FAILED(hres))
         return hres;
 
-    hres = IHTMLDOMNode_QueryInterface(&node->IHTMLDOMNode_iface, &IID_IHTMLElement, (void**)p);
-    node_release(node);
-    return hres;
+    *p = &element->IHTMLElement_iface;
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLDocument_get_activeElement(IHTMLDocument2 *iface, IHTMLElement **p)




More information about the wine-cvs mailing list