Michael Stefaniuc : mshtml: Remove useless casts to self.

Alexandre Julliard julliard at winehq.org
Wed Feb 20 16:37:00 CST 2019


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

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Mon Feb 18 21:14:00 2019 +0100

mshtml: Remove useless casts to self.

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

---

 dlls/mshtml/editor.c        | 8 ++++----
 dlls/mshtml/htmlelem.c      | 6 +++---
 dlls/mshtml/tests/htmldoc.c | 2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/dlls/mshtml/editor.c b/dlls/mshtml/editor.c
index 6838433..c901592 100644
--- a/dlls/mshtml/editor.c
+++ b/dlls/mshtml/editor.c
@@ -295,7 +295,7 @@ static void get_font_size(HTMLDocument *This, WCHAR *ret)
 
                 TRACE("found font tag %p\n", elem);
 
-                get_elem_attr_value((nsIDOMElement*)elem, sizeW, &val_str, &val);
+                get_elem_attr_value(elem, sizeW, &val_str, &val);
                 if(*val) {
                     TRACE("found size %s\n", debugstr_w(val));
                     strcpyW(ret, val);
@@ -366,7 +366,7 @@ static void set_font_size(HTMLDocument *This, LPCWSTR size)
         nsISelection_Collapse(nsselection, (nsIDOMNode*)elem, 0);
     }else {
         /* Remove all size attributes from the range */
-        remove_child_attr((nsIDOMElement*)elem, fontW, &size_str);
+        remove_child_attr(elem, fontW, &size_str);
         nsISelection_SelectAllChildren(nsselection, (nsIDOMNode*)elem);
     }
 
@@ -1174,10 +1174,10 @@ static HRESULT exec_hyperlink(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
 
         if (insert_link_at_caret) {
             /* add them to the document at the caret position */
-            nsres = nsIHTMLEditor_InsertElementAtSelection(html_editor, (nsIDOMElement*)anchor_elem, FALSE);
+            nsres = nsIHTMLEditor_InsertElementAtSelection(html_editor, anchor_elem, FALSE);
             nsISelection_SelectAllChildren(nsselection, (nsIDOMNode*)anchor_elem);
         }else /* add them around the selection using the magic provided to us by nsIHTMLEditor */
-            nsres = nsIHTMLEditor_InsertLinkAroundSelection(html_editor, (nsIDOMElement*)anchor_elem);
+            nsres = nsIHTMLEditor_InsertLinkAroundSelection(html_editor, anchor_elem);
 
         nsIHTMLEditor_Release(html_editor);
         hres = NS_SUCCEEDED(nsres) ? S_OK : E_FAIL;
diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c
index 4da0156..d490030 100644
--- a/dlls/mshtml/htmlelem.c
+++ b/dlls/mshtml/htmlelem.c
@@ -5597,14 +5597,14 @@ HRESULT HTMLElement_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode, BOOL use_g
 
     tag = get_tag_desc(tag_name);
     if(tag) {
-        hres = tag->constructor(doc, (nsIDOMElement*)nselem, &elem);
+        hres = tag->constructor(doc, nselem, &elem);
     }else if(use_generic) {
-        hres = HTMLGenericElement_Create(doc, (nsIDOMElement*)nselem, &elem);
+        hres = HTMLGenericElement_Create(doc, nselem, &elem);
     }else {
         elem = heap_alloc_zero(sizeof(HTMLElement));
         if(elem) {
             elem->node.vtbl = &HTMLElementImplVtbl;
-            HTMLElement_Init(elem, doc, (nsIDOMElement*)nselem, &HTMLElement_dispex);
+            HTMLElement_Init(elem, doc, nselem, &HTMLElement_dispex);
             hres = S_OK;
         }else {
             hres = E_OUTOFMEMORY;
diff --git a/dlls/mshtml/tests/htmldoc.c b/dlls/mshtml/tests/htmldoc.c
index 25cdf80..52e6fe7 100644
--- a/dlls/mshtml/tests/htmldoc.c
+++ b/dlls/mshtml/tests/htmldoc.c
@@ -7543,7 +7543,7 @@ static void test_QueryInterface(IHTMLDocument2 *htmldoc)
 
     hres = IUnknown_QueryInterface(doc, &IID_IDispatch, (void**)&qi);
     ok(hres == S_OK, "Could not get IDispatch interface: %08x\n", hres);
-    ok(qi != (IUnknown*)doc, "disp == doc\n");
+    ok(qi != doc, "disp == doc\n");
     IUnknown_Release(qi);
 }
 




More information about the wine-cvs mailing list