Jacek Caban : mshtml: Use nsIDOMUIEvent stored in DOMEvent in IHTMLEventObj::get_[xy] implementation.

Alexandre Julliard julliard at winehq.org
Tue Feb 6 15:55:48 CST 2018


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Tue Feb  6 00:09:01 2018 +0100

mshtml: Use nsIDOMUIEvent stored in DOMEvent in IHTMLEventObj::get_[xy] implementation.

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

---

 dlls/mshtml/htmlevent.c | 26 ++++++++------------------
 1 file changed, 8 insertions(+), 18 deletions(-)

diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c
index 6c51819..88b9e85 100644
--- a/dlls/mshtml/htmlevent.c
+++ b/dlls/mshtml/htmlevent.c
@@ -635,17 +635,12 @@ static HRESULT WINAPI HTMLEventObj_get_x(IHTMLEventObj *iface, LONG *p)
 
     TRACE("(%p)->(%p)\n", This, p);
 
-    if(This->event) {
-        nsIDOMUIEvent *ui_event;
+    if(This->event && This->event->ui_event) {
         nsresult nsres;
 
-        nsres = nsIDOMEvent_QueryInterface(This->event->nsevent, &IID_nsIDOMUIEvent, (void**)&ui_event);
-        if(NS_SUCCEEDED(nsres)) {
-            /* NOTE: pageX is not exactly right here. */
-            nsres = nsIDOMUIEvent_GetPageX(ui_event, &x);
-            assert(nsres == NS_OK);
-            nsIDOMUIEvent_Release(ui_event);
-        }
+        /* NOTE: pageX is not exactly right here. */
+        nsres = nsIDOMUIEvent_GetPageX(This->event->ui_event, &x);
+        assert(nsres == NS_OK);
     }
 
     *p = x;
@@ -659,17 +654,12 @@ static HRESULT WINAPI HTMLEventObj_get_y(IHTMLEventObj *iface, LONG *p)
 
     TRACE("(%p)->(%p)\n", This, p);
 
-    if(This->event) {
-        nsIDOMUIEvent *ui_event;
+    if(This->event && This->event->ui_event) {
         nsresult nsres;
 
-        nsres = nsIDOMEvent_QueryInterface(This->event->nsevent, &IID_nsIDOMUIEvent, (void**)&ui_event);
-        if(NS_SUCCEEDED(nsres)) {
-            /* NOTE: pageY is not exactly right here. */
-            nsres = nsIDOMUIEvent_GetPageY(ui_event, &y);
-            assert(nsres == NS_OK);
-            nsIDOMUIEvent_Release(ui_event);
-        }
+        /* NOTE: pageY is not exactly right here. */
+        nsres = nsIDOMUIEvent_GetPageY(This->event->ui_event, &y);
+        assert(nsres == NS_OK);
     }
 
     *p = y;




More information about the wine-cvs mailing list