Module: wine Branch: master Commit: b0fc3115c96b051420247cc706db0f44f06b7257 URL: http://source.winehq.org/git/wine.git/?a=commit;h=b0fc3115c96b051420247cc706...
Author: Jacek Caban jacek@codeweavers.com Date: Mon Jun 11 00:20:30 2007 +0200
mshtml: Added IDM_COMPOSESETTINGS implementation.
---
dlls/mshtml/editor.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 59 insertions(+), 1 deletions(-)
diff --git a/dlls/mshtml/editor.c b/dlls/mshtml/editor.c index 12a43e1..6edf951 100644 --- a/dlls/mshtml/editor.c +++ b/dlls/mshtml/editor.c @@ -864,14 +864,72 @@ static HRESULT exec_outdent(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, V
static HRESULT exec_composesettings(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out) { + WCHAR *ptr; + if(out || !in || V_VT(in) != VT_BSTR) { WARN("invalid arg\n"); return E_INVALIDARG; }
- FIXME("%s\n", debugstr_w(V_BSTR(in))); + TRACE("(%p)->(%x %s)\n", This, cmdexecopt, debugstr_w(V_BSTR(in)));
update_doc(This, UPDATE_UI); + + ptr = V_BSTR(in); + if(*ptr == '1') + exec_bold(This, cmdexecopt, NULL, NULL); + ptr = strchrW(ptr, ','); + if(!ptr) + return S_OK; + + if(*++ptr == '1') + exec_italic(This, cmdexecopt, NULL, NULL); + ptr = strchrW(ptr, ','); + if(!ptr) + return S_OK; + + if(*++ptr == '1') + exec_underline(This, cmdexecopt, NULL, NULL); + ptr = strchrW(ptr, ','); + if(!ptr) + return S_OK; + + if(isdigitW(*++ptr)) { + VARIANT v; + + V_VT(&v) = VT_I4; + V_I4(&v) = *ptr-'0'; + + exec_fontsize(This, cmdexecopt, &v, NULL); + } + ptr = strchrW(ptr, ','); + if(!ptr) + return S_OK; + + if(*++ptr != ',') + FIXME("set font color\n"); + ptr = strchrW(ptr, ','); + if(!ptr) + return S_OK; + + if(*++ptr != ',') + FIXME("set background color\n"); + ptr = strchrW(ptr, ','); + if(!ptr) + return S_OK; + + ptr++; + if(*ptr) { + VARIANT v; + + V_VT(&v) = VT_BSTR; + V_BSTR(&v) = SysAllocString(ptr); + + exec_fontname(This, cmdexecopt, &v, NULL); + + SysFreeString(V_BSTR(&v)); + } + return S_OK; }