Commit d5a10e2d authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

mshtml: Use wide-char string literals in struct initialization.

parent 7cdfafe0
...@@ -45,43 +45,26 @@ typedef struct { ...@@ -45,43 +45,26 @@ typedef struct {
nsIDOMHTMLBodyElement *nsbody; nsIDOMHTMLBodyElement *nsbody;
} HTMLBodyElement; } HTMLBodyElement;
static const WCHAR aquaW[] = {'a','q','u','a',0};
static const WCHAR blackW[] = {'b','l','a','c','k',0};
static const WCHAR blueW[] = {'b','l','u','e',0};
static const WCHAR fuchsiaW[] = {'f','u','s','h','s','i','a',0};
static const WCHAR grayW[] = {'g','r','a','y',0};
static const WCHAR greenW[] = {'g','r','e','e','n',0};
static const WCHAR limeW[] = {'l','i','m','e',0};
static const WCHAR maroonW[] = {'m','a','r','o','o','n',0};
static const WCHAR navyW[] = {'n','a','v','y',0};
static const WCHAR oliveW[] = {'o','l','i','v','e',0};
static const WCHAR purpleW[] = {'p','u','r','p','l','e',0};
static const WCHAR redW[] = {'r','e','d',0};
static const WCHAR silverW[] = {'s','i','l','v','e','r',0};
static const WCHAR tealW[] = {'t','e','a','l',0};
static const WCHAR whiteW[] = {'w','h','i','t','e',0};
static const WCHAR yellowW[] = {'y','e','l','l','o','w',0};
static const struct { static const struct {
LPCWSTR keyword; LPCWSTR keyword;
DWORD rgb; DWORD rgb;
} keyword_table[] = { } keyword_table[] = {
{aquaW, 0x00ffff}, {L"aqua", 0x00ffff},
{blackW, 0x000000}, {L"black", 0x000000},
{blueW, 0x0000ff}, {L"blue", 0x0000ff},
{fuchsiaW, 0xff00ff}, {L"fushsia", 0xff00ff},
{grayW, 0x808080}, {L"gray", 0x808080},
{greenW, 0x008000}, {L"green", 0x008000},
{limeW, 0x00ff00}, {L"lime", 0x00ff00},
{maroonW, 0x800000}, {L"maroon", 0x800000},
{navyW, 0x000080}, {L"navy", 0x000080},
{oliveW, 0x808000}, {L"olive", 0x808000},
{purpleW, 0x800080}, {L"purple", 0x800080},
{redW, 0xff0000}, {L"red", 0xff0000},
{silverW, 0xc0c0c0}, {L"silver", 0xc0c0c0},
{tealW, 0x008080}, {L"teal", 0x008080},
{whiteW, 0xffffff}, {L"white", 0xffffff},
{yellowW, 0xffff00} {L"yellow", 0xffff00}
}; };
static int comp_value(const WCHAR *ptr, int dpc) static int comp_value(const WCHAR *ptr, int dpc)
......
...@@ -1185,41 +1185,20 @@ static HRESULT WINAPI HTMLDocument_clear(IHTMLDocument2 *iface) ...@@ -1185,41 +1185,20 @@ static HRESULT WINAPI HTMLDocument_clear(IHTMLDocument2 *iface)
return S_OK; return S_OK;
} }
static const WCHAR copyW[] =
{'c','o','p','y',0};
static const WCHAR cutW[] =
{'c','u','t',0};
static const WCHAR fontnameW[] =
{'f','o','n','t','n','a','m','e',0};
static const WCHAR fontsizeW[] =
{'f','o','n','t','s','i','z','e',0};
static const WCHAR indentW[] =
{'i','n','d','e','n','t',0};
static const WCHAR insertorderedlistW[] =
{'i','n','s','e','r','t','o','r','d','e','r','e','d','l','i','s','t',0};
static const WCHAR insertunorderedlistW[] =
{'i','n','s','e','r','t','u','n','o','r','d','e','r','e','d','l','i','s','t',0};
static const WCHAR outdentW[] =
{'o','u','t','d','e','n','t',0};
static const WCHAR pasteW[] =
{'p','a','s','t','e',0};
static const WCHAR respectvisibilityindesignW[] =
{'r','e','s','p','e','c','t','v','i','s','i','b','i','l','i','t','y','i','n','d','e','s','i','g','n',0};
static const struct { static const struct {
const WCHAR *name; const WCHAR *name;
OLECMDID id; OLECMDID id;
}command_names[] = { }command_names[] = {
{copyW, IDM_COPY}, {L"copy", IDM_COPY},
{cutW, IDM_CUT}, {L"cut", IDM_CUT},
{fontnameW, IDM_FONTNAME}, {L"fontname", IDM_FONTNAME},
{fontsizeW, IDM_FONTSIZE}, {L"fontsize", IDM_FONTSIZE},
{indentW, IDM_INDENT}, {L"indent", IDM_INDENT},
{insertorderedlistW, IDM_ORDERLIST}, {L"insertorderedlist", IDM_ORDERLIST},
{insertunorderedlistW, IDM_UNORDERLIST}, {L"insertunorderedlist", IDM_UNORDERLIST},
{outdentW, IDM_OUTDENT}, {L"outdent", IDM_OUTDENT},
{pasteW, IDM_PASTE}, {L"paste", IDM_PASTE},
{respectvisibilityindesignW, IDM_RESPECTVISIBILITY_INDESIGN} {L"respectvisibilityindesign", IDM_RESPECTVISIBILITY_INDESIGN}
}; };
static BOOL cmdid_from_string(const WCHAR *str, OLECMDID *cmdid) static BOOL cmdid_from_string(const WCHAR *str, OLECMDID *cmdid)
......
...@@ -38,32 +38,6 @@ ...@@ -38,32 +38,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(mshtml); WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
static const WCHAR aW[] = {'A',0};
static const WCHAR areaW[] = {'A','R','E','A',0};
static const WCHAR bodyW[] = {'B','O','D','Y',0};
static const WCHAR buttonW[] = {'B','U','T','T','O','N',0};
static const WCHAR embedW[] = {'E','M','B','E','D',0};
static const WCHAR formW[] = {'F','O','R','M',0};
static const WCHAR frameW[] = {'F','R','A','M','E',0};
static const WCHAR headW[] = {'H','E','A','D',0};
static const WCHAR htmlW[] = {'H','T','M','L',0};
static const WCHAR iframeW[] = {'I','F','R','A','M','E',0};
static const WCHAR imgW[] = {'I','M','G',0};
static const WCHAR inputW[] = {'I','N','P','U','T',0};
static const WCHAR labelW[] = {'L','A','B','E','L',0};
static const WCHAR linkW[] = {'L','I','N','K',0};
static const WCHAR metaW[] = {'M','E','T','A',0};
static const WCHAR objectW[] = {'O','B','J','E','C','T',0};
static const WCHAR optionW[] = {'O','P','T','I','O','N',0};
static const WCHAR scriptW[] = {'S','C','R','I','P','T',0};
static const WCHAR selectW[] = {'S','E','L','E','C','T',0};
static const WCHAR styleW[] = {'S','T','Y','L','E',0};
static const WCHAR tableW[] = {'T','A','B','L','E',0};
static const WCHAR tdW[] = {'T','D',0};
static const WCHAR textareaW[] = {'T','E','X','T','A','R','E','A',0};
static const WCHAR title_tagW[]= {'T','I','T','L','E',0};
static const WCHAR trW[] = {'T','R',0};
#define ATTRFLAG_CASESENSITIVE 0x0001 #define ATTRFLAG_CASESENSITIVE 0x0001
#define ATTRFLAG_ASSTRING 0x0002 #define ATTRFLAG_ASSTRING 0x0002
#define ATTRFLAG_EXPANDURL 0x0004 #define ATTRFLAG_EXPANDURL 0x0004
...@@ -74,31 +48,31 @@ typedef struct { ...@@ -74,31 +48,31 @@ typedef struct {
} tag_desc_t; } tag_desc_t;
static const tag_desc_t tag_descs[] = { static const tag_desc_t tag_descs[] = {
{aW, HTMLAnchorElement_Create}, {L"A", HTMLAnchorElement_Create},
{areaW, HTMLAreaElement_Create}, {L"AREA", HTMLAreaElement_Create},
{bodyW, HTMLBodyElement_Create}, {L"BODY", HTMLBodyElement_Create},
{buttonW, HTMLButtonElement_Create}, {L"BUTTON", HTMLButtonElement_Create},
{embedW, HTMLEmbedElement_Create}, {L"EMBED", HTMLEmbedElement_Create},
{formW, HTMLFormElement_Create}, {L"FORM", HTMLFormElement_Create},
{frameW, HTMLFrameElement_Create}, {L"FRAME", HTMLFrameElement_Create},
{headW, HTMLHeadElement_Create}, {L"HEAD", HTMLHeadElement_Create},
{htmlW, HTMLHtmlElement_Create}, {L"HTML", HTMLHtmlElement_Create},
{iframeW, HTMLIFrame_Create}, {L"IFRAME", HTMLIFrame_Create},
{imgW, HTMLImgElement_Create}, {L"IMG", HTMLImgElement_Create},
{inputW, HTMLInputElement_Create}, {L"INPUT", HTMLInputElement_Create},
{labelW, HTMLLabelElement_Create}, {L"LABEL", HTMLLabelElement_Create},
{linkW, HTMLLinkElement_Create}, {L"LINK", HTMLLinkElement_Create},
{metaW, HTMLMetaElement_Create}, {L"META", HTMLMetaElement_Create},
{objectW, HTMLObjectElement_Create}, {L"OBJECT", HTMLObjectElement_Create},
{optionW, HTMLOptionElement_Create}, {L"OPTION", HTMLOptionElement_Create},
{scriptW, HTMLScriptElement_Create}, {L"SCRIPT", HTMLScriptElement_Create},
{selectW, HTMLSelectElement_Create}, {L"SELECT", HTMLSelectElement_Create},
{styleW, HTMLStyleElement_Create}, {L"STYLE", HTMLStyleElement_Create},
{tableW, HTMLTable_Create}, {L"TABLE", HTMLTable_Create},
{tdW, HTMLTableCell_Create}, {L"TD", HTMLTableCell_Create},
{textareaW, HTMLTextAreaElement_Create}, {L"TEXTAREA", HTMLTextAreaElement_Create},
{title_tagW, HTMLTitleElement_Create}, {L"TITLE", HTMLTitleElement_Create},
{trW, HTMLTableRow_Create} {L"TR", HTMLTableRow_Create}
}; };
static const tag_desc_t *get_tag_desc(const WCHAR *tag_name) static const tag_desc_t *get_tag_desc(const WCHAR *tag_name)
...@@ -230,18 +204,12 @@ HRESULT elem_string_attr_setter(HTMLElement *elem, const WCHAR *name, const WCHA ...@@ -230,18 +204,12 @@ HRESULT elem_string_attr_setter(HTMLElement *elem, const WCHAR *name, const WCHA
HRESULT get_readystate_string(READYSTATE readystate, BSTR *p) HRESULT get_readystate_string(READYSTATE readystate, BSTR *p)
{ {
static const WCHAR uninitializedW[] = {'u','n','i','n','i','t','i','a','l','i','z','e','d',0};
static const WCHAR loadingW[] = {'l','o','a','d','i','n','g',0};
static const WCHAR loadedW[] = {'l','o','a','d','e','d',0};
static const WCHAR interactiveW[] = {'i','n','t','e','r','a','c','t','i','v','e',0};
static const WCHAR completeW[] = {'c','o','m','p','l','e','t','e',0};
static const LPCWSTR readystate_strs[] = { static const LPCWSTR readystate_strs[] = {
uninitializedW, L"uninitialized",
loadingW, L"loading",
loadedW, L"loaded",
interactiveW, L"interactive",
completeW L"complete"
}; };
assert(readystate <= READYSTATE_COMPLETE); assert(readystate <= READYSTATE_COMPLETE);
......
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