Commit e65e5348 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Use get_nsinterface in set_ns_editmode and get_editor_controller.

parent cf403fa4
...@@ -647,7 +647,6 @@ void nsnode_to_nsstring(nsIDOMNode *nsdoc, nsAString *str) ...@@ -647,7 +647,6 @@ void nsnode_to_nsstring(nsIDOMNode *nsdoc, nsAString *str)
void get_editor_controller(NSContainer *This) void get_editor_controller(NSContainer *This)
{ {
nsIEditingSession *editing_session = NULL; nsIEditingSession *editing_session = NULL;
nsIInterfaceRequestor *iface_req;
nsIControllerContext *ctrlctx; nsIControllerContext *ctrlctx;
nsresult nsres; nsresult nsres;
...@@ -661,16 +660,8 @@ void get_editor_controller(NSContainer *This) ...@@ -661,16 +660,8 @@ void get_editor_controller(NSContainer *This)
This->editor_controller = NULL; This->editor_controller = NULL;
} }
nsres = nsIWebBrowser_QueryInterface(This->webbrowser, nsres = get_nsinterface((nsISupports*)This->webbrowser, &IID_nsIEditingSession,
&IID_nsIInterfaceRequestor, (void**)&iface_req);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIInterfaceRequestor: %08x\n", nsres);
return;
}
nsres = nsIInterfaceRequestor_GetInterface(iface_req, &IID_nsIEditingSession,
(void**)&editing_session); (void**)&editing_session);
nsIInterfaceRequestor_Release(iface_req);
if(NS_FAILED(nsres)) { if(NS_FAILED(nsres)) {
ERR("Could not get nsIEditingSession: %08x\n", nsres); ERR("Could not get nsIEditingSession: %08x\n", nsres);
return; return;
...@@ -702,22 +693,13 @@ void get_editor_controller(NSContainer *This) ...@@ -702,22 +693,13 @@ void get_editor_controller(NSContainer *This)
void set_ns_editmode(NSContainer *This) void set_ns_editmode(NSContainer *This)
{ {
nsIInterfaceRequestor *iface_req;
nsIEditingSession *editing_session = NULL; nsIEditingSession *editing_session = NULL;
nsIURIContentListener *listener = NULL; nsIURIContentListener *listener = NULL;
nsIDOMWindow *dom_window = NULL; nsIDOMWindow *dom_window = NULL;
nsresult nsres; nsresult nsres;
nsres = nsIWebBrowser_QueryInterface(This->webbrowser, nsres = get_nsinterface((nsISupports*)This->webbrowser, &IID_nsIEditingSession,
&IID_nsIInterfaceRequestor, (void**)&iface_req);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIInterfaceRequestor: %08x\n", nsres);
return;
}
nsres = nsIInterfaceRequestor_GetInterface(iface_req, &IID_nsIEditingSession,
(void**)&editing_session); (void**)&editing_session);
nsIInterfaceRequestor_Release(iface_req);
if(NS_FAILED(nsres)) { if(NS_FAILED(nsres)) {
ERR("Could not get nsIEditingSession: %08x\n", nsres); ERR("Could not get nsIEditingSession: %08x\n", nsres);
return; return;
......
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