mshtml: Added IDM_COPY in browse mode implementation.
This commit is contained in:
parent
8966cfe42a
commit
124f0290e4
|
@ -99,36 +99,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
|||
static const WCHAR wszFont[] = {'f','o','n','t',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)
|
||||
{
|
||||
nsresult nsres;
|
||||
|
|
|
@ -441,6 +441,8 @@ typedef struct {
|
|||
|
||||
extern const cmdtable_t editmode_cmds[];
|
||||
|
||||
void do_ns_command(NSContainer*,const char*,nsICommandParams*);
|
||||
|
||||
/* timer */
|
||||
#define UPDATE_UI 0x0001
|
||||
#define UPDATE_TITLE 0x0002
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
||||
|
||||
#define NSCMD_BOLD "cmd_bold"
|
||||
#define NSCMD_COPY "cmd_copy"
|
||||
#define NSCMD_ITALIC "cmd_italic"
|
||||
#define NSCMD_UNDERLINE "cmd_underline"
|
||||
#define NSCMD_ALIGN "cmd_align"
|
||||
|
@ -57,6 +58,36 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
|||
#define NSALIGN_LEFT "left"
|
||||
#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
|
||||
*/
|
||||
|
@ -474,8 +505,8 @@ static HRESULT exec_mshtml_copy(HTMLDocument *This, DWORD cmdexecopt, VARIANT *i
|
|||
if(This->usermode == EDITMODE)
|
||||
return editor_exec_copy(This, cmdexecopt, in, out);
|
||||
|
||||
FIXME("Unimplemented in browse mode\n");
|
||||
return E_NOTIMPL;
|
||||
do_ns_command(This->nscontainer, NSCMD_COPY, NULL);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT query_mshtml_cut(HTMLDocument *This, OLECMD *cmd)
|
||||
|
|
Loading…
Reference in New Issue