Module: wine Branch: master Commit: 6f4146a30b150f836651f29d0b0d88a1a64e082a URL: http://source.winehq.org/git/wine.git/?a=commit;h=6f4146a30b150f836651f29d0b...
Author: Jacek Caban jacek@codeweavers.com Date: Sat Nov 11 15:30:08 2006 +0100
mshtml: Added IDM_INDENT and IDM_OUTDENT implementation.
---
dlls/mshtml/olecmd.c | 38 ++++++++++++++++++++++++++++++++++---- dlls/mshtml/tests/htmldoc.c | 2 ++ 2 files changed, 36 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/olecmd.c b/dlls/mshtml/olecmd.c index 1e8d048..97e5af7 100644 --- a/dlls/mshtml/olecmd.c +++ b/dlls/mshtml/olecmd.c @@ -45,6 +45,8 @@ #define NSCMD_UNDERLINE "cmd_underline" #define NSCMD_FONTCOLOR "cmd_fontColor" #define NSCMD_ALIGN "cmd_align" #define NSCMD_FONTFACE "cmd_fontFace" +#define NSCMD_INDENT "cmd_indent" +#define NSCMD_OUTDENT "cmd_outdent"
#define NSSTATE_ATTRIBUTE "state_attribute" #define NSSTATE_ALL "state_all" @@ -616,6 +618,26 @@ static HRESULT exec_baselinefont3(HTMLDo return S_OK; }
+static HRESULT exec_indent(HTMLDocument *This) +{ + TRACE("(%p)\n", This); + + if(This->nscontainer) + do_ns_command(This->nscontainer, NSCMD_INDENT, NULL); + + return S_OK; +} + +static HRESULT exec_outdent(HTMLDocument *This) +{ + TRACE("(%p)\n", This); + + if(This->nscontainer) + do_ns_command(This->nscontainer, NSCMD_OUTDENT, NULL); + + return S_OK; +} + static const struct { OLECMDF cmdf; HRESULT (*func)(HTMLDocument*,DWORD,VARIANT*,VARIANT*); @@ -791,12 +813,12 @@ static HRESULT WINAPI OleCommandTarget_Q prgCmds[i].cmdf = OLECMDF_SUPPORTED|OLECMDF_ENABLED; break; case IDM_INDENT: - FIXME("CGID_MSHTML: IDM_INDENT\n"); - prgCmds[i].cmdf = OLECMDF_SUPPORTED|OLECMDF_ENABLED; + TRACE("CGID_MSHTML: IDM_INDENT\n"); + prgCmds[i].cmdf = query_edit_status(This, NULL); break; case IDM_OUTDENT: - FIXME("CGID_MSHTML: IDM_OUTDENT\n"); - prgCmds[i].cmdf = OLECMDF_SUPPORTED|OLECMDF_ENABLED; + TRACE("CGID_MSHTML: IDM_OUTDENT\n"); + prgCmds[i].cmdf = query_edit_status(This, NULL); break; case IDM_BLOCKDIRLTR: FIXME("CGID_MSHTML: IDM_BLOCKDIRLTR\n"); @@ -885,6 +907,14 @@ static HRESULT WINAPI OleCommandTarget_E return exec_editmode(This); case IDM_BASELINEFONT3: return exec_baselinefont3(This); + case IDM_INDENT: + if(pvaIn || pvaOut) + FIXME("unsupported arguments\n"); + return exec_indent(This); + case IDM_OUTDENT: + if(pvaIn || pvaOut) + FIXME("unsupported arguments\n"); + return exec_outdent(This); default: FIXME("unsupported nCmdID %d of CGID_MSHTML group\n", nCmdID); return OLECMDERR_E_NOTSUPPORTED; diff --git a/dlls/mshtml/tests/htmldoc.c b/dlls/mshtml/tests/htmldoc.c index a42e296..bbe1d29 100644 --- a/dlls/mshtml/tests/htmldoc.c +++ b/dlls/mshtml/tests/htmldoc.c @@ -2048,6 +2048,8 @@ static void test_MSHTML_QueryStatus(IUnk test_QueryStatus(unk, &CGID_MSHTML, IDM_JUSTIFYRIGHT, cmdf); test_QueryStatus(unk, &CGID_MSHTML, IDM_ITALIC, cmdf); test_QueryStatus(unk, &CGID_MSHTML, IDM_UNDERLINE, cmdf); + test_QueryStatus(unk, &CGID_MSHTML, IDM_INDENT, cmdf); + test_QueryStatus(unk, &CGID_MSHTML, IDM_OUTDENT, cmdf); }
static void test_OleCommandTarget(IUnknown *unk)