diff --git a/dlls/mshtml/olecmd.c b/dlls/mshtml/olecmd.c
index edb02c533b2..e78d0380880 100644
--- a/dlls/mshtml/olecmd.c
+++ b/dlls/mshtml/olecmd.c
@@ -530,6 +530,12 @@ static DWORD query_align_status(HTMLDocument *This, const char *align_str)
return OLECMDF_SUPPORTED | OLECMDF_ENABLED | (align && !strcmp(align_str, align) ? OLECMDF_LATCHED : 0);
}
+static HRESULT query_mshtml_copy(HTMLDocument *This, OLECMD *cmd)
+{
+ FIXME("(%p)\n", This);
+ cmd->cmdf = OLECMDF_SUPPORTED|OLECMDF_ENABLED;
+ return S_OK;
+}
static HRESULT exec_mshtml_copy(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
{
@@ -537,12 +543,26 @@ static HRESULT exec_mshtml_copy(HTMLDocument *This, DWORD cmdexecopt, VARIANT *i
return E_NOTIMPL;
}
+static HRESULT query_mshtml_cut(HTMLDocument *This, OLECMD *cmd)
+{
+ FIXME("(%p)\n", This);
+ cmd->cmdf = OLECMDF_SUPPORTED|OLECMDF_ENABLED;
+ return S_OK;
+}
+
static HRESULT exec_mshtml_cut(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
{
FIXME("(%p)->(%08x %p %p)\n", This, cmdexecopt, in, out);
return E_NOTIMPL;
}
+static HRESULT query_mshtml_paste(HTMLDocument *This, OLECMD *cmd)
+{
+ FIXME("(%p)\n", This);
+ cmd->cmdf = OLECMDF_SUPPORTED|OLECMDF_ENABLED;
+ return S_OK;
+}
+
static HRESULT exec_mshtml_paste(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
{
FIXME("(%p)->(%08x %p %p)\n", This, cmdexecopt, in, out);
@@ -715,9 +735,9 @@ static const struct {
};
static const cmdtable_t base_cmds[] = {
- {IDM_COPY, NULL, exec_mshtml_copy},
- {IDM_PASTE, NULL, exec_mshtml_paste},
- {IDM_CUT, NULL, exec_mshtml_cut},
+ {IDM_COPY, query_mshtml_copy, exec_mshtml_copy},
+ {IDM_PASTE, query_mshtml_paste, exec_mshtml_paste},
+ {IDM_CUT, query_mshtml_cut, exec_mshtml_cut},
{IDM_BROWSEMODE, NULL, exec_browsemode},
{IDM_EDITMODE, NULL, exec_editmode},
{IDM_PRINT, NULL, exec_print},
@@ -745,6 +765,21 @@ static ULONG WINAPI OleCommandTarget_Release(IOleCommandTarget *iface)
return IHTMLDocument_Release(HTMLDOC(This));
}
+static HRESULT query_from_table(HTMLDocument *This, const cmdtable_t *cmdtable, OLECMD *cmd)
+{
+ const cmdtable_t *iter = cmdtable;
+
+ cmd->cmdf = 0;
+
+ while(iter->id && iter->id != cmd->cmdID)
+ iter++;
+
+ if(!iter->id || !iter->query)
+ return OLECMDERR_E_NOTSUPPORTED;
+
+ return iter->query(This, cmd);
+}
+
static HRESULT WINAPI OleCommandTarget_QueryStatus(IOleCommandTarget *iface, const GUID *pguidCmdGroup,
ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
{
@@ -795,15 +830,13 @@ static HRESULT WINAPI OleCommandTarget_QueryStatus(IOleCommandTarget *iface, con
ULONG i;
for(i=0; i