Signed-off-by: Michael Stefaniuc mstefani@winehq.org --- dlls/mshtml/dispex.c | 7 ++-- dlls/mshtml/editor.c | 53 +++++++++++------------------- dlls/mshtml/main.c | 21 +++--------- dlls/mshtml/mutation.c | 4 +-- dlls/mshtml/navigate.c | 28 +++++----------- dlls/mshtml/nsembed.c | 62 +++++++++++------------------------- dlls/mshtml/nsio.c | 3 +- dlls/mshtml/oleobj.c | 11 ++----- dlls/mshtml/omnavigator.c | 40 +++++++---------------- dlls/mshtml/persist.c | 9 ++---- dlls/mshtml/protocol.c | 15 +++------ dlls/mshtml/range.c | 48 +++++++++------------------- dlls/mshtml/script.c | 40 +++++++---------------- dlls/mshtml/secmgr.c | 6 ++-- dlls/mshtml/selection.c | 9 ++---- dlls/mshtml/svg.c | 10 ++---- dlls/mshtml/task.c | 6 ++-- dlls/mshtml/view.c | 22 ++++--------- dlls/mshtml/xmlhttprequest.c | 19 +++-------- 19 files changed, 122 insertions(+), 291 deletions(-)
diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index f4cc2b76f2a..626c3671f75 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -45,9 +45,6 @@ static CRITICAL_SECTION_DEBUG cs_dispex_static_data_dbg = }; static CRITICAL_SECTION cs_dispex_static_data = { &cs_dispex_static_data_dbg, -1, 0, 0, 0, 0 };
- -static const WCHAR objectW[] = {'[','o','b','j','e','c','t',']',0}; - typedef struct { IID iid; VARIANT default_value; @@ -700,7 +697,7 @@ static HRESULT dispex_value(DispatchEx *This, LCID lcid, WORD flags, DISPPARAMS switch(flags) { case DISPATCH_PROPERTYGET: V_VT(res) = VT_BSTR; - V_BSTR(res) = SysAllocString(objectW); + V_BSTR(res) = SysAllocString(L"[object]"); if(!V_BSTR(res)) return E_OUTOFMEMORY; break; @@ -1283,7 +1280,7 @@ static HRESULT function_invoke(DispatchEx *This, func_info_t *func, WORD flags, if(func->id == DISPID_VALUE) { BSTR ret;
- ret = SysAllocString(objectW); + ret = SysAllocString(L"[object]"); if(!ret) return E_OUTOFMEMORY;
diff --git a/dlls/mshtml/editor.c b/dlls/mshtml/editor.c index 28c4eceff8e..0f63ce20131 100644 --- a/dlls/mshtml/editor.c +++ b/dlls/mshtml/editor.c @@ -92,9 +92,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml); #define DOM_VK_HOME VK_HOME #define DOM_VK_END VK_END
-static const WCHAR fontW[] = {'f','o','n','t',0}; -static const WCHAR sizeW[] = {'s','i','z','e',0}; - void set_dirty(GeckoBrowser *browser, VARIANT_BOOL dirty) { nsresult nsres; @@ -286,13 +283,13 @@ static void get_font_size(HTMLDocumentNode *doc, WCHAR *ret) nsIDOMElement_GetTagName(elem, &tag_str); nsAString_GetData(&tag_str, &tag);
- if(!wcsicmp(tag, fontW)) { + if(!wcsicmp(tag, L"font")) { nsAString val_str; const PRUnichar *val;
TRACE("found font tag %p\n", elem);
- get_elem_attr_value(elem, sizeW, &val_str, &val); + get_elem_attr_value(elem, L"size", &val_str, &val); if(*val) { TRACE("found size %s\n", debugstr_w(val)); lstrcpyW(ret, val); @@ -340,9 +337,9 @@ static void set_font_size(HTMLDocumentNode *doc, LPCWSTR size) } }
- create_nselem(doc, fontW, &elem); + create_nselem(doc, L"font", &elem);
- nsAString_InitDepend(&size_str, sizeW); + nsAString_InitDepend(&size_str, L"size"); nsAString_InitDepend(&val_str, size);
nsIDOMElement_SetAttribute(elem, &size_str, &val_str); @@ -358,7 +355,7 @@ static void set_font_size(HTMLDocumentNode *doc, LPCWSTR size) nsISelection_Collapse(nsselection, (nsIDOMNode*)elem, 0); }else { /* Remove all size attributes from the range */ - remove_child_attr(elem, fontW, &size_str); + remove_child_attr(elem, L"font", &size_str); nsISelection_SelectAllChildren(nsselection, (nsIDOMNode*)elem); }
@@ -606,8 +603,7 @@ static HRESULT exec_fontsize(HTMLDocumentNode *doc, DWORD cmdexecopt, VARIANT *i switch(V_VT(in)) { case VT_I4: { WCHAR size[10]; - static const WCHAR format[] = {'%','d',0}; - wsprintfW(size, format, V_I4(in)); + wsprintfW(size, L"%d", V_I4(in)); set_font_size(doc, size); break; } @@ -956,14 +952,6 @@ static HRESULT query_edit_status(HTMLDocumentNode *doc, OLECMD *cmd)
static INT_PTR CALLBACK hyperlink_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { - static const WCHAR wszOther[] = {'(','o','t','h','e','r',')',0}; - static const WCHAR wszFile[] = {'f','i','l','e',':',0}; - static const WCHAR wszFtp[] = {'f','t','p',':',0}; - static const WCHAR wszHttp[] = {'h','t','t','p',':',0}; - static const WCHAR wszHttps[] = {'h','t','t','p','s',':',0}; - static const WCHAR wszMailto[] = {'m','a','i','l','t','o',':',0}; - static const WCHAR wszNews[] = {'n','e','w','s',':',0}; - switch (msg) { case WM_INITDIALOG: @@ -975,13 +963,13 @@ static INT_PTR CALLBACK hyperlink_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LP
SetWindowLongPtrW(hwnd, DWLP_USER, lparam);
- SendMessageW(hwndCB, CB_INSERTSTRING, -1, (LPARAM)wszOther); - SendMessageW(hwndCB, CB_INSERTSTRING, -1, (LPARAM)wszFile); - SendMessageW(hwndCB, CB_INSERTSTRING, -1, (LPARAM)wszFtp); - def_idx = SendMessageW(hwndCB, CB_INSERTSTRING, -1, (LPARAM)wszHttp); - SendMessageW(hwndCB, CB_INSERTSTRING, -1, (LPARAM)wszHttps); - SendMessageW(hwndCB, CB_INSERTSTRING, -1, (LPARAM)wszMailto); - SendMessageW(hwndCB, CB_INSERTSTRING, -1, (LPARAM)wszNews); + SendMessageW(hwndCB, CB_INSERTSTRING, -1, (LPARAM)L"(other)"); + SendMessageW(hwndCB, CB_INSERTSTRING, -1, (LPARAM)L"file:"); + SendMessageW(hwndCB, CB_INSERTSTRING, -1, (LPARAM)L"ftp:"); + def_idx = SendMessageW(hwndCB, CB_INSERTSTRING, -1, (LPARAM)L"http:"); + SendMessageW(hwndCB, CB_INSERTSTRING, -1, (LPARAM)L"https:"); + SendMessageW(hwndCB, CB_INSERTSTRING, -1, (LPARAM)L"mailto:"); + SendMessageW(hwndCB, CB_INSERTSTRING, -1, (LPARAM)L"news:"); SendMessageW(hwndCB, CB_SETCURSEL, def_idx, 0);
/* force the updating of the URL edit box */ @@ -1025,7 +1013,7 @@ static INT_PTR CALLBACK hyperlink_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LP type = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR)); SendMessageW((HWND)lparam, CB_GETLBTEXT, item, (LPARAM)type);
- if (!wcscmp(type, wszOther)) + if (!wcscmp(type, L"(other)")) *type = '\0';
/* get current URL */ @@ -1044,7 +1032,7 @@ static INT_PTR CALLBACK hyperlink_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LP if (*type != '\0') { memcpy(url, type, (lstrlenW(type) + 1) * sizeof(WCHAR)); - if (wcscmp(type, wszMailto) && wcscmp(type, wszNews)) + if (wcscmp(type, L"mailto:") && wcscmp(type, L"news:")) memcpy(url + lstrlenW(type), wszSlashSlash, sizeof(wszSlashSlash)); }
@@ -1075,9 +1063,6 @@ static HRESULT exec_hyperlink(HTMLDocumentNode *doc, DWORD cmdexecopt, VARIANT * INT ret; HRESULT hres = E_FAIL;
- static const WCHAR aW[] = {'a',0}; - static const WCHAR hrefW[] = {'h','r','e','f',0}; - TRACE("%p, 0x%x, %p, %p\n", doc, cmdexecopt, in, out);
if (cmdexecopt == OLECMDEXECOPT_DONTPROMPTUSER) @@ -1106,9 +1091,9 @@ static HRESULT exec_hyperlink(HTMLDocumentNode *doc, DWORD cmdexecopt, VARIANT * return E_FAIL;
/* create an element for the link */ - create_nselem(doc, aW, &anchor_elem); + create_nselem(doc, L"a", &anchor_elem);
- nsAString_InitDepend(&href_str, hrefW); + nsAString_InitDepend(&href_str, L"href"); nsAString_InitDepend(&ns_url, url); nsIDOMElement_SetAttribute(anchor_elem, &href_str, &ns_url); nsAString_Finish(&href_str); @@ -1257,9 +1242,7 @@ HRESULT setup_edit_mode(HTMLDocumentObj *doc) mon = doc->basedoc.window->mon; IMoniker_AddRef(mon); }else { - static const WCHAR about_blankW[] = {'a','b','o','u','t',':','b','l','a','n','k',0}; - - hres = CreateURLMoniker(NULL, about_blankW, &mon); + hres = CreateURLMoniker(NULL, L"about:blank", &mon); if(FAILED(hres)) { FIXME("CreateURLMoniker failed: %08x\n", hres); return hres; diff --git a/dlls/mshtml/main.c b/dlls/mshtml/main.c index e2c927c5f9d..642e2fdbffd 100644 --- a/dlls/mshtml/main.c +++ b/dlls/mshtml/main.c @@ -149,10 +149,8 @@ static BOOL read_compat_mode(HKEY key, compat_mode_t *r) DWORD type, size; LSTATUS status;
- static const WCHAR max_compat_modeW[] = {'M','a','x','C','o','m','p','a','t','M','o','d','e',0}; - size = sizeof(version); - status = RegQueryValueExW(key, max_compat_modeW, NULL, &type, (BYTE*)version, &size); + status = RegQueryValueExW(key, L"MaxCompatMode", NULL, &type, (BYTE*)version, &size); if(status != ERROR_SUCCESS || type != REG_SZ) return FALSE;
@@ -168,14 +166,8 @@ static BOOL WINAPI load_compat_settings(INIT_ONCE *once, void *param, void **con HKEY key, host_key; DWORD res;
- static const WCHAR key_nameW[] = { - 'S','o','f','t','w','a','r','e', - '\','W','i','n','e', - '\','M','S','H','T','M','L', - '\','C','o','m','p','a','t','M','o','d','e',0}; - /* @@ Wine registry key: HKCU\Software\Wine\MSHTML\CompatMode */ - res = RegOpenKeyW(HKEY_CURRENT_USER, key_nameW, &key); + res = RegOpenKeyW(HKEY_CURRENT_USER, L"Software\Wine\MSHTML\CompatMode", &key); if(res != ERROR_SUCCESS) return TRUE;
@@ -350,13 +342,10 @@ HRESULT do_query_service(IUnknown *unk, REFGUID guid_service, REFIID riid, void
HINSTANCE get_shdoclc(void) { - static const WCHAR wszShdoclc[] = - {'s','h','d','o','c','l','c','.','d','l','l',0}; - if(shdoclc) return shdoclc;
- return shdoclc = LoadLibraryExW(wszShdoclc, NULL, LOAD_LIBRARY_AS_DATAFILE); + return shdoclc = LoadLibraryExW(L"shdoclc.dll", NULL, LOAD_LIBRARY_AS_DATAFILE); }
BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID reserved) @@ -602,8 +591,6 @@ static HRESULT register_server(BOOL do_register) static CLSID const *clsids[35]; unsigned int i = 0;
- static const WCHAR wszAdvpack[] = {'a','d','v','p','a','c','k','.','d','l','l',0}; - TRACE("(%x)\n", do_register);
INF_SET_CLSID(AboutProtocol); @@ -653,7 +640,7 @@ static HRESULT register_server(BOOL do_register) strtable.cEntries = ARRAY_SIZE(pse); strtable.pse = pse;
- hAdvpack = LoadLibraryW(wszAdvpack); + hAdvpack = LoadLibraryW(L"advpack.dll"); pRegInstall = (void *)GetProcAddress(hAdvpack, "RegInstall");
hres = pRegInstall(hInst, do_register ? "RegisterDll" : "UnregisterDll", &strtable); diff --git a/dlls/mshtml/mutation.c b/dlls/mshtml/mutation.c index 96490f9abd9..247a3277927 100644 --- a/dlls/mshtml/mutation.c +++ b/dlls/mshtml/mutation.c @@ -491,8 +491,6 @@ static void process_meta_element(HTMLDocumentNode *doc, nsIDOMHTMLMetaElement *m nsAString http_equiv_str, content_str; nsresult nsres;
- static const WCHAR x_ua_compatibleW[] = {'x','-','u','a','-','c','o','m','p','a','t','i','b','l','e',0}; - nsAString_Init(&http_equiv_str, NULL); nsAString_Init(&content_str, NULL); nsres = nsIDOMHTMLMetaElement_GetHttpEquiv(meta_element, &http_equiv_str); @@ -507,7 +505,7 @@ static void process_meta_element(HTMLDocumentNode *doc, nsIDOMHTMLMetaElement *m
TRACE("%s: %s\n", debugstr_w(http_equiv), debugstr_w(content));
- if(!wcsicmp(http_equiv, x_ua_compatibleW)) { + if(!wcsicmp(http_equiv, L"x-ua-compatible")) { compat_mode_t document_mode; if(parse_ua_compatible(content, &document_mode)) set_document_mode(doc, document_mode, TRUE); diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c index 744db468d83..233f58c89fd 100644 --- a/dlls/mshtml/navigate.c +++ b/dlls/mshtml/navigate.c @@ -46,9 +46,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml); #define UTF8_STR "utf-8" #define UTF16_STR "utf-16"
-static const WCHAR emptyW[] = {0}; -static const WCHAR text_htmlW[] = {'t','e','x','t','/','h','t','m','l',0}; - struct nsProtocolStream { nsIInputStream nsIInputStream_iface;
@@ -799,14 +796,12 @@ static HRESULT process_response_headers(nsChannelBSC *This, const WCHAR *headers http_header_t *iter; HRESULT hres;
- static const WCHAR content_typeW[] = {'c','o','n','t','e','n','t','-','t','y','p','e',0}; - hres = parse_headers(headers, &This->nschannel->response_headers); if(FAILED(hres)) return hres;
LIST_FOR_EACH_ENTRY(iter, &This->nschannel->response_headers, http_header_t, entry) { - if(!wcsicmp(iter->header, content_typeW)) + if(!wcsicmp(iter->header, L"content-type")) parse_content_type(This, iter->data); }
@@ -1116,7 +1111,7 @@ static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream) WCHAR *mime;
hres = FindMimeFromData(NULL, NULL, This->nsstream->buf, This->nsstream->buf_size, - This->is_doc_channel ? text_htmlW : NULL, 0, &mime, 0); + This->is_doc_channel ? L"text/html" : NULL, 0, &mime, 0); if(FAILED(hres)) return hres;
@@ -1750,14 +1745,11 @@ static HRESULT nsChannelBSC_beginning_transaction(BSCallback *bsc, WCHAR **addit DWORD len = 0; WCHAR *ptr;
- static const WCHAR content_lengthW[] = - {'C','o','n','t','e','n','t','-','L','e','n','g','t','h',0}; - if(!This->nschannel) return S_FALSE;
LIST_FOR_EACH_ENTRY(iter, &This->nschannel->request_headers, http_header_t, entry) { - if(wcscmp(iter->header, content_lengthW)) + if(wcscmp(iter->header, L"Content-Length")) len += lstrlenW(iter->header) + 2 /* ": " */ + lstrlenW(iter->data) + 2 /* "\r\n" */; }
@@ -1769,7 +1761,7 @@ static HRESULT nsChannelBSC_beginning_transaction(BSCallback *bsc, WCHAR **addit return E_OUTOFMEMORY;
LIST_FOR_EACH_ENTRY(iter, &This->nschannel->request_headers, http_header_t, entry) { - if(!wcscmp(iter->header, content_lengthW)) + if(!wcscmp(iter->header, L"Content-Length")) continue;
len = lstrlenW(iter->header); @@ -1986,8 +1978,6 @@ static void navigate_javascript_proc(task_t *_task) BSTR code; HRESULT hres;
- static const WCHAR jscriptW[] = {'j','s','c','r','i','p','t',0}; - task->window->readystate = READYSTATE_COMPLETE;
hres = IUri_GetPath(task->uri, &code); @@ -2003,7 +1993,7 @@ static void navigate_javascript_proc(task_t *_task) set_download_state(window->browser->doc, 1);
V_VT(&v) = VT_EMPTY; - hres = exec_script(window->base.inner_window, code, jscriptW, &v); + hres = exec_script(window->base.inner_window, code, L"jscript", &v); SysFreeString(code); if(SUCCEEDED(hres) && V_VT(&v) != VT_EMPTY) { FIXME("javascirpt URL returned %s\n", debugstr_variant(&v)); @@ -2064,8 +2054,7 @@ static HRESULT navigate_fragment(HTMLOuterWindow *window, IUri *uri) BSTR frag; nsresult nsres; HRESULT hres; - - static const WCHAR selector_formatW[] = {'a','[','i','d','=','"','%','s','"',']',0}; + static const WCHAR selector_formatW[] = L"a[id="%s"]";
set_current_uri(window, uri);
@@ -2310,7 +2299,7 @@ HRESULT navigate_new_window(HTMLOuterWindow *window, IUri *uri, const WCHAR *nam if(SUCCEEDED(hres)) { hres = ITargetFramePriv2_AggregatedNavigation2(target_frame_priv, HLNF_DISABLEWINDOWRESTRICTIONS|HLNF_OPENINNEWWINDOW, bind_ctx, &bsc->bsc.IBindStatusCallback_iface, - name, uri, emptyW); + name, uri, L""); ITargetFramePriv2_Release(target_frame_priv);
if(SUCCEEDED(hres)) @@ -2377,8 +2366,7 @@ HRESULT hlink_frame_navigate(HTMLDocument *doc, LPCWSTR url, nsChannel *nschanne IHlink_SetMonikerReference(hlink, HLINKSETF_TARGET, mon, NULL);
if(hlnf & HLNF_OPENINNEWWINDOW) { - static const WCHAR wszBlank[] = {'_','b','l','a','n','k',0}; - IHlink_SetTargetFrameName(hlink, wszBlank); /* FIXME */ + IHlink_SetTargetFrameName(hlink, L"_blank"); /* FIXME */ }
hres = IHlinkFrame_Navigate(hlink_frame, hlnf, bindctx, diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c index 9a23785ca67..750f5cfd5e0 100644 --- a/dlls/mshtml/nsembed.c +++ b/dlls/mshtml/nsembed.c @@ -89,8 +89,6 @@ static nsIComponentManager *pCompMgr = NULL; static nsICategoryManager *cat_mgr; static nsIFile *profile_directory, *plugin_directory;
-static const WCHAR wszNsContainer[] = {'N','s','C','o','n','t','a','i','n','e','r',0}; - static ATOM browser_class; static WCHAR gecko_path[MAX_PATH]; static unsigned gecko_path_len; @@ -249,9 +247,7 @@ static nsrefcnt NSAPI nsDirectoryServiceProvider2_Release(nsIDirectoryServicePro
static nsresult create_profile_directory(void) { - static const WCHAR wine_geckoW[] = {'\','w','i','n','e','_','g','e','c','k','o',0}; - - WCHAR path[MAX_PATH + ARRAY_SIZE(wine_geckoW)]; + WCHAR path[MAX_PATH + ARRAY_SIZE(L"\wine_gecko")]; cpp_bool exists; nsresult nsres; HRESULT hres; @@ -262,7 +258,7 @@ static nsresult create_profile_directory(void) return NS_ERROR_FAILURE; }
- lstrcatW(path, wine_geckoW); + lstrcatW(path, L"\wine_gecko"); nsres = create_nsfile(path, &profile_directory); if(NS_FAILED(nsres)) return nsres; @@ -316,13 +312,11 @@ static nsresult NSAPI nsDirectoryServiceProvider2_GetFiles(nsIDirectoryServicePr nsresult nsres;
if(!plugin_directory) { - static const WCHAR gecko_pluginW[] = {'\','g','e','c','k','o','\','p','l','u','g','i','n',0}; - - len = GetSystemDirectoryW(plugin_path, ARRAY_SIZE(plugin_path)-ARRAY_SIZE(gecko_pluginW)+1); + len = GetSystemDirectoryW(plugin_path, ARRAY_SIZE(plugin_path)-ARRAY_SIZE(L"\gecko\plugin")+1); if(!len) return NS_ERROR_UNEXPECTED;
- lstrcpyW(plugin_path+len, gecko_pluginW); + lstrcpyW(plugin_path+len, L"\gecko\plugin"); nsres = create_nsfile(plugin_path, &plugin_directory); if(NS_FAILED(nsres)) { *_retval = NULL; @@ -362,13 +356,11 @@ static LRESULT WINAPI nsembed_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP GeckoBrowser *This; nsresult nsres;
- static const WCHAR wszTHIS[] = {'T','H','I','S',0}; - if(msg == WM_CREATE) { This = *(GeckoBrowser**)lParam; - SetPropW(hwnd, wszTHIS, This); + SetPropW(hwnd, L"THIS", This); }else { - This = GetPropW(hwnd, wszTHIS); + This = GetPropW(hwnd, L"THIS"); }
switch(msg) { @@ -402,7 +394,7 @@ static void register_browser_class(void) CS_DBLCLKS, nsembed_proc, 0, 0, NULL, NULL, NULL, NULL, NULL, - wszNsContainer, + L"NsContainer", NULL, }; wndclass.hInstance = hInst; @@ -418,9 +410,8 @@ static BOOL install_wine_gecko(void) LONG len; BOOL ret;
- static const WCHAR controlW[] = {'\','c','o','n','t','r','o','l','.','e','x','e',0}; - static const WCHAR argsW[] = - {' ','a','p','p','w','i','z','.','c','p','l',' ','i','n','s','t','a','l','l','_','g','e','c','k','o',0}; + static const WCHAR controlW[] = L"\control.exe"; + static const WCHAR argsW[] = L" appwiz.cpl install_gecko";
len = GetSystemDirectoryW(app, MAX_PATH-ARRAY_SIZE(controlW)); memcpy(app+len, controlW, sizeof(controlW)); @@ -456,15 +447,7 @@ static void set_environment(LPCWSTR gre_path) WCHAR *path, buf[20]; const WCHAR *ptr;
- static const WCHAR pathW[] = {'P','A','T','H',0}; - static const WCHAR warnW[] = {'w','a','r','n',0}; - static const WCHAR xpcom_debug_breakW[] = - {'X','P','C','O','M','_','D','E','B','U','G','_','B','R','E','A','K',0}; - static const WCHAR nspr_log_modulesW[] = - {'N','S','P','R','_','L','O','G','_','M','O','D','U','L','E','S',0}; - static const WCHAR debug_formatW[] = {'a','l','l',':','%','d',0}; - - SetEnvironmentVariableW(xpcom_debug_breakW, warnW); + SetEnvironmentVariableW(L"XPCOM_DEBUG_BREAK", L"warn");
if(TRACE_ON(gecko)) debug_level = 5; @@ -473,15 +456,15 @@ static void set_environment(LPCWSTR gre_path) else if(ERR_ON(gecko)) debug_level = 1;
- swprintf(buf, ARRAY_SIZE(buf), debug_formatW, debug_level); - SetEnvironmentVariableW(nspr_log_modulesW, buf); + swprintf(buf, ARRAY_SIZE(buf), L"all:%d", debug_level); + SetEnvironmentVariableW(L"NSPR_LOG_MODULES", buf);
- len = GetEnvironmentVariableW(pathW, NULL, 0); + len = GetEnvironmentVariableW(L"PATH", NULL, 0); gre_path_len = lstrlenW(gre_path); path = heap_alloc((len+gre_path_len+1)*sizeof(WCHAR)); if(!path) return; - GetEnvironmentVariableW(pathW, path, len); + GetEnvironmentVariableW(L"PATH", path, len);
/* We have to modify PATH as xul.dll loads other DLLs from this directory. */ if(!(ptr = wcsstr(path, gre_path)) @@ -490,7 +473,7 @@ static void set_environment(LPCWSTR gre_path) if(len) path[len-1] = ';'; lstrcpyW(path+len, gre_path); - SetEnvironmentVariableW(pathW, path); + SetEnvironmentVariableW(L"PATH", path); } heap_free(path); } @@ -528,13 +511,7 @@ static void set_lang(nsIPrefBranch *pref) DWORD res, size, type; HKEY hkey;
- static const WCHAR international_keyW[] = - {'S','o','f','t','w','a','r','e', - '\','M','i','c','r','o','s','o','f','t', - '\','I','n','t','e','r','n','e','t',' ','E','x','p','l','o','r','e','r', - '\','I','n','t','e','r','n','a','t','i','o','n','a','l',0}; - - res = RegOpenKeyW(HKEY_CURRENT_USER, international_keyW, &hkey); + res = RegOpenKeyW(HKEY_CURRENT_USER, L"Software\Microsoft\Internet Explorer\International", &hkey); if(res != ERROR_SUCCESS) return;
@@ -1019,9 +996,6 @@ HRESULT variant_to_nsstr(VARIANT *v, BOOL hex_int, nsAString *nsstr) { WCHAR buf[32];
- static const WCHAR d_formatW[] = {'%','d',0}; - static const WCHAR hex_formatW[] = {'#','%','0','6','x',0}; - switch(V_VT(v)) { case VT_NULL: nsAString_InitDepend(nsstr, NULL); @@ -1036,7 +1010,7 @@ HRESULT variant_to_nsstr(VARIANT *v, BOOL hex_int, nsAString *nsstr) break;
case VT_I4: - wsprintfW(buf, hex_int ? hex_formatW : d_formatW, V_I4(v)); + wsprintfW(buf, hex_int ? L"#%06x" : L"%d", V_I4(v)); nsAString_Init(nsstr, buf); break;
@@ -2251,7 +2225,7 @@ static HRESULT init_browser(GeckoBrowser *browser) return E_FAIL; }
- browser->hwnd = CreateWindowExW(0, wszNsContainer, NULL, + browser->hwnd = CreateWindowExW(0, L"NsContainer", NULL, WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, 0, 0, 100, 100, GetDesktopWindow(), NULL, hInst, browser); if(!browser->hwnd) { diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c index 7c8f029b4a5..ee709645873 100644 --- a/dlls/mshtml/nsio.c +++ b/dlls/mshtml/nsio.c @@ -1488,12 +1488,11 @@ static nsresult NSAPI nsChannel_IsNoStoreResponse(nsIHttpChannel *iface, cpp_boo http_header_t *header;
static const WCHAR cache_controlW[] = {'C','a','c','h','e','-','C','o','n','t','r','o','l'}; - static const WCHAR no_storeW[] = {'n','o','-','s','t','o','r','e',0};
TRACE("(%p)->(%p)\n", This, _retval);
header = find_http_header(&This->response_headers, cache_controlW, ARRAY_SIZE(cache_controlW)); - *_retval = header && !wcsicmp(header->data, no_storeW); + *_retval = header && !wcsicmp(header->data, L"no-store"); return NS_OK; }
diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index 00e937223a0..fb3ff8a8b73 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -231,19 +231,12 @@ static void load_settings(HTMLDocumentObj *doc) DWORD val, size; LONG res;
- static const WCHAR ie_keyW[] = { - 'S','O','F','T','W','A','R','E','\', - 'M','i','c','r','o','s','o','f','t','\', - 'I','n','t','e','r','n','e','t',' ','E','x','p','l','o','r','e','r',0}; - static const WCHAR zoomW[] = {'Z','o','o','m',0}; - static const WCHAR zoom_factorW[] = {'Z','o','o','m','F','a','c','t','o','r',0}; - - res = RegOpenKeyW(HKEY_CURRENT_USER, ie_keyW, &settings_key); + res = RegOpenKeyW(HKEY_CURRENT_USER, L"SOFTWARE\Microsoft\Internet Explorer", &settings_key); if(res != ERROR_SUCCESS) return;
size = sizeof(val); - res = RegGetValueW(settings_key, zoomW, zoom_factorW, RRF_RT_REG_DWORD, NULL, &val, &size); + res = RegGetValueW(settings_key, L"Zoom", L"ZoomFactor", RRF_RT_REG_DWORD, NULL, &val, &size); RegCloseKey(settings_key); if(res == ERROR_SUCCESS) set_viewer_zoom(doc->nscontainer, (float)val/100000); diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 721a336a853..f09b796e423 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -1137,11 +1137,9 @@ static HRESULT WINAPI OmNavigator_get_appCodeName(IOmNavigator *iface, BSTR *p) { OmNavigator *This = impl_from_IOmNavigator(iface);
- static const WCHAR mozillaW[] = {'M','o','z','i','l','l','a',0}; - TRACE("(%p)->(%p)\n", This, p);
- *p = SysAllocString(mozillaW); + *p = SysAllocString(L"Mozilla"); return S_OK; }
@@ -1149,14 +1147,9 @@ static HRESULT WINAPI OmNavigator_get_appName(IOmNavigator *iface, BSTR *p) { OmNavigator *This = impl_from_IOmNavigator(iface);
- static const WCHAR app_nameW[] = - {'M','i','c','r','o','s','o','f','t',' ', - 'I','n','t','e','r','n','e','t',' ', - 'E','x','p','l','o','r','e','r',0}; - TRACE("(%p)->(%p)\n", This, p);
- *p = SysAllocString(app_nameW); + *p = SysAllocString(L"Microsoft Internet Explorer"); if(!*p) return E_OUTOFMEMORY;
@@ -1294,14 +1287,12 @@ static HRESULT WINAPI OmNavigator_toString(IOmNavigator *iface, BSTR *String) { OmNavigator *This = impl_from_IOmNavigator(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; }
@@ -1309,16 +1300,13 @@ static HRESULT WINAPI OmNavigator_get_cpuClass(IOmNavigator *iface, BSTR *p) { OmNavigator *This = impl_from_IOmNavigator(iface);
- static const WCHAR cpu_classW[] = + TRACE("(%p)->(%p)\n", This, p); + #ifdef _WIN64 - {'x','6','4',0}; + *p = SysAllocString(L"x64"); #else - {'x','8','6',0}; + *p = SysAllocString(L"x86"); #endif - - TRACE("(%p)->(%p)\n", This, p); - - *p = SysAllocString(cpu_classW); return *p ? S_OK : E_OUTOFMEMORY; }
@@ -1379,15 +1367,13 @@ static HRESULT WINAPI OmNavigator_get_platform(IOmNavigator *iface, BSTR *p) { OmNavigator *This = impl_from_IOmNavigator(iface);
+ TRACE("(%p)->(%p)\n", This, p); + #ifdef _WIN64 - static const WCHAR platformW[] = {'W','i','n','6','4',0}; + *p = SysAllocString(L"Win64"); #else - static const WCHAR platformW[] = {'W','i','n','3','2',0}; + *p = SysAllocString(L"Win32"); #endif - - TRACE("(%p)->(%p)\n", This, p); - - *p = SysAllocString(platformW); return S_OK; }
@@ -1395,12 +1381,10 @@ static HRESULT WINAPI OmNavigator_get_appMinorVersion(IOmNavigator *iface, BSTR { OmNavigator *This = impl_from_IOmNavigator(iface);
- static const WCHAR zeroW[] = {'0',0}; - TRACE("(%p)->(%p)\n", This, p);
/* NOTE: MSIE returns "0" or values like ";SP2;". Returning "0" should be enough. */ - *p = SysAllocString(zeroW); + *p = SysAllocString(L"0"); return S_OK; }
diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c index e87ca47c390..f6bb1887aca 100644 --- a/dlls/mshtml/persist.c +++ b/dlls/mshtml/persist.c @@ -46,8 +46,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml); /* Undocumented notification, see tests */ #define CMDID_EXPLORER_UPDATEHISTORY 38
-static const WCHAR about_blankW[] = {'a','b','o','u','t',':','b','l','a','n','k',0}; - typedef struct { task_t header; HTMLDocumentObj *doc; @@ -893,7 +891,7 @@ static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, IStream
TRACE("(%p)->(%p)\n", This, pStm);
- hres = CreateURLMoniker(NULL, about_blankW, &mon); + hres = CreateURLMoniker(NULL, L"about:blank", &mon); if(FAILED(hres)) { WARN("CreateURLMoniker failed: %08x\n", hres); return hres; @@ -950,7 +948,7 @@ static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface)
TRACE("(%p)\n", This);
- hres = CreateURLMoniker(NULL, about_blankW, &mon); + hres = CreateURLMoniker(NULL, L"about:blank", &mon); if(FAILED(hres)) { WARN("CreateURLMoniker failed: %08x\n", hres); return hres; @@ -1171,7 +1169,6 @@ static HRESULT WINAPI HlinkTarget_Navigate(IHlinkTarget *iface, DWORD grfHLNF, L FIXME("JumpLocation not supported\n");
if(!This->doc_obj->client) { - static const WCHAR szOpen[] = {'o','p','e','n',0}; HRESULT hres; BSTR uri;
@@ -1179,7 +1176,7 @@ static HRESULT WINAPI HlinkTarget_Navigate(IHlinkTarget *iface, DWORD grfHLNF, L if (FAILED(hres)) return hres;
- ShellExecuteW(NULL, szOpen, uri, NULL, NULL, SW_SHOW); + ShellExecuteW(NULL, L"open", uri, NULL, NULL, SW_SHOW); SysFreeString(uri); return S_OK; } diff --git a/dlls/mshtml/protocol.c b/dlls/mshtml/protocol.c index a311d648f29..d11c0132cf5 100644 --- a/dlls/mshtml/protocol.c +++ b/dlls/mshtml/protocol.c @@ -342,12 +342,7 @@ static HRESULT WINAPI AboutProtocol_Start(IInternetProtocol *iface, LPCWSTR szUr DWORD data_len; BYTE *data; HRESULT hres; - - static const WCHAR html_begin[] = {0xfeff,'<','H','T','M','L','>',0}; - static const WCHAR html_end[] = {'<','/','H','T','M','L','>',0}; - static const WCHAR wszBlank[] = {'b','l','a','n','k',0}; static const WCHAR wszAbout[] = {'a','b','o','u','t',':'}; - static const WCHAR wszTextHtml[] = {'t','e','x','t','/','h','t','m','l',0};
/* NOTE: * the about protocol seems not to work as I would expect. It creates html document @@ -370,11 +365,11 @@ static HRESULT WINAPI AboutProtocol_Start(IInternetProtocol *iface, LPCWSTR szUr
if(lstrlenW(szUrl) >= ARRAY_SIZE(wszAbout) && !memcmp(wszAbout, szUrl, sizeof(wszAbout))) { text = szUrl + ARRAY_SIZE(wszAbout); - if(!wcscmp(wszBlank, text)) + if(!wcscmp(L"blank", text)) text = NULL; }
- data_len = sizeof(html_begin)+sizeof(html_end)-sizeof(WCHAR) + data_len = sizeof(L"\xfeff<HTML>")+sizeof(L"</HTML>")-sizeof(WCHAR) + (text ? lstrlenW(text)*sizeof(WCHAR) : 0); data = heap_alloc(data_len); if(!data) @@ -384,14 +379,14 @@ static HRESULT WINAPI AboutProtocol_Start(IInternetProtocol *iface, LPCWSTR szUr This->data = data; This->data_len = data_len;
- memcpy(This->data, html_begin, sizeof(html_begin)); + lstrcpyW((LPWSTR)This->data, L"\xfeff<HTML>"); if(text) lstrcatW((LPWSTR)This->data, text); - lstrcatW((LPWSTR)This->data, html_end); + lstrcatW((LPWSTR)This->data, L"</HTML>");
This->cur = 0;
- IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_MIMETYPEAVAILABLE, wszTextHtml); + IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_MIMETYPEAVAILABLE, L"text/html");
IInternetProtocolSink_ReportData(pOIProtSink, BSCF_FIRSTDATANOTIFICATION | BSCF_LASTDATANOTIFICATION | BSCF_DATAFULLYAVAILABLE, diff --git a/dlls/mshtml/range.c b/dlls/mshtml/range.c index d38d64b4151..aa8e8942a87 100644 --- a/dlls/mshtml/range.c +++ b/dlls/mshtml/range.c @@ -33,9 +33,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
-static const WCHAR brW[] = {'b','r',0}; -static const WCHAR hrW[] = {'h','r',0}; - typedef struct { DispatchEx dispex; IHTMLTxtRange IHTMLTxtRange_iface; @@ -93,34 +90,20 @@ static HTMLTxtRange *get_range_object(HTMLDocumentNode *doc, IHTMLTxtRange *ifac
static range_unit_t string_to_unit(LPCWSTR str) { - static const WCHAR characterW[] = - {'c','h','a','r','a','c','t','e','r',0}; - static const WCHAR wordW[] = - {'w','o','r','d',0}; - static const WCHAR sentenceW[] = - {'s','e','n','t','e','n','c','e',0}; - static const WCHAR texteditW[] = - {'t','e','x','t','e','d','i','t',0}; - - if(!wcsicmp(str, characterW)) return RU_CHAR; - if(!wcsicmp(str, wordW)) return RU_WORD; - if(!wcsicmp(str, sentenceW)) return RU_SENTENCE; - if(!wcsicmp(str, texteditW)) return RU_TEXTEDIT; + if(!wcsicmp(str, L"character")) return RU_CHAR; + if(!wcsicmp(str, L"word")) return RU_WORD; + if(!wcsicmp(str, L"sentence")) return RU_SENTENCE; + if(!wcsicmp(str, L"textedit")) return RU_TEXTEDIT;
return RU_UNKNOWN; }
static int string_to_nscmptype(LPCWSTR str) { - static const WCHAR seW[] = {'S','t','a','r','t','T','o','E','n','d',0}; - static const WCHAR ssW[] = {'S','t','a','r','t','T','o','S','t','a','r','t',0}; - static const WCHAR esW[] = {'E','n','d','T','o','S','t','a','r','t',0}; - static const WCHAR eeW[] = {'E','n','d','T','o','E','n','d',0}; - - if(!wcsicmp(str, seW)) return NS_START_TO_END; - if(!wcsicmp(str, ssW)) return NS_START_TO_START; - if(!wcsicmp(str, esW)) return NS_END_TO_START; - if(!wcsicmp(str, eeW)) return NS_END_TO_END; + if(!wcsicmp(str, L"StartToEnd")) return NS_START_TO_END; + if(!wcsicmp(str, L"StartToStart")) return NS_START_TO_START; + if(!wcsicmp(str, L"EndToStart")) return NS_END_TO_START; + if(!wcsicmp(str, L"EndToEnd")) return NS_END_TO_END;
return -1; } @@ -450,10 +433,10 @@ static void wstrbuf_append_node(wstrbuf_t *buf, nsIDOMNode *node, BOOL ignore_te break; } case ELEMENT_NODE: - if(is_elem_tag(node, brW)) { + if(is_elem_tag(node, L"br")) { static const WCHAR endlW[] = {'\r','\n'}; wstrbuf_append_len(buf, endlW, 2); - }else if(is_elem_tag(node, hrW)) { + }else if(is_elem_tag(node, L"hr")) { static const WCHAR endl2W[] = {'\r','\n','\r','\n'}; wstrbuf_append_len(buf, endl2W, 4); } @@ -617,7 +600,7 @@ static WCHAR move_next_char(rangepoint_t *iter) if(!node) break;
- if(is_elem_tag(node, brW)) { + if(is_elem_tag(node, L"br")) { if(cspace) { nsIDOMNode_Release(node); free_rangepoint(iter); @@ -627,7 +610,7 @@ static WCHAR move_next_char(rangepoint_t *iter)
cspace = '\n'; init_rangepoint(&last_space, iter->node, iter->off+1); - }else if(is_elem_tag(node, hrW)) { + }else if(is_elem_tag(node, L"hr")) { nsIDOMNode_Release(node); if(cspace) { free_rangepoint(iter); @@ -707,12 +690,12 @@ static WCHAR move_prev_char(rangepoint_t *iter) if(!node) break;
- if(is_elem_tag(node, brW)) { + if(is_elem_tag(node, L"br")) { if(cspace) free_rangepoint(&last_space); cspace = '\n'; init_rangepoint(&last_space, iter->node, iter->off-1); - }else if(is_elem_tag(node, hrW)) { + }else if(is_elem_tag(node, L"hr")) { nsIDOMNode_Release(node); if(cspace) { free_rangepoint(iter); @@ -947,8 +930,7 @@ static HRESULT WINAPI HTMLTxtRange_get_htmlText(IHTMLTxtRange *iface, BSTR *p) }
if(!*p) { - static const WCHAR emptyW[] = {0}; - *p = SysAllocString(emptyW); + *p = SysAllocString(L""); }
TRACE("return %s\n", debugstr_w(*p)); diff --git a/dlls/mshtml/script.c b/dlls/mshtml/script.c index bb097081c5e..8f2c7f598ea 100644 --- a/dlls/mshtml/script.c +++ b/dlls/mshtml/script.c @@ -67,11 +67,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml); #define SCRIPTLANGUAGEVERSION_HTML 0x400 #define SCRIPTLANGUAGEVERSION_ES5 0x102
-static const WCHAR documentW[] = {'d','o','c','u','m','e','n','t',0}; -static const WCHAR windowW[] = {'w','i','n','d','o','w',0}; -static const WCHAR script_endW[] = {'<','/','S','C','R','I','P','T','>',0}; -static const WCHAR emptyW[] = {0}; - struct ScriptHost { IActiveScriptSite IActiveScriptSite_iface; IActiveScriptSiteInterruptPoll IActiveScriptSiteInterruptPoll_iface; @@ -201,7 +196,7 @@ static BOOL init_script_engine(ScriptHost *script_host) return FALSE; }
- hres = IActiveScript_AddNamedItem(script_host->script, windowW, + hres = IActiveScript_AddNamedItem(script_host->script, L"window", SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS); if(SUCCEEDED(hres)) { V_VT(&var) = VT_BOOL; @@ -357,7 +352,7 @@ static HRESULT WINAPI ActiveScriptSite_GetItemInfo(IActiveScriptSite *iface, LPC
*ppiunkItem = NULL;
- if(wcscmp(pstrName, windowW)) + if(wcscmp(pstrName, L"window")) return DISP_E_MEMBERNOTFOUND;
if(!This->window) @@ -800,7 +795,7 @@ static void parse_elem_text(ScriptHost *script_host, HTMLScriptElement *script_e VariantInit(&var); memset(&excepinfo, 0, sizeof(excepinfo)); TRACE(">>>\n"); - hres = IActiveScriptParse_ParseScriptText(script_host->parse, text, windowW, NULL, script_endW, + hres = IActiveScriptParse_ParseScriptText(script_host->parse, text, L"window", NULL, L"</SCRIPT>", 0, 0, SCRIPTTEXT_ISVISIBLE|SCRIPTTEXT_HOSTMANAGESSOURCE, &var, &excepinfo); if(SUCCEEDED(hres)) @@ -1169,17 +1164,10 @@ static GUID get_default_script_guid(HTMLInnerWindow *window)
static BOOL get_guid_from_type(LPCWSTR type, GUID *guid) { - static const WCHAR text_javascriptW[] = - {'t','e','x','t','/','j','a','v','a','s','c','r','i','p','t',0}; - static const WCHAR text_jscriptW[] = - {'t','e','x','t','/','j','s','c','r','i','p','t',0}; - static const WCHAR text_vbscriptW[] = - {'t','e','x','t','/','v','b','s','c','r','i','p','t',0}; - /* FIXME: Handle more types */ - if(!wcsicmp(type, text_javascriptW) || !wcsicmp(type, text_jscriptW)) { + if(!wcsicmp(type, L"text/javascript") || !wcsicmp(type, L"text/jscript")) { *guid = CLSID_JScript; - }else if(!wcsicmp(type, text_vbscriptW)) { + }else if(!wcsicmp(type, L"text/vbscript")) { *guid = CLSID_VBScript; }else { FIXME("Unknown type %s\n", debugstr_w(type)); @@ -1306,8 +1294,6 @@ IDispatch *script_parse_event(HTMLInnerWindow *window, LPCWSTR text) IDispatch *disp; HRESULT hres;
- static const WCHAR delimiterW[] = {'"',0}; - TRACE("%s\n", debugstr_w(text));
for(ptr = text; iswalnum(*ptr); ptr++); @@ -1347,8 +1333,8 @@ IDispatch *script_parse_event(HTMLInnerWindow *window, LPCWSTR text) if(!script_host || !script_host->parse_proc) return NULL;
- hres = IActiveScriptParseProcedure2_ParseProcedureText(script_host->parse_proc, ptr, NULL, emptyW, - NULL, NULL, delimiterW, 0 /* FIXME */, 0, + hres = IActiveScriptParseProcedure2_ParseProcedureText(script_host->parse_proc, ptr, NULL, L"", + NULL, NULL, L""", 0 /* FIXME */, 0, SCRIPTPROC_HOSTMANAGESSOURCE|SCRIPTPROC_IMPLICIT_THIS|SCRIPTPROC_IMPLICIT_PARENTS, &disp); if(FAILED(hres)) { WARN("ParseProcedureText failed: %08x\n", hres); @@ -1366,8 +1352,6 @@ HRESULT exec_script(HTMLInnerWindow *window, const WCHAR *code, const WCHAR *lan GUID guid; HRESULT hres;
- static const WCHAR delimW[] = {'"',0}; - if(!get_guid_from_language(lang, &guid)) { WARN("Could not find script GUID\n"); return CO_E_CLASSSTRING; @@ -1386,7 +1370,7 @@ HRESULT exec_script(HTMLInnerWindow *window, const WCHAR *code, const WCHAR *lan
memset(&ei, 0, sizeof(ei)); TRACE(">>>\n"); - hres = IActiveScriptParse_ParseScriptText(script_host->parse, code, NULL, NULL, delimW, 0, 0, SCRIPTTEXT_ISVISIBLE, ret, &ei); + hres = IActiveScriptParse_ParseScriptText(script_host->parse, code, NULL, NULL, L""", 0, 0, SCRIPTTEXT_ISVISIBLE, ret, &ei); if(SUCCEEDED(hres)) TRACE("<<<\n"); else @@ -1403,7 +1387,7 @@ IDispatch *get_script_disp(ScriptHost *script_host) if(!script_host->script) return NULL;
- hres = IActiveScript_GetScriptDispatch(script_host->script, windowW, &disp); + hres = IActiveScript_GetScriptDispatch(script_host->script, L"window", &disp); if(FAILED(hres)) return NULL;
@@ -1429,10 +1413,10 @@ static EventTarget *find_event_target(HTMLDocumentNode *doc, HTMLScriptElement * nsAString_GetData(&target_id_str, &target_id); if(!*target_id) { FIXME("Empty for attribute\n"); - }else if(!wcscmp(target_id, documentW)) { + }else if(!wcscmp(target_id, L"document")) { event_target = &doc->node.event_target; htmldoc_addref(&doc->basedoc); - }else if(!wcscmp(target_id, windowW)) { + }else if(!wcscmp(target_id, L"window")) { if(doc->window) { event_target = &doc->window->event_target; IDispatchEx_AddRef(&event_target->dispex.IDispatchEx_iface); @@ -1519,7 +1503,7 @@ static IDispatch *parse_event_elem(HTMLDocumentNode *doc, HTMLScriptElement *scr
nsAString_GetData(&nsstr, &text); hres = IActiveScriptParseProcedure2_ParseProcedureText(script_host->parse_proc, text, args, - emptyW, NULL, NULL, script_endW, 0, 0, + L"", NULL, NULL, L"</SCRIPT>", 0, 0, SCRIPTPROC_HOSTMANAGESSOURCE|SCRIPTPROC_IMPLICIT_THIS|SCRIPTPROC_IMPLICIT_PARENTS, &disp); if(FAILED(hres)) disp = NULL; diff --git a/dlls/mshtml/secmgr.c b/dlls/mshtml/secmgr.c index f112119e80c..019327caa47 100644 --- a/dlls/mshtml/secmgr.c +++ b/dlls/mshtml/secmgr.c @@ -34,8 +34,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
-static const WCHAR about_blankW[] = {'a','b','o','u','t',':','b','l','a','n','k',0}; - /* Defined as extern in urlmon.idl, but not exported by uuid.lib */ DECLSPEC_HIDDEN const GUID GUID_CUSTOM_CONFIRMOBJECTSAFETY = {0x10200490,0xfa38,0x11d0,{0xac,0x0e,0x00,0xa0,0xc9,0xf,0xff,0xc0}}; @@ -82,7 +80,7 @@ static HRESULT WINAPI InternetHostSecurityManager_ProcessUrlAction(IInternetHost if(!This->basedoc.window) return E_UNEXPECTED;
- url = This->basedoc.window->url ? This->basedoc.window->url : about_blankW; + url = This->basedoc.window->url ? This->basedoc.window->url : L"about:blank";
return IInternetSecurityManager_ProcessUrlAction(get_security_manager(), url, dwAction, pPolicy, cbPolicy, pContext, cbContext, dwFlags, dwReserved); @@ -187,7 +185,7 @@ static HRESULT WINAPI InternetHostSecurityManager_QueryCustomPolicy(IInternetHos if(!This->basedoc.window) return E_UNEXPECTED;
- url = This->basedoc.window->url ? This->basedoc.window->url : about_blankW; + url = This->basedoc.window->url ? This->basedoc.window->url : L"about:blank";
hres = IInternetSecurityManager_QueryCustomPolicy(get_security_manager(), url, guidKey, ppPolicy, pcbPolicy, pContext, cbContext, dwReserved); diff --git a/dlls/mshtml/selection.c b/dlls/mshtml/selection.c index da8fbfa2e23..4fe9a1708a1 100644 --- a/dlls/mshtml/selection.c +++ b/dlls/mshtml/selection.c @@ -210,15 +210,12 @@ static HRESULT WINAPI HTMLSelectionObject_get_type(IHTMLSelectionObject *iface, HTMLSelectionObject *This = impl_from_IHTMLSelectionObject(iface); cpp_bool collapsed = TRUE;
- static const WCHAR wszNone[] = {'N','o','n','e',0}; - static const WCHAR wszText[] = {'T','e','x','t',0}; - TRACE("(%p)->(%p)\n", This, p);
if(This->nsselection) nsISelection_GetIsCollapsed(This->nsselection, &collapsed);
- *p = SysAllocString(collapsed ? wszNone : wszText); /* FIXME: control */ + *p = SysAllocString(collapsed ? L"None" : L"Text"); /* FIXME: control */ TRACE("ret %s\n", debugstr_w(*p)); return S_OK; } @@ -308,12 +305,10 @@ static HRESULT WINAPI HTMLSelectionObject2_get_typeDetail(IHTMLSelectionObject2 { HTMLSelectionObject *This = impl_from_IHTMLSelectionObject2(iface);
- static const WCHAR undefinedW[] = {'u','n','d','e','f','i','n','e','d',0}; - FIXME("(%p)->(%p) semi-stub\n", This, p);
/* FIXME: We should try to use ISelectionServicesListener::GetTypeDetail here. */ - *p = SysAllocString(undefinedW); + *p = SysAllocString(L"undefined"); return *p ? S_OK : E_OUTOFMEMORY; }
diff --git a/dlls/mshtml/svg.c b/dlls/mshtml/svg.c index 6fc77fde011..e1de57fc4b1 100644 --- a/dlls/mshtml/svg.c +++ b/dlls/mshtml/svg.c @@ -1173,21 +1173,17 @@ static HRESULT create_tspan_element(HTMLDocumentNode *doc, nsIDOMSVGElement *nse return S_OK; }
-static const WCHAR circleW[] = {'c','i','r','c','l','e',0}; -static const WCHAR svgW[] = {'s','v','g',0}; -static const WCHAR tspanW[] = {'t','s','p','a','n',0}; - HRESULT create_svg_element(HTMLDocumentNode *doc, nsIDOMSVGElement *dom_element, const WCHAR *tag_name, HTMLElement **elem) { SVGElement *svg_element;
TRACE("%s\n", debugstr_w(tag_name));
- if(!wcscmp(tag_name, svgW)) + if(!wcscmp(tag_name, L"svg")) return create_viewport_element(doc, dom_element, elem); - if(!wcscmp(tag_name, circleW)) + if(!wcscmp(tag_name, L"circle")) return create_circle_element(doc, dom_element, elem); - if(!wcscmp(tag_name, tspanW)) + if(!wcscmp(tag_name, L"tspan")) return create_tspan_element(doc, dom_element, elem);
svg_element = heap_alloc_zero(sizeof(*svg_element)); diff --git a/dlls/mshtml/task.c b/dlls/mshtml/task.c index 4cfa83cd566..f9d06407fb3 100644 --- a/dlls/mshtml/task.c +++ b/dlls/mshtml/task.c @@ -315,22 +315,20 @@ static LRESULT WINAPI hidden_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa static HWND create_thread_hwnd(void) { static ATOM hidden_wnd_class = 0; - static const WCHAR wszInternetExplorer_Hidden[] = {'I','n','t','e','r','n','e','t', - ' ','E','x','p','l','o','r','e','r','_','H','i','d','d','e','n',0};
if(!hidden_wnd_class) { WNDCLASSEXW wndclass = { sizeof(WNDCLASSEXW), 0, hidden_proc, 0, 0, hInst, NULL, NULL, NULL, NULL, - wszInternetExplorer_Hidden, + L"Internet Explorer_Hidden", NULL };
hidden_wnd_class = RegisterClassExW(&wndclass); }
- return CreateWindowExW(0, wszInternetExplorer_Hidden, NULL, WS_POPUP, + return CreateWindowExW(0, L"Internet Explorer_Hidden", NULL, WS_POPUP, 0, 0, 0, 0, NULL, NULL, hInst, NULL); }
diff --git a/dlls/mshtml/view.c b/dlls/mshtml/view.c index bb24335cdc6..0f3371c069f 100644 --- a/dlls/mshtml/view.c +++ b/dlls/mshtml/view.c @@ -36,11 +36,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
#define TIMER_ID 0x1000
-static const WCHAR wszInternetExplorer_Server[] = - {'I','n','t','e','r','n','e','t',' ','E','x','p','l','o','r','e','r','_','S','e','r','v','e','r',0}; - -static const WCHAR wszTooltipData[] = {'t','o','o','l','t','i','p','_','d','a','t','a',0}; - static ATOM serverwnd_class = 0;
typedef struct { @@ -98,11 +93,10 @@ void update_title(HTMLDocumentObj *This)
hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget, (void**)&olecmd); if(SUCCEEDED(hres)) { - static const WCHAR empty[] = {0}; VARIANT title;
V_VT(&title) = VT_BSTR; - V_BSTR(&title) = SysAllocString(empty); + V_BSTR(&title) = SysAllocString(L""); IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETTITLE, OLECMDEXECOPT_DONTPROMPTUSER, &title, NULL); SysFreeString(V_BSTR(&title)); @@ -163,13 +157,11 @@ static LRESULT WINAPI serverwnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM { HTMLDocumentObj *This;
- static const WCHAR wszTHIS[] = {'T','H','I','S',0}; - if(msg == WM_CREATE) { This = *(HTMLDocumentObj**)lParam; - SetPropW(hwnd, wszTHIS, This); + SetPropW(hwnd, L"THIS", This); }else { - This = GetPropW(hwnd, wszTHIS); + This = GetPropW(hwnd, L"THIS"); }
switch(msg) { @@ -214,7 +206,7 @@ static void register_serverwnd_class(void) CS_DBLCLKS, serverwnd_proc, 0, 0, NULL, NULL, NULL, NULL, NULL, - wszInternetExplorer_Server, + L"Internet Explorer_Server", NULL, }; wndclass.hInstance = hInst; @@ -267,7 +259,7 @@ static HRESULT activate_window(HTMLDocumentObj *This) posrect.left, posrect.top, posrect.right-posrect.left, posrect.bottom-posrect.top, SWP_NOACTIVATE | SWP_SHOWWINDOW); }else { - CreateWindowExW(0, wszInternetExplorer_Server, NULL, + CreateWindowExW(0, L"Internet Explorer_Server", NULL, WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, posrect.left, posrect.top, posrect.right-posrect.left, posrect.bottom-posrect.top, parent_hwnd, NULL, hInst, This); @@ -336,7 +328,7 @@ static HRESULT activate_window(HTMLDocumentObj *This)
static LRESULT WINAPI tooltips_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { - tooltip_data *data = GetPropW(hwnd, wszTooltipData); + tooltip_data *data = GetPropW(hwnd, L"tooltip_data");
TRACE("%d %p\n", msg, data);
@@ -366,7 +358,7 @@ static void create_tooltips_window(HTMLDocumentObj *This) data->doc = This; data->proc = (WNDPROC)GetWindowLongPtrW(This->tooltips_hwnd, GWLP_WNDPROC);
- SetPropW(This->tooltips_hwnd, wszTooltipData, data); + SetPropW(This->tooltips_hwnd, L"tooltip_data", data);
SetWindowLongPtrW(This->tooltips_hwnd, GWLP_WNDPROC, (LONG_PTR)tooltips_proc);
diff --git a/dlls/mshtml/xmlhttprequest.c b/dlls/mshtml/xmlhttprequest.c index 80d09d9632c..c05d5871286 100644 --- a/dlls/mshtml/xmlhttprequest.c +++ b/dlls/mshtml/xmlhttprequest.c @@ -117,22 +117,18 @@ static void detach_xhr_event_listener(XMLHttpReqEventListener *event_listener) nsAString str; nsresult nsres;
- static const WCHAR loadW[] = {'l','o','a','d',0}; - static const WCHAR readystatechangeW[] = - {'o','n','r','e','a','d','y','s','t','a','t','e','c','h','a','n','g','e',0}; - nsres = nsIXMLHttpRequest_QueryInterface(event_listener->xhr->nsxhr, &IID_nsIDOMEventTarget, (void**)&event_target); assert(nsres == NS_OK);
if(event_listener->readystatechange_event) { - nsAString_InitDepend(&str, readystatechangeW); + nsAString_InitDepend(&str, L"onreadystatechange"); nsres = nsIDOMEventTarget_RemoveEventListener(event_target, &str, &event_listener->nsIDOMEventListener_iface, FALSE); nsAString_Finish(&str); assert(nsres == NS_OK); }
if(event_listener->load_event) { - nsAString_InitDepend(&str, loadW); + nsAString_InitDepend(&str, L"load"); nsres = nsIDOMEventTarget_RemoveEventListener(event_target, &str, &event_listener->nsIDOMEventListener_iface, FALSE); nsAString_Finish(&str); assert(nsres == NS_OK); @@ -756,10 +752,8 @@ static inline HTMLXMLHttpRequest *impl_from_DispatchEx(DispatchEx *iface)
static HRESULT HTMLXMLHttpRequest_get_dispid(DispatchEx *dispex, BSTR name, DWORD flags, DISPID *dispid) { - static const WCHAR onloadW[] = {'o','n','l','o','a','d',0}; - /* onload event handler property is supported, but not exposed by any interface. We implement as a custom property. */ - if(!wcscmp(onloadW, name)) { + if(!wcscmp(L"onload", name)) { *dispid = MSHTML_DISPID_HTMLXMLHTTPREQUEST_ONLOAD; return S_OK; } @@ -811,17 +805,14 @@ static void HTMLXMLHttpRequest_bind_event(DispatchEx *dispex, eventid_t eid) nsAString type_str; nsresult nsres;
- static const WCHAR readystatechangeW[] = {'r','e','a','d','y','s','t','a','t','e','c','h','a','n','g','e',0}; - static const WCHAR loadW[] = {'l','o','a','d',0}; - TRACE("(%p)\n", This);
switch(eid) { case EVENTID_READYSTATECHANGE: - type_name = readystatechangeW; + type_name = L"readystatechange"; break; case EVENTID_LOAD: - type_name = loadW; + type_name = L"load"; break; default: return;