From: Michael Stefaniuc Subject: [PATCH 1/2] mshtml: Use wide-char string literals in html*.c. Message-Id: <20201123234907.126869-2-mstefani@winehq.org> Date: Tue, 24 Nov 2020 00:49:05 +0100 Signed-off-by: Michael Stefaniuc --- dlls/mshtml/htmlanchor.c | 10 ++-- dlls/mshtml/htmlbody.c | 38 ++++++--------- dlls/mshtml/htmldoc.c | 32 ++++--------- dlls/mshtml/htmlelem.c | 49 ++++++-------------- dlls/mshtml/htmlform.c | 14 ++---- dlls/mshtml/htmlframe.c | 13 ++---- dlls/mshtml/htmlhead.c | 6 +-- dlls/mshtml/htmlimg.c | 6 +-- dlls/mshtml/htmlinput.c | 21 ++------- dlls/mshtml/htmllocation.c | 6 +-- dlls/mshtml/htmlobject.c | 10 ++-- dlls/mshtml/htmlstyle.c | 94 +++++++++++++------------------------- dlls/mshtml/htmltable.c | 3 +- dlls/mshtml/htmltextarea.c | 4 +- dlls/mshtml/htmlwindow.c | 8 +--- 15 files changed, 97 insertions(+), 217 deletions(-) diff --git a/dlls/mshtml/htmlanchor.c b/dlls/mshtml/htmlanchor.c index 64cc6db8755..a0e96af822e 100644 --- a/dlls/mshtml/htmlanchor.c +++ b/dlls/mshtml/htmlanchor.c @@ -65,27 +65,23 @@ HTMLOuterWindow *get_target_window(HTMLOuterWindow *window, nsAString *target_st const PRUnichar *target; HRESULT hres; - static const WCHAR _parentW[] = {'_','p','a','r','e','n','t',0}; - static const WCHAR _selfW[] = {'_','s','e','l','f',0}; - static const WCHAR _topW[] = {'_','t','o','p',0}; - *use_new_window = FALSE; nsAString_GetData(target_str, &target); TRACE("%s\n", debugstr_w(target)); - if(!*target || !wcsicmp(target, _selfW)) { + if(!*target || !wcsicmp(target, L"_self")) { IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface); return window; } - if(!wcsicmp(target, _topW)) { + if(!wcsicmp(target, L"_top")) { get_top_window(window, &top_window); IHTMLWindow2_AddRef(&top_window->base.IHTMLWindow2_iface); return top_window; } - if(!wcsicmp(target, _parentW)) { + if(!wcsicmp(target, L"_parent")) { if(!window->parent) { WARN("Window has no parent, treat as self\n"); IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface); diff --git a/dlls/mshtml/htmlbody.c b/dlls/mshtml/htmlbody.c index 4209fd2cc2e..9955a8e6498 100644 --- a/dlls/mshtml/htmlbody.c +++ b/dlls/mshtml/htmlbody.c @@ -115,8 +115,6 @@ HRESULT nscolor_to_str(LPCWSTR color, BSTR *ret) unsigned int i; int rgb = -1; - static const WCHAR formatW[] = {'#','%','0','2','x','%','0','2','x','%','0','2','x',0}; - if(!color || !*color) { *ret = NULL; return S_OK; @@ -135,7 +133,7 @@ HRESULT nscolor_to_str(LPCWSTR color, BSTR *ret) if(!*ret) return E_OUTOFMEMORY; - swprintf(*ret, 8, formatW, rgb>>16, (rgb>>8)&0xff, rgb&0xff); + swprintf(*ret, 8, L"#%02x%02x%02x", rgb>>16, (rgb>>8)&0xff, rgb&0xff); TRACE("%s -> %s\n", debugstr_w(color), debugstr_w(*ret)); return S_OK; @@ -150,9 +148,8 @@ BOOL variant_to_nscolor(const VARIANT *v, nsAString *nsstr) case VT_I4: { PRUnichar buf[10]; - static const WCHAR formatW[] = {'#','%','x',0}; - wsprintfW(buf, formatW, V_I4(v)); + wsprintfW(buf, L"#%x", V_I4(v)); nsAString_Init(nsstr, buf); return TRUE; } @@ -576,13 +573,6 @@ static HRESULT WINAPI HTMLBodyElement_get_onunload(IHTMLBodyElement *iface, VARI return E_NOTIMPL; } -static const WCHAR autoW[] = {'a','u','t','o',0}; -static const WCHAR hiddenW[] = {'h','i','d','d','e','n',0}; -static const WCHAR scrollW[] = {'s','c','r','o','l','l',0}; -static const WCHAR visibleW[] = {'v','i','s','i','b','l','e',0}; -static const WCHAR yesW[] = {'y','e','s',0}; -static const WCHAR noW[] = {'n','o',0}; - static HRESULT WINAPI HTMLBodyElement_put_scroll(IHTMLBodyElement *iface, BSTR v) { HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface); @@ -591,12 +581,12 @@ static HRESULT WINAPI HTMLBodyElement_put_scroll(IHTMLBodyElement *iface, BSTR v TRACE("(%p)->(%s)\n", This, debugstr_w(v)); /* Emulate with CSS visibility attribute */ - if(!wcscmp(v, yesW)) { - val = scrollW; - }else if(!wcscmp(v, autoW)) { - val = visibleW; - }else if(!wcscmp(v, noW)) { - val = hiddenW; + if(!wcscmp(v, L"yes")) { + val = L"scroll"; + }else if(!wcscmp(v, L"auto")) { + val = L"visible"; + }else if(!wcscmp(v, L"no")) { + val = L"hidden"; }else { WARN("Invalid argument %s\n", debugstr_w(v)); return E_INVALIDARG; @@ -622,12 +612,12 @@ static HRESULT WINAPI HTMLBodyElement_get_scroll(IHTMLBodyElement *iface, BSTR * if(!overflow || !*overflow) { *p = NULL; hres = S_OK; - }else if(!wcscmp(overflow, visibleW) || !wcscmp(overflow, autoW)) { - ret = autoW; - }else if(!wcscmp(overflow, scrollW)) { - ret = yesW; - }else if(!wcscmp(overflow, hiddenW)) { - ret = noW; + }else if(!wcscmp(overflow, L"visible") || !wcscmp(overflow, L"auto")) { + ret = L"auto"; + }else if(!wcscmp(overflow, L"scroll")) { + ret = L"yes"; + }else if(!wcscmp(overflow, L"hidden")) { + ret = L"no"; }else { TRACE("Defaulting %s to NULL\n", debugstr_w(overflow)); *p = NULL; diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 5644d92dbe5..767b46a7050 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -577,11 +577,9 @@ static HRESULT WINAPI HTMLDocument_put_designMode(IHTMLDocument2 *iface, BSTR v) HTMLDocument *This = impl_from_IHTMLDocument2(iface); HRESULT hres; - static const WCHAR onW[] = {'o','n',0}; - TRACE("(%p)->(%s)\n", This, debugstr_w(v)); - if(wcsicmp(v, onW)) { + if(wcsicmp(v, L"on")) { FIXME("Unsupported arg %s\n", debugstr_w(v)); return E_NOTIMPL; } @@ -597,13 +595,12 @@ static HRESULT WINAPI HTMLDocument_put_designMode(IHTMLDocument2 *iface, BSTR v) static HRESULT WINAPI HTMLDocument_get_designMode(IHTMLDocument2 *iface, BSTR *p) { HTMLDocument *This = impl_from_IHTMLDocument2(iface); - static const WCHAR szOff[] = {'O','f','f',0}; FIXME("(%p)->(%p) always returning Off\n", This, p); if(!p) return E_INVALIDARG; - *p = SysAllocString(szOff); + *p = SysAllocString(L"Off"); return S_OK; } @@ -824,12 +821,9 @@ static HRESULT WINAPI HTMLDocument_get_URL(IHTMLDocument2 *iface, BSTR *p) { HTMLDocument *This = impl_from_IHTMLDocument2(iface); - static const WCHAR about_blank_url[] = - {'a','b','o','u','t',':','b','l','a','n','k',0}; - TRACE("(%p)->(%p)\n", iface, p); - *p = SysAllocString(This->window->url ? This->window->url : about_blank_url); + *p = SysAllocString(This->window->url ? This->window->url : L"about:blank"); return *p ? S_OK : E_OUTOFMEMORY; } @@ -1119,8 +1113,6 @@ static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT nsISupports *tmp; nsresult nsres; - static const WCHAR text_htmlW[] = {'t','e','x','t','/','h','t','m','l',0}; - TRACE("(%p)->(%s %s %s %s %p)\n", This, debugstr_w(url), debugstr_variant(&name), debugstr_variant(&features), debugstr_variant(&replace), pomWindowResult); @@ -1129,7 +1121,7 @@ static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT return E_NOTIMPL; } - if(!url || wcscmp(url, text_htmlW) || V_VT(&name) != VT_ERROR + if(!url || wcscmp(url, L"text/html") || V_VT(&name) != VT_ERROR || V_VT(&features) != VT_ERROR || V_VT(&replace) != VT_ERROR) FIXME("unsupported args\n"); @@ -1709,14 +1701,12 @@ static HRESULT WINAPI HTMLDocument_toString(IHTMLDocument2 *iface, BSTR *String) { HTMLDocument *This = impl_from_IHTMLDocument2(iface); - static const WCHAR objectW[] = {'[','o','b','j','e','c','t',']',0}; - TRACE("(%p)->(%p)\n", This, String); if(!String) return E_INVALIDARG; - *String = SysAllocString(objectW); + *String = SysAllocString(L"[object]"); return *String ? S_OK : E_OUTOFMEMORY; } @@ -1731,8 +1721,6 @@ static HRESULT WINAPI HTMLDocument_createStyleSheet(IHTMLDocument2 *iface, BSTR nsresult nsres; HRESULT hres; - static const WCHAR styleW[] = {'s','t','y','l','e',0}; - TRACE("(%p)->(%s %d %p)\n", This, debugstr_w(bstrHref), lIndex, ppnewStyleSheet); if(!This->doc_node->nsdoc) { @@ -1749,7 +1737,7 @@ static HRESULT WINAPI HTMLDocument_createStyleSheet(IHTMLDocument2 *iface, BSTR return S_OK; } - hres = create_element(This->doc_node, styleW, &elem); + hres = create_element(This->doc_node, L"style", &elem); if(FAILED(hres)) return hres; @@ -2362,8 +2350,7 @@ static HRESULT WINAPI HTMLDocument3_getElementsByName(IHTMLDocument3 *iface, BST nsAString selector_str; WCHAR *selector; nsresult nsres; - - static const WCHAR formatW[] = {'*','[','i','d','=','%','s',']',',','*','[','n','a','m','e','=','%','s',']',0}; + static const WCHAR formatW[] = L"*[id=%s],*[name=%s]"; TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), ppelColl); @@ -3006,12 +2993,9 @@ static HRESULT WINAPI HTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR * { HTMLDocument *This = impl_from_IHTMLDocument5(iface); - static const WCHAR BackCompatW[] = {'B','a','c','k','C','o','m','p','a','t',0}; - static const WCHAR CSS1CompatW[] = {'C','S','S','1','C','o','m','p','a','t',0}; - TRACE("(%p)->(%p)\n", This, p); - *p = SysAllocString(This->doc_node->document_mode <= COMPAT_MODE_IE5 ? BackCompatW : CSS1CompatW); + *p = SysAllocString(This->doc_node->document_mode <= COMPAT_MODE_IE5 ? L"BackCompat" : L"CSS1Compat"); return *p ? S_OK : E_OUTOFMEMORY; } diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 1dcddbaa672..732db50a78c 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -860,13 +860,11 @@ HRESULT attr_value_to_string(VARIANT *v) { HRESULT hres; - static const WCHAR nullW[] = {'n','u','l','l',0}; - switch(V_VT(v)) { case VT_BSTR: break; case VT_NULL: - V_BSTR(v) = SysAllocString(nullW); + V_BSTR(v) = SysAllocString(L"null"); if(!V_BSTR(v)) return E_OUTOFMEMORY; V_VT(v) = VT_BSTR; @@ -1043,10 +1041,8 @@ static HRESULT WINAPI HTMLElement_get_tagName(IHTMLElement *iface, BSTR *p) TRACE("(%p)->(%p)\n", This, p); if(!This->dom_element) { - static const WCHAR comment_tagW[] = {'!',0}; - TRACE("comment element\n"); - *p = SysAllocString(comment_tagW); + *p = SysAllocString(L"!"); return *p ? S_OK : E_OUTOFMEMORY; } @@ -1314,8 +1310,6 @@ static HRESULT WINAPI HTMLElement_get_document(IHTMLElement *iface, IDispatch ** return S_OK; } -static const WCHAR titleW[] = {'t','i','t','l','e',0}; - static HRESULT WINAPI HTMLElement_put_title(IHTMLElement *iface, BSTR v) { HTMLElement *This = impl_from_IHTMLElement(iface); @@ -1328,7 +1322,7 @@ static HRESULT WINAPI HTMLElement_put_title(IHTMLElement *iface, BSTR v) VARIANT *var; HRESULT hres; - hres = dispex_get_dprop_ref(&This->node.event_target.dispex, titleW, TRUE, &var); + hres = dispex_get_dprop_ref(&This->node.event_target.dispex, L"title", TRUE, &var); if(FAILED(hres)) return hres; @@ -1359,7 +1353,7 @@ static HRESULT WINAPI HTMLElement_get_title(IHTMLElement *iface, BSTR *p) VARIANT *var; HRESULT hres; - hres = dispex_get_dprop_ref(&This->node.event_target.dispex, titleW, FALSE, &var); + hres = dispex_get_dprop_ref(&This->node.event_target.dispex, L"title", FALSE, &var); if(hres == DISP_E_UNKNOWNNAME) { *p = NULL; }else if(V_VT(var) != VT_BSTR) { @@ -1377,15 +1371,13 @@ static HRESULT WINAPI HTMLElement_get_title(IHTMLElement *iface, BSTR *p) return return_nsstr(nsres, &title_str, p); } -static const WCHAR languageW[] = {'l','a','n','g','u','a','g','e',0}; - static HRESULT WINAPI HTMLElement_put_language(IHTMLElement *iface, BSTR v) { HTMLElement *This = impl_from_IHTMLElement(iface); TRACE("(%p)->(%s)\n", This, debugstr_w(v)); - return elem_string_attr_setter(This, languageW, v); + return elem_string_attr_setter(This, L"language", v); } static HRESULT WINAPI HTMLElement_get_language(IHTMLElement *iface, BSTR *p) @@ -1394,7 +1386,7 @@ static HRESULT WINAPI HTMLElement_get_language(IHTMLElement *iface, BSTR *p) TRACE("(%p)->(%p)\n", This, p); - return elem_string_attr_getter(This, languageW, TRUE, p); + return elem_string_attr_getter(This, L"language", TRUE, p); } static HRESULT WINAPI HTMLElement_put_onselectstart(IHTMLElement *iface, VARIANT v) @@ -1845,12 +1837,7 @@ static HRESULT insert_adjacent_node(HTMLElement *This, const WCHAR *where, nsIDO nsresult nsres; HRESULT hres = S_OK; - static const WCHAR beforebeginW[] = {'b','e','f','o','r','e','b','e','g','i','n',0}; - static const WCHAR afterbeginW[] = {'a','f','t','e','r','b','e','g','i','n',0}; - static const WCHAR beforeendW[] = {'b','e','f','o','r','e','e','n','d',0}; - static const WCHAR afterendW[] = {'a','f','t','e','r','e','n','d',0}; - - if (!wcsicmp(where, beforebeginW)) { + if (!wcsicmp(where, L"beforebegin")) { nsIDOMNode *parent; nsres = nsIDOMNode_GetParentNode(This->node.nsnode, &parent); @@ -1862,7 +1849,7 @@ static HRESULT insert_adjacent_node(HTMLElement *This, const WCHAR *where, nsIDO nsres = nsIDOMNode_InsertBefore(parent, nsnode, This->node.nsnode, &ret_nsnode); nsIDOMNode_Release(parent); - }else if(!wcsicmp(where, afterbeginW)) { + }else if(!wcsicmp(where, L"afterbegin")) { nsIDOMNode *first_child; nsres = nsIDOMNode_GetFirstChild(This->node.nsnode, &first_child); @@ -1875,9 +1862,9 @@ static HRESULT insert_adjacent_node(HTMLElement *This, const WCHAR *where, nsIDO if (first_child) nsIDOMNode_Release(first_child); - }else if (!wcsicmp(where, beforeendW)) { + }else if (!wcsicmp(where, L"beforeend")) { nsres = nsIDOMNode_AppendChild(This->node.nsnode, nsnode, &ret_nsnode); - }else if (!wcsicmp(where, afterendW)) { + }else if (!wcsicmp(where, L"afterend")) { nsIDOMNode *next_sibling, *parent; nsres = nsIDOMNode_GetParentNode(This->node.nsnode, &parent); @@ -2806,7 +2793,7 @@ static HRESULT WINAPI HTMLElement2_put_accessKey(IHTMLElement2 *iface, BSTR v) HTMLElement *This = impl_from_IHTMLElement2(iface); VARIANT var; - static WCHAR accessKeyW[] = {'a','c','c','e','s','s','K','e','y',0}; + static WCHAR accessKeyW[] = L"accessKey"; TRACE("(%p)->(%s)\n", This, debugstr_w(v)); @@ -3016,9 +3003,7 @@ static HRESULT WINAPI HTMLElement2_get_readyState(IHTMLElement2 *iface, VARIANT if(FAILED(hres)) return hres; }else { - static const WCHAR completeW[] = {'c','o','m','p','l','e','t','e',0}; - - str = SysAllocString(completeW); + str = SysAllocString(L"complete"); if(!str) return E_OUTOFMEMORY; } @@ -3750,8 +3735,6 @@ static HRESULT WINAPI HTMLElement3_get_hideFocus(IHTMLElement3 *iface, VARIANT_B return E_NOTIMPL; } -static const WCHAR disabledW[] = {'d','i','s','a','b','l','e','d',0}; - static HRESULT WINAPI HTMLElement3_put_disabled(IHTMLElement3 *iface, VARIANT_BOOL v) { HTMLElement *This = impl_from_IHTMLElement3(iface); @@ -3763,7 +3746,7 @@ static HRESULT WINAPI HTMLElement3_put_disabled(IHTMLElement3 *iface, VARIANT_BO if(This->node.vtbl->put_disabled) return This->node.vtbl->put_disabled(&This->node, v); - hres = dispex_get_dprop_ref(&This->node.event_target.dispex, disabledW, TRUE, &var); + hres = dispex_get_dprop_ref(&This->node.event_target.dispex, L"disabled", TRUE, &var); if(FAILED(hres)) return hres; @@ -3784,7 +3767,7 @@ static HRESULT WINAPI HTMLElement3_get_disabled(IHTMLElement3 *iface, VARIANT_BO if(This->node.vtbl->get_disabled) return This->node.vtbl->get_disabled(&This->node, p); - hres = dispex_get_dprop_ref(&This->node.event_target.dispex, disabledW, FALSE, &var); + hres = dispex_get_dprop_ref(&This->node.event_target.dispex, L"disabled", FALSE, &var); if(hres == DISP_E_UNKNOWNNAME) { *p = VARIANT_FALSE; return S_OK; @@ -5095,9 +5078,7 @@ HRESULT elem_unique_id(unsigned id, BSTR *p) { WCHAR buf[32]; - static const WCHAR formatW[] = {'m','s','_','_','i','d','%','u',0}; - - swprintf(buf, ARRAY_SIZE(buf), formatW, id); + swprintf(buf, ARRAY_SIZE(buf), L"ms__id%u", id); *p = SysAllocString(buf); return *p ? S_OK : E_OUTOFMEMORY; } diff --git a/dlls/mshtml/htmlform.c b/dlls/mshtml/htmlform.c index 63e8f1bb2d0..b4715298a1b 100644 --- a/dlls/mshtml/htmlform.c +++ b/dlls/mshtml/htmlform.c @@ -227,19 +227,14 @@ static HRESULT WINAPI HTMLFormElement_get_dir(IHTMLFormElement *iface, BSTR *p) static HRESULT WINAPI HTMLFormElement_put_encoding(IHTMLFormElement *iface, BSTR v) { - static const WCHAR urlencodedW[] = {'a','p','p','l','i','c','a','t','i','o','n','/', - 'x','-','w','w','w','-','f','o','r','m','-','u','r','l','e','n','c','o','d','e','d',0}; - static const WCHAR dataW[] = {'m','u','l','t','i','p','a','r','t','/', - 'f','o','r','m','-','d','a','t','a',0}; - static const WCHAR plainW[] = {'t','e','x','t','/','p','l','a','i','n',0}; - HTMLFormElement *This = impl_from_IHTMLFormElement(iface); nsAString encoding_str; nsresult nsres; TRACE("(%p)->(%s)\n", This, wine_dbgstr_w(v)); - if(lstrcmpiW(v, urlencodedW) && lstrcmpiW(v, dataW) && lstrcmpiW(v, plainW)) { + if(lstrcmpiW(v, L"application/x-www-form-urlencoded") && lstrcmpiW(v, L"multipart/form-data") + && lstrcmpiW(v, L"text/plain")) { WARN("incorrect enctype\n"); return E_INVALIDARG; } @@ -268,16 +263,13 @@ static HRESULT WINAPI HTMLFormElement_get_encoding(IHTMLFormElement *iface, BSTR static HRESULT WINAPI HTMLFormElement_put_method(IHTMLFormElement *iface, BSTR v) { - static const WCHAR postW[] = {'P','O','S','T',0}; - static const WCHAR getW[] = {'G','E','T',0}; - HTMLFormElement *This = impl_from_IHTMLFormElement(iface); nsAString method_str; nsresult nsres; TRACE("(%p)->(%s)\n", This, wine_dbgstr_w(v)); - if(lstrcmpiW(v, postW) && lstrcmpiW(v, getW)) { + if(lstrcmpiW(v, L"POST") && lstrcmpiW(v, L"GET")) { WARN("unrecognized method\n"); return E_INVALIDARG; } diff --git a/dlls/mshtml/htmlframe.c b/dlls/mshtml/htmlframe.c index e451f030453..972ddc80a50 100644 --- a/dlls/mshtml/htmlframe.c +++ b/dlls/mshtml/htmlframe.c @@ -34,11 +34,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml); -static const WCHAR autoW[] = {'a','u','t','o',0}; -static const WCHAR yesW[] = {'y','e','s',0}; -static const WCHAR noW[] = {'n','o',0}; -static const WCHAR pxW[] = {'p','x',0}; - static HRESULT set_frame_doc(HTMLFrameBase *frame, nsIDOMDocument *nsdoc) { mozIDOMWindowProxy *mozwindow; @@ -343,7 +338,7 @@ static HRESULT WINAPI HTMLFrameBase_get_marginWidth(IHTMLFrameBase *iface, VARIA if(*str) { BSTR ret; - end = wcsstr(str, pxW); + end = wcsstr(str, L"px"); if(!end) end = str+lstrlenW(str); ret = SysAllocStringLen(str, end-str); @@ -410,7 +405,7 @@ static HRESULT WINAPI HTMLFrameBase_get_marginHeight(IHTMLFrameBase *iface, VARI if(*str) { BSTR ret; - end = wcsstr(str, pxW); + end = wcsstr(str, L"px"); if(!end) end = str+lstrlenW(str); ret = SysAllocStringLen(str, end-str); @@ -455,7 +450,7 @@ static HRESULT WINAPI HTMLFrameBase_put_scrolling(IHTMLFrameBase *iface, BSTR v) TRACE("(%p)->(%s)\n", This, debugstr_w(v)); - if(!(!wcsicmp(v, yesW) || !wcsicmp(v, noW) || !wcsicmp(v, autoW))) + if(!(!wcsicmp(v, L"yes") || !wcsicmp(v, L"no") || !wcsicmp(v, L"auto"))) return E_INVALIDARG; if(This->nsframe) { @@ -509,7 +504,7 @@ static HRESULT WINAPI HTMLFrameBase_get_scrolling(IHTMLFrameBase *iface, BSTR *p if(*strdata) *p = SysAllocString(strdata); else - *p = SysAllocString(autoW); + *p = SysAllocString(L"auto"); nsAString_Finish(&nsstr); diff --git a/dlls/mshtml/htmlhead.c b/dlls/mshtml/htmlhead.c index 57bd0e6f968..92eda92fbad 100644 --- a/dlls/mshtml/htmlhead.c +++ b/dlls/mshtml/htmlhead.c @@ -503,15 +503,13 @@ static HRESULT WINAPI HTMLMetaElement_get_url(IHTMLMetaElement *iface, BSTR *p) return E_NOTIMPL; } -static const WCHAR charsetW[] = {'c','h','a','r','s','e','t',0}; - static HRESULT WINAPI HTMLMetaElement_put_charset(IHTMLMetaElement *iface, BSTR v) { HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface); TRACE("(%p)->(%s)\n", This, debugstr_w(v)); - return elem_string_attr_setter(&This->element, charsetW, v); + return elem_string_attr_setter(&This->element, L"charset", v); } static HRESULT WINAPI HTMLMetaElement_get_charset(IHTMLMetaElement *iface, BSTR *p) @@ -520,7 +518,7 @@ static HRESULT WINAPI HTMLMetaElement_get_charset(IHTMLMetaElement *iface, BSTR TRACE("(%p)->(%p)\n", This, p); - return elem_string_attr_getter(&This->element, charsetW, TRUE, p); + return elem_string_attr_getter(&This->element, L"charset", TRUE, p); } static const IHTMLMetaElementVtbl HTMLMetaElementVtbl = { diff --git a/dlls/mshtml/htmlimg.c b/dlls/mshtml/htmlimg.c index 7f1ecd038b0..7dc32cd654d 100644 --- a/dlls/mshtml/htmlimg.c +++ b/dlls/mshtml/htmlimg.c @@ -303,8 +303,6 @@ static HRESULT WINAPI HTMLImgElement_get_src(IHTMLImgElement *iface, BSTR *p) nsresult nsres; HRESULT hres = S_OK; - static const WCHAR blockedW[] = {'B','L','O','C','K','E','D',':',':',0}; - TRACE("(%p)->(%p)\n", This, p); nsAString_Init(&src_str, NULL); @@ -312,9 +310,9 @@ static HRESULT WINAPI HTMLImgElement_get_src(IHTMLImgElement *iface, BSTR *p) if(NS_SUCCEEDED(nsres)) { nsAString_GetData(&src_str, &src); - if(!wcsnicmp(src, blockedW, ARRAY_SIZE(blockedW)-1)) { + if(!wcsnicmp(src, L"BLOCKED::", ARRAY_SIZE(L"BLOCKED::")-1)) { TRACE("returning BLOCKED::\n"); - *p = SysAllocString(blockedW); + *p = SysAllocString(L"BLOCKED::"); if(!*p) hres = E_OUTOFMEMORY; }else { diff --git a/dlls/mshtml/htmlinput.c b/dlls/mshtml/htmlinput.c index 765ae79c2b7..2ba5833f3c0 100644 --- a/dlls/mshtml/htmlinput.c +++ b/dlls/mshtml/htmlinput.c @@ -44,8 +44,6 @@ struct HTMLInputElement { nsIDOMHTMLInputElement *nsinput; }; -static const WCHAR forW[] = {'f','o','r',0}; - static inline HTMLInputElement *impl_from_IHTMLInputElement(IHTMLInputElement *iface) { return CONTAINING_RECORD(iface, HTMLInputElement, IHTMLInputElement_iface); @@ -1302,11 +1300,9 @@ static HRESULT WINAPI HTMLInputTextElement2_setSelectionRange(IHTMLInputTextElem nsAString none_str; nsresult nsres; - static const WCHAR noneW[] = {'n','o','n','e',0}; - TRACE("(%p)->(%d %d)\n", This, start, end); - nsAString_InitDepend(&none_str, noneW); + nsAString_InitDepend(&none_str, L"none"); nsres = nsIDOMHTMLInputElement_SetSelectionRange(This->nsinput, start, end, &none_str); nsAString_Finish(&none_str); if(NS_FAILED(nsres)) { @@ -1387,19 +1383,12 @@ static BOOL HTMLInputElement_is_text_edit(HTMLDOMNode *iface) nsresult nsres; BOOL ret = FALSE; - static const WCHAR buttonW[] = {'b','u','t','t','o','n',0}; - static const WCHAR hiddenW[] = {'h','i','d','d','e','n',0}; - static const WCHAR passwordW[] = {'p','a','s','s','w','o','r','d',0}; - static const WCHAR resetW[] = {'r','e','s','e','t',0}; - static const WCHAR submitW[] = {'s','u','b','m','i','t',0}; - static const WCHAR textW[] = {'t','e','x','t',0}; - nsAString_Init(&nsstr, NULL); nsres = nsIDOMHTMLInputElement_GetType(This->nsinput, &nsstr); if(NS_SUCCEEDED(nsres)) { nsAString_GetData(&nsstr, &type); - ret = !wcscmp(type, buttonW) || !wcscmp(type, hiddenW) || !wcscmp(type, passwordW) - || !wcscmp(type, resetW) || !wcscmp(type, submitW) || !wcscmp(type, textW); + ret = !wcscmp(type, L"button") || !wcscmp(type, L"hidden") || !wcscmp(type, L"password") + || !wcscmp(type, L"reset") || !wcscmp(type, L"submit") || !wcscmp(type, L"text"); } nsAString_Finish(&nsstr); return ret; @@ -1557,7 +1546,7 @@ static HRESULT WINAPI HTMLLabelElement_put_htmlFor(IHTMLLabelElement *iface, BST TRACE("(%p)->(%s)\n", This, debugstr_w(v)); - nsAString_InitDepend(&for_str, forW); + nsAString_InitDepend(&for_str, L"for"); nsAString_InitDepend(&val_str, v); nsres = nsIDOMElement_SetAttribute(This->element.dom_element, &for_str, &val_str); nsAString_Finish(&for_str); @@ -1576,7 +1565,7 @@ static HRESULT WINAPI HTMLLabelElement_get_htmlFor(IHTMLLabelElement *iface, BST TRACE("(%p)->(%p)\n", This, p); - return elem_string_attr_getter(&This->element, forW, FALSE, p); + return elem_string_attr_getter(&This->element, L"for", FALSE, p); } static HRESULT WINAPI HTMLLabelElement_put_accessKey(IHTMLLabelElement *iface, BSTR v) diff --git a/dlls/mshtml/htmllocation.c b/dlls/mshtml/htmllocation.c index 7d102044cc2..4e15fb45242 100644 --- a/dlls/mshtml/htmllocation.c +++ b/dlls/mshtml/htmllocation.c @@ -350,12 +350,11 @@ static HRESULT WINAPI HTMLLocation_get_host(IHTMLLocation *iface, BSTR *p) if(url.nPort) { /* : */ - static const WCHAR format[] = {'%','u',0}; DWORD len, port_len; WCHAR portW[6]; WCHAR *buf; - port_len = swprintf(portW, ARRAY_SIZE(portW), format, url.nPort); + port_len = swprintf(portW, ARRAY_SIZE(portW), L"%u", url.nPort); len = url.dwHostNameLength + 1 /* ':' */ + port_len; buf = *p = SysAllocStringLen(NULL, len); memcpy(buf, url.lpszHostName, url.dwHostNameLength * sizeof(WCHAR)); @@ -435,10 +434,9 @@ static HRESULT WINAPI HTMLLocation_get_port(IHTMLLocation *iface, BSTR *p) return hres; if(hres == S_OK) { - static const WCHAR formatW[] = {'%','u',0}; WCHAR buf[12]; - swprintf(buf, ARRAY_SIZE(buf), formatW, port); + swprintf(buf, ARRAY_SIZE(buf), L"%u", port); *p = SysAllocString(buf); }else { *p = SysAllocStringLen(NULL, 0); diff --git a/dlls/mshtml/htmlobject.c b/dlls/mshtml/htmlobject.c index 9505820583f..b71b0e7db6f 100644 --- a/dlls/mshtml/htmlobject.c +++ b/dlls/mshtml/htmlobject.c @@ -267,8 +267,7 @@ static HRESULT WINAPI HTMLObjectElement_put_width(IHTMLObjectElement *iface, VAR switch(V_VT(&v)) { case VT_I4: { - static const WCHAR formatW[] = {'%','d',0}; - swprintf(buf, ARRAY_SIZE(buf), formatW, V_I4(&v)); + swprintf(buf, ARRAY_SIZE(buf), L"%d", V_I4(&v)); break; } default: @@ -326,8 +325,7 @@ static HRESULT WINAPI HTMLObjectElement_put_height(IHTMLObjectElement *iface, VA switch(V_VT(&v)) { case VT_I4: { - static const WCHAR formatW[] = {'%','d',0}; - swprintf(buf, ARRAY_SIZE(buf), formatW, V_I4(&v)); + swprintf(buf, ARRAY_SIZE(buf), L"%d", V_I4(&v)); break; } default: @@ -577,11 +575,9 @@ static HRESULT WINAPI HTMLObjectElement2_put_classid(IHTMLObjectElement2 *iface, HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface); HRESULT hres; - static const WCHAR classidW[] = {'c','l','a','s','s','i','d',0}; - FIXME("(%p)->(%s) semi-stub\n", This, debugstr_w(v)); - hres = elem_string_attr_setter(&This->plugin_container.element, classidW, v); + hres = elem_string_attr_setter(&This->plugin_container.element, L"classid", v); if(FAILED(hres)) return hres; diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index ae21c1f7299..43a71d6286c 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -35,20 +35,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml); -static const WCHAR blinkW[] = {'b','l','i','n','k',0}; -static const WCHAR dashedW[] = {'d','a','s','h','e','d',0}; -static const WCHAR dottedW[] = {'d','o','t','t','e','d',0}; -static const WCHAR doubleW[] = {'d','o','u','b','l','e',0}; -static const WCHAR grooveW[] = {'g','r','o','o','v','e',0}; -static const WCHAR insetW[] = {'i','n','s','e','t',0}; -static const WCHAR line_throughW[] = {'l','i','n','e','-','t','h','r','o','u','g','h',0}; -static const WCHAR noneW[] = {'n','o','n','e',0}; -static const WCHAR outsetW[] = {'o','u','t','s','e','t',0}; -static const WCHAR overlineW[] = {'o','v','e','r','l','i','n','e',0}; -static const WCHAR ridgeW[] = {'r','i','d','g','e',0}; -static const WCHAR solidW[] = {'s','o','l','i','d',0}; -static const WCHAR underlineW[] = {'u','n','d','e','r','l','i','n','e',0}; - static const WCHAR *font_style_values[] = { L"italic", L"normal", @@ -125,8 +111,6 @@ static const WCHAR *overflow_values[] = { #define ATTR_NO_NULL 0x0020 #define ATTR_COMPAT_IE10 0x0040 -static const WCHAR pxW[] = {'p','x',0}; - typedef struct { const WCHAR *name; DISPID dispid; @@ -708,9 +692,6 @@ static const style_tbl_entry_t style_tbl[] = { C_ASSERT(ARRAY_SIZE(style_tbl) == STYLEID_MAX_VALUE); -static const WCHAR px_formatW[] = {'%','d','p','x',0}; -static const WCHAR emptyW[] = {0}; - static const style_tbl_entry_t *lookup_style_tbl(CSSStyle *style, const WCHAR *name) { int c, i, min = 0, max = ARRAY_SIZE(style_tbl)-1; @@ -798,7 +779,7 @@ static HRESULT set_nsstyle_property(nsIDOMCSSStyleDeclaration *nsstyle, styleid_ nsresult nsres; nsAString_InitDepend(&str_name, style_tbl[sid].name); - nsAString_InitDepend(&str_empty, emptyW); + nsAString_InitDepend(&str_empty, L""); nsres = nsIDOMCSSStyleDeclaration_SetProperty(nsstyle, &str_name, value, &str_empty); nsAString_Finish(&str_name); nsAString_Finish(&str_empty); @@ -837,7 +818,7 @@ static inline HRESULT set_style_property(CSSStyle *style, styleid_t sid, const W } if(!*iter) { WARN("invalid value %s\n", debugstr_w(value)); - nsAString_InitDepend(&value_str, emptyW); + nsAString_InitDepend(&value_str, L""); set_nsstyle_property(style->nsstyle, sid, &value_str); nsAString_Finish(&value_str); return E_INVALIDARG; @@ -1027,12 +1008,11 @@ static HRESULT check_style_attr_value(HTMLStyle *This, styleid_t sid, LPCWSTR ex static inline HRESULT set_style_pos(HTMLStyle *This, styleid_t sid, float value) { - static const WCHAR szFormat[] = {'%','.','0','f','p','x',0}; WCHAR szValue[25]; value = floor(value); - swprintf(szValue, ARRAY_SIZE(szValue), szFormat, value); + swprintf(szValue, ARRAY_SIZE(szValue), L"%.0fpx", value); return set_style_property(&This->css_style, sid, szValue); } @@ -1041,7 +1021,7 @@ static HRESULT set_style_pxattr(HTMLStyle *style, styleid_t sid, LONG value) { WCHAR value_str[16]; - swprintf(value_str, ARRAY_SIZE(value_str), px_formatW, value); + swprintf(value_str, ARRAY_SIZE(value_str), L"%dpx", value); return set_style_property(&style->css_style, sid, value_str); } @@ -1068,7 +1048,7 @@ static HRESULT get_nsstyle_pos(HTMLStyle *This, styleid_t sid, float *p) { *p = wcstol(value, &ptr, 10); - if(*ptr && wcscmp(ptr, pxW)) + if(*ptr && wcscmp(ptr, L"px")) { nsAString_Finish(&str_value); FIXME("only px values are currently supported\n"); @@ -1108,7 +1088,7 @@ static HRESULT get_nsstyle_pixel_val(HTMLStyle *This, styleid_t sid, LONG *p) } } - if(!ptr || (*ptr && wcscmp(ptr, pxW))) + if(!ptr || (*ptr && wcscmp(ptr, L"px"))) *p = 0; } @@ -1118,11 +1098,11 @@ static HRESULT get_nsstyle_pixel_val(HTMLStyle *This, styleid_t sid, LONG *p) static BOOL is_valid_border_style(BSTR v) { - return !v || wcsicmp(v, noneW) == 0 || wcsicmp(v, dottedW) == 0 || - wcsicmp(v, dashedW) == 0 || wcsicmp(v, solidW) == 0 || - wcsicmp(v, doubleW) == 0 || wcsicmp(v, grooveW) == 0 || - wcsicmp(v, ridgeW) == 0 || wcsicmp(v, insetW) == 0 || - wcsicmp(v, outsetW) == 0; + return !v || wcsicmp(v, L"none") == 0 || wcsicmp(v, L"dotted") == 0 || + wcsicmp(v, L"dashed") == 0 || wcsicmp(v, L"solid") == 0 || + wcsicmp(v, L"double") == 0 || wcsicmp(v, L"groove") == 0 || + wcsicmp(v, L"ridge") == 0 || wcsicmp(v, L"inset") == 0 || + wcsicmp(v, L"outset") == 0; } static void *HTMLStyle_QI(CSSStyle *css_style, REFIID riid) @@ -1514,7 +1494,7 @@ static HRESULT WINAPI HTMLStyle_put_textDecorationNone(IHTMLStyle *iface, VARIAN TRACE("(%p)->(%x)\n", This, v); - return set_style_property(&This->css_style, STYLEID_TEXT_DECORATION, v ? noneW : emptyW); + return set_style_property(&This->css_style, STYLEID_TEXT_DECORATION, v ? L"none" : L""); } static HRESULT WINAPI HTMLStyle_get_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL *p) @@ -1523,7 +1503,7 @@ static HRESULT WINAPI HTMLStyle_get_textDecorationNone(IHTMLStyle *iface, VARIAN TRACE("(%p)->(%p)\n", This, p); - return check_style_attr_value(This, STYLEID_TEXT_DECORATION, noneW, p); + return check_style_attr_value(This, STYLEID_TEXT_DECORATION, L"none", p); } static HRESULT WINAPI HTMLStyle_put_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL v) @@ -1532,7 +1512,7 @@ static HRESULT WINAPI HTMLStyle_put_textDecorationUnderline(IHTMLStyle *iface, V TRACE("(%p)->(%x)\n", This, v); - return set_style_property(&This->css_style, STYLEID_TEXT_DECORATION, v ? underlineW : emptyW); + return set_style_property(&This->css_style, STYLEID_TEXT_DECORATION, v ? L"underline" : L""); } static HRESULT WINAPI HTMLStyle_get_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL *p) @@ -1541,7 +1521,7 @@ static HRESULT WINAPI HTMLStyle_get_textDecorationUnderline(IHTMLStyle *iface, V TRACE("(%p)->(%p)\n", This, p); - return check_style_attr_value(This, STYLEID_TEXT_DECORATION, underlineW, p); + return check_style_attr_value(This, STYLEID_TEXT_DECORATION, L"underline", p); } static HRESULT WINAPI HTMLStyle_put_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL v) @@ -1550,7 +1530,7 @@ static HRESULT WINAPI HTMLStyle_put_textDecorationOverline(IHTMLStyle *iface, VA TRACE("(%p)->(%x)\n", This, v); - return set_style_property(&This->css_style, STYLEID_TEXT_DECORATION, v ? overlineW : emptyW); + return set_style_property(&This->css_style, STYLEID_TEXT_DECORATION, v ? L"overline" : L""); } static HRESULT WINAPI HTMLStyle_get_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL *p) @@ -1559,7 +1539,7 @@ static HRESULT WINAPI HTMLStyle_get_textDecorationOverline(IHTMLStyle *iface, VA TRACE("(%p)->(%p)\n", This, p); - return check_style_attr_value(This, STYLEID_TEXT_DECORATION, overlineW, p); + return check_style_attr_value(This, STYLEID_TEXT_DECORATION, L"overline", p); } static HRESULT WINAPI HTMLStyle_put_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL v) @@ -1568,7 +1548,7 @@ static HRESULT WINAPI HTMLStyle_put_textDecorationLineThrough(IHTMLStyle *iface, TRACE("(%p)->(%x)\n", This, v); - return set_style_property(&This->css_style, STYLEID_TEXT_DECORATION, v ? line_throughW : emptyW); + return set_style_property(&This->css_style, STYLEID_TEXT_DECORATION, v ? L"line-through" : L""); } static HRESULT WINAPI HTMLStyle_get_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL *p) @@ -1577,7 +1557,7 @@ static HRESULT WINAPI HTMLStyle_get_textDecorationLineThrough(IHTMLStyle *iface, TRACE("(%p)->(%p)\n", This, p); - return check_style_attr_value(This, STYLEID_TEXT_DECORATION, line_throughW, p); + return check_style_attr_value(This, STYLEID_TEXT_DECORATION, L"line-through", p); } static HRESULT WINAPI HTMLStyle_put_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL v) @@ -1586,7 +1566,7 @@ static HRESULT WINAPI HTMLStyle_put_textDecorationBlink(IHTMLStyle *iface, VARIA TRACE("(%p)->(%x)\n", This, v); - return set_style_property(&This->css_style, STYLEID_TEXT_DECORATION, v ? blinkW : emptyW); + return set_style_property(&This->css_style, STYLEID_TEXT_DECORATION, v ? L"blink" : L""); } static HRESULT WINAPI HTMLStyle_get_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL *p) @@ -1595,7 +1575,7 @@ static HRESULT WINAPI HTMLStyle_get_textDecorationBlink(IHTMLStyle *iface, VARIA TRACE("(%p)->(%p)\n", This, p); - return check_style_attr_value(This, STYLEID_TEXT_DECORATION, blinkW, p); + return check_style_attr_value(This, STYLEID_TEXT_DECORATION, L"blink", p); } static HRESULT WINAPI HTMLStyle_put_verticalAlign(IHTMLStyle *iface, VARIANT v) @@ -2117,7 +2097,6 @@ static HRESULT WINAPI HTMLStyle_get_borderLeftWidth(IHTMLStyle *iface, VARIANT * static HRESULT WINAPI HTMLStyle_put_borderStyle(IHTMLStyle *iface, BSTR v) { HTMLStyle *This = impl_from_IHTMLStyle(iface); - static const WCHAR styleWindowInset[] = {'w','i','n','d','o','w','-','i','n','s','e','t',0}; HRESULT hres = S_OK; BSTR pstyle; int i=0; @@ -2130,7 +2109,7 @@ static HRESULT WINAPI HTMLStyle_put_borderStyle(IHTMLStyle *iface, BSTR v) if(v[i] == (WCHAR)' ') { pstyle = SysAllocStringLen(&v[last], (i-last)); - if( !(is_valid_border_style(pstyle) || wcsicmp(styleWindowInset, pstyle) == 0)) + if( !(is_valid_border_style(pstyle) || wcsicmp(L"window-inset", pstyle) == 0)) { TRACE("1. Invalid style (%s)\n", debugstr_w(pstyle)); hres = E_INVALIDARG; @@ -2144,7 +2123,7 @@ static HRESULT WINAPI HTMLStyle_put_borderStyle(IHTMLStyle *iface, BSTR v) if(hres == S_OK) { pstyle = SysAllocStringLen(&v[last], i-last); - if( !(is_valid_border_style(pstyle) || wcsicmp(styleWindowInset, pstyle) == 0)) + if( !(is_valid_border_style(pstyle) || wcsicmp(L"window-inset", pstyle) == 0)) { TRACE("2. Invalid style (%s)\n", debugstr_w(pstyle)); hres = E_INVALIDARG; @@ -2755,13 +2734,11 @@ static void set_opacity(HTMLStyle *This, const WCHAR *val) nsAString name_str, val_str, empty_str; nsresult nsres; - static const WCHAR opacityW[] = {'o','p','a','c','i','t','y',0}; - TRACE("%s\n", debugstr_w(val)); - nsAString_InitDepend(&name_str, opacityW); + nsAString_InitDepend(&name_str, L"opacity"); nsAString_InitDepend(&val_str, val); - nsAString_InitDepend(&empty_str, emptyW); + nsAString_InitDepend(&empty_str, L""); nsres = nsIDOMCSSStyleDeclaration_SetProperty(This->css_style.nsstyle, &name_str, &val_str, &empty_str); if(NS_FAILED(nsres)) @@ -2784,7 +2761,7 @@ static void update_filter(HTMLStyle *This) ptr = This->elem->filter; TRACE("%s\n", debugstr_w(ptr)); if(!ptr) { - set_opacity(This, emptyW); + set_opacity(This, L""); return; } @@ -2807,7 +2784,6 @@ static void update_filter(HTMLStyle *This) } if(ptr2 + ARRAY_SIZE(alphaW) == ptr && !memcmp(ptr2, alphaW, sizeof(alphaW))) { - static const WCHAR formatW[] = {'%','f',0}; static const WCHAR opacityW[] = {'o','p','a','c','i','t','y','='}; ptr++; @@ -2839,7 +2815,7 @@ static void update_filter(HTMLStyle *This) } } - swprintf(buf, ARRAY_SIZE(buf), formatW, fval * 0.01f); + swprintf(buf, ARRAY_SIZE(buf), L"%f", fval * 0.01f); set_opacity(This, buf); }else { FIXME("unknown param %s\n", debugstr_wn(ptr2, ptr-ptr2)); @@ -5137,10 +5113,8 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_put_backgroundPositionX(IHTMLCSSSt nsAString_GetData(&pos_str, &pos); posy = wcschr(pos, ' '); if(!posy) { - static const WCHAR zero_pxW[] = {' ','0','p','x',0}; - TRACE("no space in %s\n", debugstr_w(pos)); - posy = zero_pxW; + posy = L" 0px"; } posy_len = lstrlenW(posy); @@ -5234,11 +5208,9 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_put_backgroundPositionY(IHTMLCSSSt if(space) { space++; }else { - static const WCHAR zero_pxW[] = {'0','p','x',' ',0}; - TRACE("no space in %s\n", debugstr_w(pos)); - pos = zero_pxW; - space = pos + ARRAY_SIZE(zero_pxW)-1; + pos = L"0px "; + space = pos + ARRAY_SIZE(L"0px ")-1; } posx_len = space-pos; @@ -6521,8 +6493,6 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_get_layoutFlow(IHTMLCSSStyleDeclar return E_NOTIMPL; } -static const WCHAR zoomW[] = {'z','o','o','m',0}; - static HRESULT WINAPI HTMLCSSStyleDeclaration_put_zoom(IHTMLCSSStyleDeclaration *iface, VARIANT v) { CSSStyle *This = impl_from_IHTMLCSSStyleDeclaration(iface); @@ -6536,7 +6506,7 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_put_zoom(IHTMLCSSStyleDeclaration if(V_VT(&v) != VT_I4 || V_I4(&v) != 1) WARN("stub for %s\n", debugstr_variant(&v)); - hres = dispex_get_dprop_ref(&This->dispex, zoomW, TRUE, &var); + hres = dispex_get_dprop_ref(&This->dispex, L"zoom", TRUE, &var); if(FAILED(hres)) return hres; @@ -6551,7 +6521,7 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_get_zoom(IHTMLCSSStyleDeclaration TRACE("(%p)->(%p)\n", This, p); - hres = dispex_get_dprop_ref(&This->dispex, zoomW, FALSE, &var); + hres = dispex_get_dprop_ref(&This->dispex, L"zoom", FALSE, &var); if(hres == DISP_E_UNKNOWNNAME) { V_VT(p) = VT_BSTR; V_BSTR(p) = NULL; diff --git a/dlls/mshtml/htmltable.c b/dlls/mshtml/htmltable.c index 43a4f6ba08a..ad74ad30966 100644 --- a/dlls/mshtml/htmltable.c +++ b/dlls/mshtml/htmltable.c @@ -1191,8 +1191,7 @@ static HRESULT WINAPI HTMLTable_put_cellSpacing(IHTMLTable *iface, VARIANT v) nsAString_InitDepend(&nsstr, V_BSTR(&v)); break; case VT_I4: { - static const WCHAR formatW[] = {'%','d',0}; - swprintf(buf, ARRAY_SIZE(buf), formatW, V_I4(&v)); + swprintf(buf, ARRAY_SIZE(buf), L"%d", V_I4(&v)); nsAString_InitDepend(&nsstr, buf); break; } diff --git a/dlls/mshtml/htmltextarea.c b/dlls/mshtml/htmltextarea.c index caf5d85f749..fb8c3830862 100644 --- a/dlls/mshtml/htmltextarea.c +++ b/dlls/mshtml/htmltextarea.c @@ -101,13 +101,11 @@ static HRESULT WINAPI HTMLTextAreaElement_Invoke(IHTMLTextAreaElement *iface, DI static HRESULT WINAPI HTMLTextAreaElement_get_type(IHTMLTextAreaElement *iface, BSTR *p) { - static const WCHAR textareaW[] = {'t','e','x','t','a','r','e','a',0}; - HTMLTextAreaElement *This = impl_from_IHTMLTextAreaElement(iface); TRACE("(%p)->(%p)\n", This, p); - *p = SysAllocString(textareaW); + *p = SysAllocString(L"textarea"); if(!*p) return E_OUTOFMEMORY; return S_OK; diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index a49cd4bd59d..69717ff7848 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -978,8 +978,6 @@ static HRESULT WINAPI HTMLWindow2_open(IHTMLWindow2 *iface, BSTR url, BSTR name, IUri *uri; HRESULT hres; - static const WCHAR _selfW[] = {'_','s','e','l','f',0}; - TRACE("(%p)->(%s %s %s %x %p)\n", This, debugstr_w(url), debugstr_w(name), debugstr_w(features), replace, pomWindowResult); if(features) @@ -991,7 +989,7 @@ static HRESULT WINAPI HTMLWindow2_open(IHTMLWindow2 *iface, BSTR url, BSTR name, return E_UNEXPECTED; if(name && *name == '_') { - if(!wcscmp(name, _selfW)) { + if(!wcscmp(name, L"_self")) { if((features && *features) || replace) FIXME("Unsupported arguments for _self target\n"); @@ -1440,14 +1438,12 @@ static HRESULT WINAPI HTMLWindow2_toString(IHTMLWindow2 *iface, BSTR *String) { HTMLWindow *This = impl_from_IHTMLWindow2(iface); - static const WCHAR objectW[] = {'[','o','b','j','e','c','t',']',0}; - TRACE("(%p)->(%p)\n", This, String); if(!String) return E_INVALIDARG; - *String = SysAllocString(objectW); + *String = SysAllocString(L"[object]"); return *String ? S_OK : E_OUTOFMEMORY; } -- 2.26.2