Commit c4a9a296 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

oleaut32: Use wide-char string literals.

parent 067c0772
......@@ -505,9 +505,6 @@ void WINAPI SetOaNoCache(void)
bstr_cache_enabled = FALSE;
}
static const WCHAR _delimiter[] = {'!',0}; /* default delimiter apparently */
static const WCHAR *pdelimiter = &_delimiter[0];
/***********************************************************************
* RegisterActiveObject (OLEAUT32.33)
*
......@@ -533,7 +530,7 @@ HRESULT WINAPI DECLSPEC_HOTPATCH RegisterActiveObject(
DWORD rot_flags = ROTFLAGS_REGISTRATIONKEEPSALIVE; /* default registration is strong */
StringFromGUID2(rcid,guidbuf,39);
ret = CreateItemMoniker(pdelimiter,guidbuf,&moniker);
ret = CreateItemMoniker(L"!", guidbuf, &moniker);
if (FAILED(ret))
return ret;
ret = GetRunningObjectTable(0,&runobtable);
......@@ -597,7 +594,7 @@ HRESULT WINAPI DECLSPEC_HOTPATCH GetActiveObject(REFCLSID rcid,LPVOID preserved,
LPMONIKER moniker;
StringFromGUID2(rcid,guidbuf,39);
ret = CreateItemMoniker(pdelimiter,guidbuf,&moniker);
ret = CreateItemMoniker(L"!", guidbuf, &moniker);
if (FAILED(ret))
return ret;
ret = GetRunningObjectTable(0,&runobtable);
......@@ -1104,10 +1101,8 @@ HRESULT WINAPI DllCanUnloadNow(void)
*/
BOOL WINAPI DllMain(HINSTANCE hInstDll, DWORD fdwReason, LPVOID lpvReserved)
{
static const WCHAR oanocacheW[] = {'o','a','n','o','c','a','c','h','e',0};
if(fdwReason == DLL_PROCESS_ATTACH)
bstr_cache_enabled = !GetEnvironmentVariableW(oanocacheW, NULL, 0);
bstr_cache_enabled = !GetEnvironmentVariableW(L"oanocache", NULL, 0);
return OLEAUTPS_DllMain( hInstDll, fdwReason, lpvReserved );
}
......@@ -1173,33 +1168,23 @@ HRESULT WINAPI GetAltMonthNames(LCID lcid, LPOLESTR **str)
NULL
};
static const WCHAR pl_month1W[] = {'s','t','y','c','z','n','i','a',0};
static const WCHAR pl_month2W[] = {'l','u','t','e','g','o',0};
static const WCHAR pl_month3W[] = {'m','a','r','c','a',0};
static const WCHAR pl_month4W[] = {'k','w','i','e','t','n','i','a',0};
static const WCHAR pl_month5W[] = {'m','a','j','a',0};
static const WCHAR pl_month6W[] = {'c','z','e','r','w','c','a',0};
static const WCHAR pl_month7W[] = {'l','i','p','c','a',0};
static const WCHAR pl_month8W[] = {'s','i','e','r','p','n','i','a',0};
static const WCHAR pl_month9W[] = {'w','r','z','e',0x15b,'n','i','a',0};
static const WCHAR pl_month10W[] = {'p','a',0x17a,'d','z','i','e','r','n','i','k','a',0};
static const WCHAR pl_month11W[] = {'l','i','s','t','o','p','a','d','a',0};
static const WCHAR pl_month12W[] = {'g','r','u','d','n','i','a',0};
static const WCHAR *polish_genitive_names[] =
{
pl_month1W,
pl_month2W,
pl_month3W,
pl_month4W,
pl_month5W,
pl_month6W,
pl_month7W,
pl_month8W,
L"stycznia",
L"lutego",
L"marca",
L"kwietnia",
L"maja",
L"czerwca",
L"lipca",
L"sierpnia",
pl_month9W,
pl_month10W,
pl_month11W,
pl_month12W,
L"listopada",
L"grudnia",
NULL
};
......
......@@ -374,25 +374,17 @@ HRESULT WINAPI OleCreateFontIndirect(
*/
static void OLEFont_SendNotify(OLEFontImpl* this, DISPID dispID)
{
static const WCHAR wszName[] = {'N','a','m','e',0};
static const WCHAR wszSize[] = {'S','i','z','e',0};
static const WCHAR wszBold[] = {'B','o','l','d',0};
static const WCHAR wszItalic[] = {'I','t','a','l','i','c',0};
static const WCHAR wszUnder[] = {'U','n','d','e','r','l','i','n','e',0};
static const WCHAR wszStrike[] = {'S','t','r','i','k','e','t','h','r','o','u','g','h',0};
static const WCHAR wszWeight[] = {'W','e','i','g','h','t',0};
static const WCHAR wszCharset[] = {'C','h','a','r','s','e','t',0};
static const LPCWSTR dispid_mapping[] =
{
wszName,
L"Name",
NULL,
wszSize,
wszBold,
wszItalic,
wszUnder,
wszStrike,
wszWeight,
wszCharset
L"Size",
L"Bold",
L"Italic",
L"Underline",
L"Strikethrough",
L"Weight",
L"Charset"
};
IEnumConnections *pEnum;
......@@ -1237,7 +1229,6 @@ static HRESULT WINAPI OLEFontImpl_GetTypeInfo(
LCID lcid,
ITypeInfo** ppTInfo)
{
static const WCHAR stdole2tlb[] = {'s','t','d','o','l','e','2','.','t','l','b',0};
ITypeLib *tl;
HRESULT hres;
......@@ -1245,7 +1236,7 @@ static HRESULT WINAPI OLEFontImpl_GetTypeInfo(
TRACE("(%p, iTInfo=%d, lcid=%04x, %p)\n", this, iTInfo, (int)lcid, ppTInfo);
if (iTInfo != 0)
return E_FAIL;
hres = LoadTypeLib(stdole2tlb, &tl);
hres = LoadTypeLib(L"stdole2.tlb", &tl);
if (FAILED(hres)) {
ERR("Could not load the stdole2.tlb?\n");
return hres;
......@@ -1912,20 +1903,13 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load(
Italic = 0 'False
Strikethrough = 0 'False
*/
static const WCHAR sAttrName[] = {'N','a','m','e',0};
static const WCHAR sAttrSize[] = {'S','i','z','e',0};
static const WCHAR sAttrCharset[] = {'C','h','a','r','s','e','t',0};
static const WCHAR sAttrWeight[] = {'W','e','i','g','h','t',0};
static const WCHAR sAttrUnderline[] = {'U','n','d','e','r','l','i','n','e',0};
static const WCHAR sAttrItalic[] = {'I','t','a','l','i','c',0};
static const WCHAR sAttrStrikethrough[] = {'S','t','r','i','k','e','t','h','r','o','u','g','h',0};
OLEFontImpl *this = impl_from_IPersistPropertyBag(iface);
VARIANT value;
HRESULT iRes;
VariantInit(&value);
iRes = IPropertyBag_Read(pPropBag, sAttrName, &value, pErrorLog);
iRes = IPropertyBag_Read(pPropBag, L"Name", &value, pErrorLog);
if (iRes == S_OK)
{
iRes = VariantChangeType(&value, &value, 0, VT_BSTR);
......@@ -1938,7 +1922,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load(
VariantClear(&value);
if (iRes == S_OK) {
iRes = IPropertyBag_Read(pPropBag, sAttrSize, &value, pErrorLog);
iRes = IPropertyBag_Read(pPropBag, L"Size", &value, pErrorLog);
if (iRes == S_OK)
{
iRes = VariantChangeType(&value, &value, 0, VT_CY);
......@@ -1952,7 +1936,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load(
}
if (iRes == S_OK) {
iRes = IPropertyBag_Read(pPropBag, sAttrCharset, &value, pErrorLog);
iRes = IPropertyBag_Read(pPropBag, L"Charset", &value, pErrorLog);
if (iRes == S_OK)
{
iRes = VariantChangeType(&value, &value, 0, VT_I2);
......@@ -1966,7 +1950,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load(
}
if (iRes == S_OK) {
iRes = IPropertyBag_Read(pPropBag, sAttrWeight, &value, pErrorLog);
iRes = IPropertyBag_Read(pPropBag, L"Weight", &value, pErrorLog);
if (iRes == S_OK)
{
iRes = VariantChangeType(&value, &value, 0, VT_I2);
......@@ -1980,7 +1964,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load(
}
if (iRes == S_OK) {
iRes = IPropertyBag_Read(pPropBag, sAttrUnderline, &value, pErrorLog);
iRes = IPropertyBag_Read(pPropBag, L"Underline", &value, pErrorLog);
if (iRes == S_OK)
{
iRes = VariantChangeType(&value, &value, 0, VT_BOOL);
......@@ -1994,7 +1978,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load(
}
if (iRes == S_OK) {
iRes = IPropertyBag_Read(pPropBag, sAttrItalic, &value, pErrorLog);
iRes = IPropertyBag_Read(pPropBag, L"Italic", &value, pErrorLog);
if (iRes == S_OK)
{
iRes = VariantChangeType(&value, &value, 0, VT_BOOL);
......@@ -2008,7 +1992,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load(
}
if (iRes == S_OK) {
iRes = IPropertyBag_Read(pPropBag, sAttrStrikethrough, &value, pErrorLog);
iRes = IPropertyBag_Read(pPropBag, L"Strikethrough", &value, pErrorLog);
if (iRes == S_OK)
{
iRes = VariantChangeType(&value, &value, 0, VT_BOOL);
......
......@@ -1947,7 +1947,6 @@ static HRESULT WINAPI OLEPictureImpl_GetTypeInfo(
LCID lcid,
ITypeInfo** ppTInfo)
{
static const WCHAR stdole2tlb[] = {'s','t','d','o','l','e','2','.','t','l','b',0};
ITypeLib *tl;
HRESULT hres;
......@@ -1956,7 +1955,7 @@ static HRESULT WINAPI OLEPictureImpl_GetTypeInfo(
if (iTInfo != 0)
return E_FAIL;
hres = LoadTypeLib(stdole2tlb, &tl);
hres = LoadTypeLib(L"stdole2.tlb", &tl);
if (FAILED(hres))
{
ERR("Could not load stdole2.tlb\n");
......@@ -2353,7 +2352,6 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller,
DWORD dwReserved, OLE_COLOR clrReserved, REFIID riid,
LPVOID *ppvRet )
{
static const WCHAR file[] = { 'f','i','l','e',':',0 };
IPicture *ipicture;
HANDLE hFile;
DWORD dwFileSize;
......@@ -2377,7 +2375,7 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller,
*ppvRet = NULL;
/* Convert file URLs to DOS paths. */
if (wcsncmp(szURLorPath, file, 5) == 0) {
if (wcsncmp(szURLorPath, L"file:", 5) == 0) {
DWORD size;
hRes = CoInternetParseUrl(szURLorPath, PARSE_PATH_FROM_URL, 0, path_buf,
ARRAY_SIZE(path_buf), &size, 0);
......
......@@ -154,8 +154,6 @@ static IPropertyPageSiteVtbl PropertyPageSiteVtbl = {
*/
HRESULT WINAPI OleCreatePropertyFrameIndirect(LPOCPFIPARAMS lpParams)
{
static const WCHAR comctlW[] = { 'c','o','m','c','t','l','3','2','.','d','l','l',0 };
PROPSHEETHEADERW property_sheet;
PROPSHEETPAGEW property_sheet_page;
struct {
......@@ -198,7 +196,7 @@ HRESULT WINAPI OleCreatePropertyFrameIndirect(LPOCPFIPARAMS lpParams)
FIXME("dispidInitialProperty not yet implemented\n");
hdc = GetDC(NULL);
hcomctl = LoadLibraryW(comctlW);
hcomctl = LoadLibraryW(L"comctl32.dll");
if(hcomctl)
property_sheet_dialog_find = FindResourceW(hcomctl,
MAKEINTRESOURCEW(1006 /*IDD_PROPSHEET*/), (LPWSTR)RT_DIALOG);
......
......@@ -38,9 +38,6 @@ extern HMODULE hProxyDll DECLSPEC_HIDDEN;
#define CY_HALF (CY_MULTIPLIER/2) /* 0.5 */
#define CY_HALF_F (CY_MULTIPLIER_F/2.0)
static const WCHAR szFloatFormatW[] = { '%','.','7','G','\0' };
static const WCHAR szDoubleFormatW[] = { '%','.','1','5','G','\0' };
/* Copy data from one variant to another. */
static inline void VARIANT_CopyData(const VARIANT *srcVar, VARTYPE vt, void *pOut)
{
......@@ -6111,9 +6108,6 @@ static BOOL VARIANT_GetLocalisedText(LANGID langId, DWORD dwId, WCHAR *lpszDest)
*/
HRESULT WINAPI VarBoolFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, VARIANT_BOOL *pBoolOut)
{
/* Any VB/VBA programmers out there should recognise these strings... */
static const WCHAR szFalse[] = { '#','F','A','L','S','E','#','\0' };
static const WCHAR szTrue[] = { '#','T','R','U','E','#','\0' };
WCHAR szBuff[64];
LANGID langId = MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT);
HRESULT hRes = S_OK;
......@@ -6170,9 +6164,9 @@ VarBoolFromStr_CheckLocalised:
}
/* All checks against localised text have failed, try #TRUE#/#FALSE# */
if (!wcscmp(strIn, szFalse))
if (!wcscmp(strIn, L"#FALSE#"))
*pBoolOut = VARIANT_FALSE;
else if (!wcscmp(strIn, szTrue))
else if (!wcscmp(strIn, L"#TRUE#"))
*pBoolOut = VARIANT_TRUE;
else
{
......@@ -6521,8 +6515,7 @@ static HRESULT VARIANT_BstrFromReal(DOUBLE dblIn, LCID lcid, ULONG dwFlags,
*/
if (buff[0] == '-')
{
static const WCHAR szAccept[] = {'0', '.', '\0'};
if (lstrlenW(buff + 1) == wcsspn(buff + 1, szAccept))
if (lstrlenW(buff + 1) == wcsspn(buff + 1, L"0."))
{ buff[0] = '0'; buff[1] = '\0'; }
}
......@@ -6563,7 +6556,7 @@ static HRESULT VARIANT_BstrFromReal(DOUBLE dblIn, LCID lcid, ULONG dwFlags,
*/
HRESULT WINAPI VarBstrFromR4(FLOAT fltIn, LCID lcid, ULONG dwFlags, BSTR* pbstrOut)
{
return VARIANT_BstrFromReal(fltIn, lcid, dwFlags, pbstrOut, szFloatFormatW);
return VARIANT_BstrFromReal(fltIn, lcid, dwFlags, pbstrOut, L"%.7G");
}
/******************************************************************************
......@@ -6584,7 +6577,7 @@ HRESULT WINAPI VarBstrFromR4(FLOAT fltIn, LCID lcid, ULONG dwFlags, BSTR* pbstrO
*/
HRESULT WINAPI VarBstrFromR8(double dblIn, LCID lcid, ULONG dwFlags, BSTR* pbstrOut)
{
return VARIANT_BstrFromReal(dblIn, lcid, dwFlags, pbstrOut, szDoubleFormatW);
return VARIANT_BstrFromReal(dblIn, lcid, dwFlags, pbstrOut, L"%.15G");
}
/******************************************************************************
......
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