[PATCH] mshtml: Remove useless casts to self

Michael Stefaniuc mstefani at winehq.org
Mon Feb 18 14:14:00 CST 2019


Signed-off-by: Michael Stefaniuc <mstefani 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 6838433985..c901592352 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 4da01560e2..d490030ef3 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 25cdf802b1..52e6fe71b3 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);
 }
 
-- 
2.20.1




More information about the wine-devel mailing list