Jacek Caban : mshtml: Use stored nsdoc in IHTMLDocument2::put_title.
Alexandre Julliard
julliard at winehq.org
Thu Oct 9 07:42:48 CDT 2008
Module: wine
Branch: master
Commit: 0a79d9c690bc9c1935088ddb704ef867934c72e3
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0a79d9c690bc9c1935088ddb704ef867934c72e3
Author: Jacek Caban <jacek at codeweavers.com>
Date: Wed Oct 8 13:28:51 2008 -0500
mshtml: Use stored nsdoc in IHTMLDocument2::put_title.
---
dlls/mshtml/htmldoc.c | 18 ++++--------------
1 files changed, 4 insertions(+), 14 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index c5bcdb9..d31c9ce 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -369,28 +369,18 @@ static HRESULT WINAPI HTMLDocument_get_anchors(IHTMLDocument2 *iface, IHTMLEleme
static HRESULT WINAPI HTMLDocument_put_title(IHTMLDocument2 *iface, BSTR v)
{
HTMLDocument *This = HTMLDOC_THIS(iface);
- nsIDOMHTMLDocument *nshtmldoc;
- nsIDOMDocument *nsdoc;
nsAString nsstr;
nsresult nsres;
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
- if(!This->nscontainer)
- return E_FAIL;
-
- nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
- if(NS_FAILED(nsres) || !nsdoc) {
- ERR("GetDocument failed: %08x\n", nsres);
- return E_FAIL;
+ if(!This->nsdoc) {
+ WARN("NULL nsdoc\n");
+ return E_UNEXPECTED;
}
- nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMHTMLDocument, (void**)&nshtmldoc);
- nsIDOMDocument_Release(nsdoc);
-
nsAString_Init(&nsstr, v);
- nsres = nsIDOMHTMLDocument_SetTitle(nshtmldoc, &nsstr);
- nsIDOMHTMLDocument_Release(nshtmldoc);
+ nsres = nsIDOMHTMLDocument_SetTitle(This->nsdoc, &nsstr);
nsAString_Finish(&nsstr);
if(NS_FAILED(nsres))
ERR("SetTitle failed: %08x\n", nsres);
More information about the wine-cvs
mailing list