Jacek Caban : mshtml: Get rid of no longer useful get_nsdoc_window helper.

Alexandre Julliard julliard at winehq.org
Wed Aug 24 14:05:32 CDT 2011


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Aug 24 15:38:08 2011 +0200

mshtml: Get rid of no longer useful get_nsdoc_window helper.

---

 dlls/mshtml/htmlframebase.c  |    5 +++--
 dlls/mshtml/htmlwindow.c     |   14 --------------
 dlls/mshtml/mshtml_private.h |    1 -
 dlls/mshtml/npplugin.c       |    4 ++--
 4 files changed, 5 insertions(+), 19 deletions(-)

diff --git a/dlls/mshtml/htmlframebase.c b/dlls/mshtml/htmlframebase.c
index 850d1a9..6c52e53 100644
--- a/dlls/mshtml/htmlframebase.c
+++ b/dlls/mshtml/htmlframebase.c
@@ -39,13 +39,14 @@ HRESULT set_frame_doc(HTMLFrameBase *frame, nsIDOMDocument *nsdoc)
 {
     nsIDOMWindow *nswindow;
     HTMLWindow *window;
+    nsresult nsres;
     HRESULT hres = S_OK;
 
     if(frame->content_window)
         return S_OK;
 
-    nswindow = get_nsdoc_window(nsdoc);
-    if(!nswindow)
+    nsres = nsIDOMDocument_GetDefaultView(nsdoc, &nswindow);
+    if(NS_FAILED(nsres) || !nswindow)
         return E_FAIL;
 
     window = nswindow_to_window(nswindow);
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c
index 17fe016..960a445 100644
--- a/dlls/mshtml/htmlwindow.c
+++ b/dlls/mshtml/htmlwindow.c
@@ -83,20 +83,6 @@ static void window_set_docnode(HTMLWindow *window, HTMLDocumentNode *doc_node)
     }
 }
 
-nsIDOMWindow *get_nsdoc_window(nsIDOMDocument *nsdoc)
-{
-    nsIDOMWindow *nswindow;
-    nsresult nsres;
-
-    nsres = nsIDOMDocument_GetDefaultView(nsdoc, &nswindow);
-    if(NS_FAILED(nsres)) {
-        ERR("GetDefaultView failed: %08x\n", nsres);
-        return NULL;
-    }
-
-    return nswindow;
-}
-
 static void release_children(HTMLWindow *This)
 {
     HTMLWindow *child;
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index eac02d9..9bb37e4 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -609,7 +609,6 @@ HRESULT create_document_fragment(nsIDOMNode*,HTMLDocumentNode*,HTMLDocumentNode*
 HRESULT HTMLWindow_Create(HTMLDocumentObj*,nsIDOMWindow*,HTMLWindow*,HTMLWindow**) DECLSPEC_HIDDEN;
 void update_window_doc(HTMLWindow*) DECLSPEC_HIDDEN;
 HTMLWindow *nswindow_to_window(const nsIDOMWindow*) DECLSPEC_HIDDEN;
-nsIDOMWindow *get_nsdoc_window(nsIDOMDocument*) DECLSPEC_HIDDEN;
 HTMLOptionElementFactory *HTMLOptionElementFactory_Create(HTMLWindow*) DECLSPEC_HIDDEN;
 HTMLImageElementFactory *HTMLImageElementFactory_Create(HTMLWindow*) DECLSPEC_HIDDEN;
 HRESULT HTMLLocation_Create(HTMLWindow*,HTMLLocation**) DECLSPEC_HIDDEN;
diff --git a/dlls/mshtml/npplugin.c b/dlls/mshtml/npplugin.c
index 62f0d52..e22499b 100644
--- a/dlls/mshtml/npplugin.c
+++ b/dlls/mshtml/npplugin.c
@@ -126,9 +126,9 @@ static HTMLWindow *get_elem_window(nsIDOMElement *elem)
     if(NS_FAILED(nsres))
         return NULL;
 
-    nswindow = get_nsdoc_window(nsdoc);
+    nsres = nsIDOMDocument_GetDefaultView(nsdoc, &nswindow);
     nsIDOMDocument_Release(nsdoc);
-    if(!nswindow)
+    if(NS_FAILED(nsres) || !nswindow)
         return NULL;
 
     window = nswindow_to_window(nswindow);




More information about the wine-cvs mailing list