Commit 124f0290 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IDM_COPY in browse mode implementation.

parent 8966cfe4
...@@ -99,36 +99,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml); ...@@ -99,36 +99,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
static const WCHAR wszFont[] = {'f','o','n','t',0}; static const WCHAR wszFont[] = {'f','o','n','t',0};
static const WCHAR wszSize[] = {'s','i','z','e',0}; static const WCHAR wszSize[] = {'s','i','z','e',0};
static void do_ns_command(NSContainer *This, const char *cmd, nsICommandParams *nsparam)
{
nsICommandManager *cmdmgr;
nsIInterfaceRequestor *iface_req;
nsresult nsres;
TRACE("(%p)\n", This);
nsres = nsIWebBrowser_QueryInterface(This->webbrowser,
&IID_nsIInterfaceRequestor, (void**)&iface_req);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIInterfaceRequestor: %08x\n", nsres);
return;
}
nsres = nsIInterfaceRequestor_GetInterface(iface_req, &IID_nsICommandManager,
(void**)&cmdmgr);
nsIInterfaceRequestor_Release(iface_req);
if(NS_FAILED(nsres)) {
ERR("Could not get nsICommandManager: %08x\n", nsres);
return;
}
nsres = nsICommandManager_DoCommand(cmdmgr, cmd, nsparam, NULL);
if(NS_FAILED(nsres))
ERR("DoCommand(%s) failed: %08x\n", debugstr_a(cmd), nsres);
nsICommandManager_Release(cmdmgr);
}
static void do_ns_editor_command(NSContainer *This, const char *cmd) static void do_ns_editor_command(NSContainer *This, const char *cmd)
{ {
nsresult nsres; nsresult nsres;
......
...@@ -441,6 +441,8 @@ typedef struct { ...@@ -441,6 +441,8 @@ typedef struct {
extern const cmdtable_t editmode_cmds[]; extern const cmdtable_t editmode_cmds[];
void do_ns_command(NSContainer*,const char*,nsICommandParams*);
/* timer */ /* timer */
#define UPDATE_UI 0x0001 #define UPDATE_UI 0x0001
#define UPDATE_TITLE 0x0002 #define UPDATE_TITLE 0x0002
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(mshtml); WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
#define NSCMD_BOLD "cmd_bold" #define NSCMD_BOLD "cmd_bold"
#define NSCMD_COPY "cmd_copy"
#define NSCMD_ITALIC "cmd_italic" #define NSCMD_ITALIC "cmd_italic"
#define NSCMD_UNDERLINE "cmd_underline" #define NSCMD_UNDERLINE "cmd_underline"
#define NSCMD_ALIGN "cmd_align" #define NSCMD_ALIGN "cmd_align"
...@@ -57,6 +58,36 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml); ...@@ -57,6 +58,36 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
#define NSALIGN_LEFT "left" #define NSALIGN_LEFT "left"
#define NSALIGN_RIGHT "right" #define NSALIGN_RIGHT "right"
void do_ns_command(NSContainer *This, const char *cmd, nsICommandParams *nsparam)
{
nsICommandManager *cmdmgr;
nsIInterfaceRequestor *iface_req;
nsresult nsres;
TRACE("(%p)\n", This);
nsres = nsIWebBrowser_QueryInterface(This->webbrowser,
&IID_nsIInterfaceRequestor, (void**)&iface_req);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIInterfaceRequestor: %08x\n", nsres);
return;
}
nsres = nsIInterfaceRequestor_GetInterface(iface_req, &IID_nsICommandManager,
(void**)&cmdmgr);
nsIInterfaceRequestor_Release(iface_req);
if(NS_FAILED(nsres)) {
ERR("Could not get nsICommandManager: %08x\n", nsres);
return;
}
nsres = nsICommandManager_DoCommand(cmdmgr, cmd, nsparam, NULL);
if(NS_FAILED(nsres))
ERR("DoCommand(%s) failed: %08x\n", debugstr_a(cmd), nsres);
nsICommandManager_Release(cmdmgr);
}
/********************************************************** /**********************************************************
* IOleCommandTarget implementation * IOleCommandTarget implementation
*/ */
...@@ -474,8 +505,8 @@ static HRESULT exec_mshtml_copy(HTMLDocument *This, DWORD cmdexecopt, VARIANT *i ...@@ -474,8 +505,8 @@ static HRESULT exec_mshtml_copy(HTMLDocument *This, DWORD cmdexecopt, VARIANT *i
if(This->usermode == EDITMODE) if(This->usermode == EDITMODE)
return editor_exec_copy(This, cmdexecopt, in, out); return editor_exec_copy(This, cmdexecopt, in, out);
FIXME("Unimplemented in browse mode\n"); do_ns_command(This->nscontainer, NSCMD_COPY, NULL);
return E_NOTIMPL; return S_OK;
} }
static HRESULT query_mshtml_cut(HTMLDocument *This, OLECMD *cmd) static HRESULT query_mshtml_cut(HTMLDocument *This, OLECMD *cmd)
......
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