Commit 33de9b14 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

mshtml: Use wide-char string literals for PRUnichar strings.

parent 09789846
......@@ -657,13 +657,10 @@ static HRESULT exec_italic(HTMLDocumentNode *doc, DWORD cmdexecopt, VARIANT *in,
static HRESULT query_justify(HTMLDocumentNode *doc, OLECMD *cmd)
{
static const PRUnichar justifycenterW[] = {'j','u','s','t','i','f','y','c','e','n','t','e','r',0};
static const PRUnichar justifyrightW[] = {'j','u','s','t','i','f','y','r','i','g','h','t',0};
switch(cmd->cmdID) {
case IDM_JUSTIFYCENTER:
TRACE("(%p) IDM_JUSTIFYCENTER\n", doc);
cmd->cmdf = query_align_status(doc, justifycenterW);
cmd->cmdf = query_align_status(doc, L"justifycenter");
break;
case IDM_JUSTIFYLEFT:
TRACE("(%p) IDM_JUSTIFYLEFT\n", doc);
......@@ -675,7 +672,7 @@ static HRESULT query_justify(HTMLDocumentNode *doc, OLECMD *cmd)
break;
case IDM_JUSTIFYRIGHT:
TRACE("(%p) IDM_JUSTIFYRIGHT\n", doc);
cmd->cmdf = query_align_status(doc, justifyrightW);
cmd->cmdf = query_align_status(doc, L"justifyright");
break;
}
......
......@@ -5720,9 +5720,7 @@ HRESULT create_document_node(nsIDOMHTMLDocument *nsdoc, GeckoBrowser *browser, H
nsAString mode_str;
nsresult nsres;
static const PRUnichar onW[] = {'o','n',0};
nsAString_InitDepend(&mode_str, onW);
nsAString_InitDepend(&mode_str, L"on");
nsres = nsIDOMHTMLDocument_SetDesignMode(doc->nsdoc, &mode_str);
nsAString_Finish(&mode_str);
if(NS_FAILED(nsres))
......
......@@ -375,8 +375,6 @@ static BOOL is_elem_name(HTMLElement *elem, LPCWSTR name)
BOOL ret = FALSE;
nsresult nsres;
static const PRUnichar nameW[] = {'n','a','m','e',0};
if(!elem->dom_element)
return FALSE;
......@@ -388,7 +386,7 @@ static BOOL is_elem_name(HTMLElement *elem, LPCWSTR name)
return TRUE;
}
nsres = get_elem_attr_value(elem->dom_element, nameW, &nsstr, &str);
nsres = get_elem_attr_value(elem->dom_element, L"name", &nsstr, &str);
if(NS_SUCCEEDED(nsres)) {
ret = !wcsicmp(str, name);
nsAString_Finish(&nsstr);
......
......@@ -456,11 +456,9 @@ static HRESULT WINAPI HTMLFormElement_submit(IHTMLFormElement *iface)
if(NS_SUCCEEDED(nsres)) {
const PRUnichar *method;
static const PRUnichar postW[] = {'p','o','s','t',0};
nsAString_GetData(&method_str, &method);
TRACE("method is %s\n", debugstr_w(method));
is_post_submit = !wcsicmp(method, postW);
is_post_submit = !wcsicmp(method, L"post");
}
nsAString_Finish(&method_str);
......@@ -661,8 +659,6 @@ static HRESULT HTMLFormElement_get_dispid(HTMLDOMNode *iface,
nsresult nsres;
HRESULT hres = DISP_E_UNKNOWNNAME;
static const PRUnichar nameW[] = {'n','a','m','e',0};
TRACE("(%p)->(%s %x %p)\n", This, wine_dbgstr_w(name), grfdex, pid);
nsres = nsIDOMHTMLFormElement_GetElements(This->nsform, &elements);
......@@ -731,7 +727,7 @@ static HRESULT HTMLFormElement_get_dispid(HTMLDOMNode *iface,
}
/* compare by name attr */
nsres = get_elem_attr_value(elem, nameW, &name_str, &str);
nsres = get_elem_attr_value(elem, L"name", &name_str, &str);
nsIDOMElement_Release(elem);
if(NS_SUCCEEDED(nsres)) {
if(!wcsicmp(str, name)) {
......
......@@ -448,11 +448,10 @@ static HRESULT WINAPI HTMLMetaElement_put_httpEquiv(IHTMLMetaElement *iface, BST
static HRESULT WINAPI HTMLMetaElement_get_httpEquiv(IHTMLMetaElement *iface, BSTR *p)
{
HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
static const PRUnichar httpEquivW[] = {'h','t','t','p','-','e','q','u','i','v',0};
TRACE("(%p)->(%p)\n", This, p);
return elem_string_attr_getter(&This->element, httpEquivW, TRUE, p);
return elem_string_attr_getter(&This->element, L"http-equiv", TRUE, p);
}
static HRESULT WINAPI HTMLMetaElement_put_content(IHTMLMetaElement *iface, BSTR v)
......@@ -465,11 +464,10 @@ static HRESULT WINAPI HTMLMetaElement_put_content(IHTMLMetaElement *iface, BSTR
static HRESULT WINAPI HTMLMetaElement_get_content(IHTMLMetaElement *iface, BSTR *p)
{
HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
static const PRUnichar contentW[] = {'c','o','n','t','e','n','t',0};
TRACE("(%p)->(%p)\n", This, p);
return elem_string_attr_getter(&This->element, contentW, TRUE, p);
return elem_string_attr_getter(&This->element, L"content", TRUE, p);
}
static HRESULT WINAPI HTMLMetaElement_put_name(IHTMLMetaElement *iface, BSTR v)
......@@ -482,11 +480,10 @@ static HRESULT WINAPI HTMLMetaElement_put_name(IHTMLMetaElement *iface, BSTR v)
static HRESULT WINAPI HTMLMetaElement_get_name(IHTMLMetaElement *iface, BSTR *p)
{
HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
static const PRUnichar nameW[] = {'n','a','m','e',0};
TRACE("(%p)->(%p)\n", This, p);
return elem_string_attr_getter(&This->element, nameW, TRUE, p);
return elem_string_attr_getter(&This->element, L"name", TRUE, p);
}
static HRESULT WINAPI HTMLMetaElement_put_url(IHTMLMetaElement *iface, BSTR v)
......
......@@ -876,8 +876,6 @@ static HRESULT WINAPI HTMLImageElementFactory_create(IHTMLImageElementFactory *i
LONG l;
HRESULT hres;
static const PRUnichar imgW[] = {'I','M','G',0};
TRACE("(%p)->(%s %s %p)\n", This, debugstr_variant(&width),
debugstr_variant(&height), img_elem);
......@@ -890,7 +888,7 @@ static HRESULT WINAPI HTMLImageElementFactory_create(IHTMLImageElementFactory *i
*img_elem = NULL;
hres = create_nselem(doc, imgW, &nselem);
hres = create_nselem(doc, L"IMG", &nselem);
if(FAILED(hres))
return hres;
......
......@@ -538,8 +538,6 @@ static HRESULT WINAPI HTMLOptionElementFactory_create(IHTMLOptionElementFactory
HTMLDOMNode *node;
HRESULT hres;
static const PRUnichar optionW[] = {'O','P','T','I','O','N',0};
TRACE("(%p)->(%s %s %s %s %p)\n", This, debugstr_variant(&text), debugstr_variant(&value),
debugstr_variant(&defaultselected), debugstr_variant(&selected), optelem);
......@@ -550,7 +548,7 @@ static HRESULT WINAPI HTMLOptionElementFactory_create(IHTMLOptionElementFactory
*optelem = NULL;
hres = create_nselem(This->window->doc, optionW, &nselem);
hres = create_nselem(This->window->doc, L"OPTION", &nselem);
if(FAILED(hres))
return hres;
......
......@@ -38,11 +38,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
static const PRUnichar blurW[] = {'b','l','u','r',0};
static const PRUnichar focusW[] = {'f','o','c','u','s',0};
static const PRUnichar keypressW[] = {'k','e','y','p','r','e','s','s',0};
static const PRUnichar loadW[] = {'l','o','a','d',0};
typedef struct {
nsIDOMEventListener nsIDOMEventListener_iface;
nsDocumentEventListener *This;
......@@ -446,10 +441,10 @@ void release_nsevents(HTMLDocumentNode *doc)
if(!listener)
return;
detach_nslistener(doc, blurW, &listener->blur_listener, TRUE);
detach_nslistener(doc, focusW, &listener->focus_listener, TRUE);
detach_nslistener(doc, keypressW, &listener->keypress_listener, FALSE);
detach_nslistener(doc, loadW, &listener->load_listener, TRUE);
detach_nslistener(doc, L"blur", &listener->blur_listener, TRUE);
detach_nslistener(doc, L"focus", &listener->focus_listener, TRUE);
detach_nslistener(doc, L"keypress", &listener->keypress_listener, FALSE);
detach_nslistener(doc, L"load", &listener->load_listener, TRUE);
listener->doc = NULL;
release_listener(listener);
......@@ -482,10 +477,10 @@ void init_nsevents(HTMLDocumentNode *doc)
if(!target)
return;
init_event(target, blurW, &listener->blur_listener.nsIDOMEventListener_iface, TRUE);
init_event(target, focusW, &listener->focus_listener.nsIDOMEventListener_iface, TRUE);
init_event(target, keypressW, &listener->keypress_listener.nsIDOMEventListener_iface, FALSE);
init_event(target, loadW, &listener->load_listener.nsIDOMEventListener_iface, TRUE);
init_event(target, L"blur", &listener->blur_listener.nsIDOMEventListener_iface, TRUE);
init_event(target, L"focus", &listener->focus_listener.nsIDOMEventListener_iface, TRUE);
init_event(target, L"keypress", &listener->keypress_listener.nsIDOMEventListener_iface, FALSE);
init_event(target, L"load", &listener->load_listener.nsIDOMEventListener_iface, TRUE);
nsIDOMEventTarget_Release(target);
}
......@@ -126,8 +126,6 @@ static nsresult NSAPI nsPromptService_ConfirmEx(nsIPromptService *iface,
const PRUnichar *aButton1Title, const PRUnichar *aButton2Title,
const PRUnichar *aCheckMsg, cpp_bool *aCheckState, LONG *_retval)
{
static const PRUnichar wszContinue[] = {'C','o','n','t','i','n','u','e',0};
FIXME("(%p %s %s %08x %s %s %s %s %p %p) hack!\n", aParent, debugstr_w(aDialogTitle),
debugstr_w(aText), aButtonFlags, debugstr_w(aButton0Title),
debugstr_w(aButton1Title), debugstr_w(aButton2Title), debugstr_w(aCheckMsg),
......@@ -138,11 +136,11 @@ static nsresult NSAPI nsPromptService_ConfirmEx(nsIPromptService *iface,
* This is really very very ugly hack!!!
*/
if(aButton0Title && !memcmp(aButton0Title, wszContinue, sizeof(wszContinue)))
if(aButton0Title && !memcmp(aButton0Title, L"Continue", sizeof(L"Continue")))
*_retval = 0;
else if(aButton1Title && !memcmp(aButton1Title, wszContinue, sizeof(wszContinue)))
else if(aButton1Title && !memcmp(aButton1Title, L"Continue", sizeof(L"Continue")))
*_retval = 1;
else if(aButton2Title && !memcmp(aButton2Title, wszContinue, sizeof(wszContinue)))
else if(aButton2Title && !memcmp(aButton2Title, L"Continue", sizeof(L"Continue")))
*_retval = 2;
/* else
* let's hope that _retval is set to the default value */
......
......@@ -219,14 +219,12 @@ static void set_default_templates(nsIPrintSettings *settings)
{
WCHAR buf[64];
static const PRUnichar empty[] = {0};
nsIPrintSettings_SetHeaderStrLeft(settings, empty);
nsIPrintSettings_SetHeaderStrRight(settings, empty);
nsIPrintSettings_SetHeaderStrCenter(settings, empty);
nsIPrintSettings_SetFooterStrLeft(settings, empty);
nsIPrintSettings_SetFooterStrRight(settings, empty);
nsIPrintSettings_SetFooterStrCenter(settings, empty);
nsIPrintSettings_SetHeaderStrLeft(settings, L"");
nsIPrintSettings_SetHeaderStrRight(settings, L"");
nsIPrintSettings_SetHeaderStrCenter(settings, L"");
nsIPrintSettings_SetFooterStrLeft(settings, L"");
nsIPrintSettings_SetFooterStrRight(settings, L"");
nsIPrintSettings_SetFooterStrCenter(settings, L"");
if(LoadStringW(get_shdoclc(), IDS_PRINT_HEADER_TEMPLATE, buf, ARRAY_SIZE(buf)))
set_print_template(settings, buf, TRUE);
......
......@@ -279,11 +279,7 @@ static HRESULT fill_props(nsIDOMElement *nselem, PropertyBag *prop_bag)
nsresult nsres;
HRESULT hres = S_OK;
static const PRUnichar nameW[] = {'n','a','m','e',0};
static const PRUnichar paramW[] = {'p','a','r','a','m',0};
static const PRUnichar valueW[] = {'v','a','l','u','e',0};
nsAString_InitDepend(&name_str, paramW);
nsAString_InitDepend(&name_str, L"param");
nsres = nsIDOMElement_GetElementsByTagName(nselem, &name_str, &params);
nsAString_Finish(&name_str);
if(NS_FAILED(nsres))
......@@ -307,9 +303,9 @@ static HRESULT fill_props(nsIDOMElement *nselem, PropertyBag *prop_bag)
break;
}
nsres = get_elem_attr_value(param_elem, nameW, &name_str, &name);
nsres = get_elem_attr_value(param_elem, L"name", &name_str, &name);
if(NS_SUCCEEDED(nsres)) {
nsres = get_elem_attr_value(param_elem, valueW, &value_str, &value);
nsres = get_elem_attr_value(param_elem, L"value", &value_str, &value);
if(NS_SUCCEEDED(nsres)) {
hres = add_prop(prop_bag, name, value);
nsAString_Finish(&value_str);
......@@ -2297,9 +2293,7 @@ static BOOL get_elem_clsid(nsIDOMElement *elem, CLSID *clsid)
nsresult nsres;
BOOL ret = FALSE;
static const PRUnichar classidW[] = {'c','l','a','s','s','i','d',0};
nsres = get_elem_attr_value(elem, classidW, &val_str, &val);
nsres = get_elem_attr_value(elem, L"classid", &val_str, &val);
if(NS_SUCCEEDED(nsres)) {
if(*val)
ret = parse_classid(val, clsid);
......@@ -2535,9 +2529,7 @@ static void check_codebase(HTMLInnerWindow *window, nsIDOMElement *nselem)
nsresult nsres;
HRESULT hres;
static const PRUnichar codebaseW[] = {'c','o','d','e','b','a','s','e',0};
nsres = get_elem_attr_value(nselem, codebaseW, &val_str, &val);
nsres = get_elem_attr_value(nselem, L"codebase", &val_str, &val);
if(NS_SUCCEEDED(nsres)) {
if(*val) {
hres = CoInternetCombineUrlEx(window->base.outer_window->uri, val, 0, &uri, 0);
......
......@@ -1674,9 +1674,6 @@ static HRESULT exec_indent(HTMLTxtRange *This, VARIANT *in, VARIANT *out)
nsIDOMDocumentFragment *fragment;
nsIDOMNode *tmp;
static const PRUnichar blockquoteW[] = {'B','L','O','C','K','Q','U','O','T','E',0};
static const PRUnichar pW[] = {'P',0};
TRACE("(%p)->(%p %p)\n", This, in, out);
if(!This->doc->nsdoc) {
......@@ -1684,8 +1681,8 @@ static HRESULT exec_indent(HTMLTxtRange *This, VARIANT *in, VARIANT *out)
return E_NOTIMPL;
}
create_nselem(This->doc, blockquoteW, &blockquote_elem);
create_nselem(This->doc, pW, &p_elem);
create_nselem(This->doc, L"BLOCKQUOTE", &blockquote_elem);
create_nselem(This->doc, L"P", &p_elem);
nsIDOMRange_ExtractContents(This->nsrange, &fragment);
nsIDOMElement_AppendChild(p_elem, (nsIDOMNode*)fragment, &tmp);
......
......@@ -1210,8 +1210,6 @@ static BOOL get_script_guid(HTMLInnerWindow *window, nsIDOMHTMLScriptElement *ns
BOOL ret = FALSE;
nsresult nsres;
static const PRUnichar languageW[] = {'l','a','n','g','u','a','g','e',0};
nsAString_Init(&val_str, NULL);
nsres = nsIDOMHTMLScriptElement_GetType(nsscript, &val_str);
......@@ -1231,7 +1229,7 @@ static BOOL get_script_guid(HTMLInnerWindow *window, nsIDOMHTMLScriptElement *ns
nsres = nsIDOMHTMLScriptElement_QueryInterface(nsscript, &IID_nsIDOMElement, (void**)&nselem);
assert(nsres == NS_OK);
nsres = get_elem_attr_value(nselem, languageW, &val_str, &language);
nsres = get_elem_attr_value(nselem, L"language", &val_str, &language);
nsIDOMElement_Release(nselem);
if(NS_SUCCEEDED(nsres)) {
if(*language) {
......@@ -1554,14 +1552,12 @@ void bind_event_scripts(HTMLDocumentNode *doc)
nsresult nsres;
HRESULT hres;
static const PRUnichar selectorW[] = {'s','c','r','i','p','t','[','e','v','e','n','t',']',0};
TRACE("%p\n", doc);
if(!doc->nsdoc)
return;
nsAString_InitDepend(&selector_str, selectorW);
nsAString_InitDepend(&selector_str, L"script[event]");
nsres = nsIDOMHTMLDocument_QuerySelectorAll(doc->nsdoc, &selector_str, &node_list);
nsAString_Finish(&selector_str);
if(NS_FAILED(nsres)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment