Jacek Caban : mshtml: Use stored nsdoc in get_compatMode.
Alexandre Julliard
julliard at winehq.org
Thu Oct 9 07:42:44 CDT 2008
Module: wine
Branch: master
Commit: 7a74f5b5ae93551da382087ada09d5cbff0e475d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7a74f5b5ae93551da382087ada09d5cbff0e475d
Author: Jacek Caban <jacek at codeweavers.com>
Date: Wed Oct 8 13:27:44 2008 -0500
mshtml: Use stored nsdoc in get_compatMode.
---
dlls/mshtml/htmldoc5.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/dlls/mshtml/htmldoc5.c b/dlls/mshtml/htmldoc5.c
index b443045..34dc4e0 100644
--- a/dlls/mshtml/htmldoc5.c
+++ b/dlls/mshtml/htmldoc5.c
@@ -215,7 +215,6 @@ static HRESULT WINAPI HTMLDocument5_get_onbeforedeactivate(IHTMLDocument5 *iface
static HRESULT WINAPI HTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *p)
{
HTMLDocument *This = HTMLDOC5_THIS(iface);
- nsIDOMDocument *nsdoc;
nsIDOMNSHTMLDocument *nshtmldoc;
nsAString mode_str;
const PRUnichar *mode;
@@ -223,12 +222,12 @@ static HRESULT WINAPI HTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *
TRACE("(%p)->(%p)\n", This, p);
- nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
- if(NS_FAILED(nsres))
- ERR("GetDocument failed: %08x\n", nsres);
+ if(!This->nsdoc) {
+ WARN("NULL nsdoc\n");
+ return E_UNEXPECTED;
+ }
- nsres = nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMNSHTMLDocument, (void**)&nshtmldoc);
- nsIDOMDocument_Release(nsdoc);
+ nsres = nsIDOMHTMLDocument_QueryInterface(This->nsdoc, &IID_nsIDOMNSHTMLDocument, (void**)&nshtmldoc);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIDOMNSHTMLDocument: %08x\n", nsres);
return S_OK;
More information about the wine-cvs
mailing list