Commit 9a0d0e86 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

mshtml: Don't check for doc_node from the doc obj when it can't be NULL.

parent b99c89f3
...@@ -991,8 +991,6 @@ static HRESULT WINAPI DocObjOleCommandTarget_QueryStatus(IOleCommandTarget *ifac ...@@ -991,8 +991,6 @@ static HRESULT WINAPI DocObjOleCommandTarget_QueryStatus(IOleCommandTarget *ifac
{ {
HTMLDocumentObj *This = HTMLDocumentObj_from_IOleCommandTarget(iface); HTMLDocumentObj *This = HTMLDocumentObj_from_IOleCommandTarget(iface);
if(!This->doc_node)
return E_UNEXPECTED;
return IOleCommandTarget_QueryStatus(&This->doc_node->IOleCommandTarget_iface, return IOleCommandTarget_QueryStatus(&This->doc_node->IOleCommandTarget_iface,
pguidCmdGroup, cCmds, prgCmds, pCmdText); pguidCmdGroup, cCmds, prgCmds, pCmdText);
} }
...@@ -1002,8 +1000,6 @@ static HRESULT WINAPI DocObjOleCommandTarget_Exec(IOleCommandTarget *iface, cons ...@@ -1002,8 +1000,6 @@ static HRESULT WINAPI DocObjOleCommandTarget_Exec(IOleCommandTarget *iface, cons
{ {
HTMLDocumentObj *This = HTMLDocumentObj_from_IOleCommandTarget(iface); HTMLDocumentObj *This = HTMLDocumentObj_from_IOleCommandTarget(iface);
if(!This->doc_node)
return E_UNEXPECTED;
return IOleCommandTarget_Exec(&This->doc_node->IOleCommandTarget_iface, return IOleCommandTarget_Exec(&This->doc_node->IOleCommandTarget_iface,
pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut); pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
} }
......
...@@ -2169,37 +2169,37 @@ static HRESULT WINAPI DocObj##iface##_Invoke(I##iface *_0, DISPID dispIdMember, ...@@ -2169,37 +2169,37 @@ static HRESULT WINAPI DocObj##iface##_Invoke(I##iface *_0, DISPID dispIdMember,
#define HTMLDOCUMENTOBJ_FWD_TO_NODE_0(iface, method) static HRESULT WINAPI DocObj##iface##_##method(I##iface *_0) \ #define HTMLDOCUMENTOBJ_FWD_TO_NODE_0(iface, method) static HRESULT WINAPI DocObj##iface##_##method(I##iface *_0) \
{ \ { \
HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \
return This->doc_node ? This->doc_node->I##iface##_iface.lpVtbl->method(&This->doc_node->I##iface##_iface) : E_UNEXPECTED; \ return This->doc_node->I##iface##_iface.lpVtbl->method(&This->doc_node->I##iface##_iface); \
} }
#define HTMLDOCUMENTOBJ_FWD_TO_NODE_1(iface, method, a) static HRESULT WINAPI DocObj##iface##_##method(I##iface *_0, a _1) \ #define HTMLDOCUMENTOBJ_FWD_TO_NODE_1(iface, method, a) static HRESULT WINAPI DocObj##iface##_##method(I##iface *_0, a _1) \
{ \ { \
HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \
return This->doc_node ? This->doc_node->I##iface##_iface.lpVtbl->method(&This->doc_node->I##iface##_iface, _1) : E_UNEXPECTED; \ return This->doc_node->I##iface##_iface.lpVtbl->method(&This->doc_node->I##iface##_iface, _1); \
} }
#define HTMLDOCUMENTOBJ_FWD_TO_NODE_2(iface, method, a,b) static HRESULT WINAPI DocObj##iface##_##method(I##iface *_0, a _1, b _2) \ #define HTMLDOCUMENTOBJ_FWD_TO_NODE_2(iface, method, a,b) static HRESULT WINAPI DocObj##iface##_##method(I##iface *_0, a _1, b _2) \
{ \ { \
HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \
return This->doc_node ? This->doc_node->I##iface##_iface.lpVtbl->method(&This->doc_node->I##iface##_iface, _1, _2) : E_UNEXPECTED; \ return This->doc_node->I##iface##_iface.lpVtbl->method(&This->doc_node->I##iface##_iface, _1, _2); \
} }
#define HTMLDOCUMENTOBJ_FWD_TO_NODE_3(iface, method, a,b,c) static HRESULT WINAPI DocObj##iface##_##method(I##iface *_0, a _1, b _2, c _3) \ #define HTMLDOCUMENTOBJ_FWD_TO_NODE_3(iface, method, a,b,c) static HRESULT WINAPI DocObj##iface##_##method(I##iface *_0, a _1, b _2, c _3) \
{ \ { \
HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \
return This->doc_node ? This->doc_node->I##iface##_iface.lpVtbl->method(&This->doc_node->I##iface##_iface, _1, _2, _3) : E_UNEXPECTED; \ return This->doc_node->I##iface##_iface.lpVtbl->method(&This->doc_node->I##iface##_iface, _1, _2, _3); \
} }
#define HTMLDOCUMENTOBJ_FWD_TO_NODE_4(iface, method, a,b,c,d) static HRESULT WINAPI DocObj##iface##_##method(I##iface *_0, a _1, b _2, c _3, d _4) \ #define HTMLDOCUMENTOBJ_FWD_TO_NODE_4(iface, method, a,b,c,d) static HRESULT WINAPI DocObj##iface##_##method(I##iface *_0, a _1, b _2, c _3, d _4) \
{ \ { \
HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \
return This->doc_node ? This->doc_node->I##iface##_iface.lpVtbl->method(&This->doc_node->I##iface##_iface, _1, _2, _3, _4) : E_UNEXPECTED; \ return This->doc_node->I##iface##_iface.lpVtbl->method(&This->doc_node->I##iface##_iface, _1, _2, _3, _4); \
} }
#define HTMLDOCUMENTOBJ_FWD_TO_NODE_5(iface, method, a,b,c,d,e) static HRESULT WINAPI DocObj##iface##_##method(I##iface *_0, a _1, b _2, c _3, d _4, e _5) \ #define HTMLDOCUMENTOBJ_FWD_TO_NODE_5(iface, method, a,b,c,d,e) static HRESULT WINAPI DocObj##iface##_##method(I##iface *_0, a _1, b _2, c _3, d _4, e _5) \
{ \ { \
HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \
return This->doc_node ? This->doc_node->I##iface##_iface.lpVtbl->method(&This->doc_node->I##iface##_iface, _1, _2, _3, _4, _5) : E_UNEXPECTED; \ return This->doc_node->I##iface##_iface.lpVtbl->method(&This->doc_node->I##iface##_iface, _1, _2, _3, _4, _5); \
} }
/********************************************************** /**********************************************************
...@@ -3618,7 +3618,7 @@ static void HTMLDocumentObj_on_advise(IUnknown *iface, cp_static_data_t *cp) ...@@ -3618,7 +3618,7 @@ static void HTMLDocumentObj_on_advise(IUnknown *iface, cp_static_data_t *cp)
{ {
HTMLDocumentObj *This = impl_from_IUnknown(iface); HTMLDocumentObj *This = impl_from_IUnknown(iface);
if(This->window && This->doc_node) if(This->window)
update_doc_cp_events(This->doc_node, cp); update_doc_cp_events(This->doc_node, cp);
} }
...@@ -3704,7 +3704,7 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii ...@@ -3704,7 +3704,7 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii
doc->window = doc->nscontainer->content_window; doc->window = doc->nscontainer->content_window;
IHTMLWindow2_AddRef(&doc->window->base.IHTMLWindow2_iface); IHTMLWindow2_AddRef(&doc->window->base.IHTMLWindow2_iface);
if(!doc->doc_node && doc->window->base.inner_window->doc) { if(!doc->doc_node) {
doc->doc_node = doc->window->base.inner_window->doc; doc->doc_node = doc->window->base.inner_window->doc;
IHTMLDOMNode_AddRef(&doc->doc_node->node.IHTMLDOMNode_iface); IHTMLDOMNode_AddRef(&doc->doc_node->node.IHTMLDOMNode_iface);
} }
......
...@@ -1008,10 +1008,6 @@ static HRESULT WINAPI DocObjPersistFile_Save(IPersistFile *iface, LPCOLESTR pszF ...@@ -1008,10 +1008,6 @@ static HRESULT WINAPI DocObjPersistFile_Save(IPersistFile *iface, LPCOLESTR pszF
{ {
HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistFile(iface); HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistFile(iface);
if(!This->doc_node) {
FIXME("No doc_node\n");
return E_UNEXPECTED;
}
return IPersistFile_Save(&This->doc_node->IPersistFile_iface, pszFileName, fRemember); return IPersistFile_Save(&This->doc_node->IPersistFile_iface, pszFileName, fRemember);
} }
...@@ -1202,10 +1198,6 @@ static HRESULT WINAPI DocObjPersistStreamInit_Save(IPersistStreamInit *iface, IS ...@@ -1202,10 +1198,6 @@ static HRESULT WINAPI DocObjPersistStreamInit_Save(IPersistStreamInit *iface, IS
{ {
HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistStreamInit(iface); HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistStreamInit(iface);
if(!This->doc_node) {
FIXME("No doc_node\n");
return E_UNEXPECTED;
}
return IPersistStreamInit_Save(&This->doc_node->IPersistStreamInit_iface, pStm, fClearDirty); return IPersistStreamInit_Save(&This->doc_node->IPersistStreamInit_iface, pStm, fClearDirty);
} }
......
...@@ -446,7 +446,7 @@ static void send_unload_events_impl(HTMLInnerWindow *window) ...@@ -446,7 +446,7 @@ static void send_unload_events_impl(HTMLInnerWindow *window)
static void send_unload_events(HTMLDocumentObj *doc) static void send_unload_events(HTMLDocumentObj *doc)
{ {
if(!doc->doc_node || !doc->window || !doc->doc_node->content_ready) if(!doc->window || !doc->doc_node->content_ready)
return; return;
send_unload_events_impl(doc->window->base.inner_window); send_unload_events_impl(doc->window->base.inner_window);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment