mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Code cleanup.
This commit is contained in:
parent
2df0f6f7f6
commit
b52fd99949
@ -734,7 +734,7 @@ void CDialogManage::CTabSkins::ReadSkin()
|
|||||||
ShowScrollBar(item, SB_VERT, FALSE);
|
ShowScrollBar(item, SB_VERT, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete buffer;
|
delete [] buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1396,7 +1396,7 @@ void CDialogManage::CTabThemes::PreserveSetting(const std::wstring& backupFile,
|
|||||||
WritePrivateProfileString(L"Rainmeter", key, buffer, Rainmeter->GetIniFile().c_str());
|
WritePrivateProfileString(L"Rainmeter", key, buffer, Rainmeter->GetIniFile().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
delete buffer;
|
delete [] buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -466,11 +466,11 @@ std::string ConvertToAscii(LPCTSTR str)
|
|||||||
|
|
||||||
if (str && *str)
|
if (str && *str)
|
||||||
{
|
{
|
||||||
int strLen = (int)wcslen(str) + 1;
|
int strLen = (int)wcslen(str);
|
||||||
int bufLen = WideCharToMultiByte(CP_ACP, 0, str, strLen, NULL, 0, NULL, NULL);
|
int bufLen = WideCharToMultiByte(CP_ACP, 0, str, strLen, NULL, 0, NULL, NULL);
|
||||||
if (bufLen > 0)
|
if (bufLen > 0)
|
||||||
{
|
{
|
||||||
szAscii.resize(bufLen - 1);
|
szAscii.resize(bufLen);
|
||||||
WideCharToMultiByte(CP_ACP, 0, str, strLen, &szAscii[0], bufLen, NULL, NULL);
|
WideCharToMultiByte(CP_ACP, 0, str, strLen, &szAscii[0], bufLen, NULL, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -483,11 +483,11 @@ std::wstring ConvertToWide(LPCSTR str)
|
|||||||
|
|
||||||
if (str && *str)
|
if (str && *str)
|
||||||
{
|
{
|
||||||
int strLen = (int)strlen(str) + 1;
|
int strLen = (int)strlen(str);
|
||||||
int bufLen = MultiByteToWideChar(CP_ACP, 0, str, strLen, NULL, 0);
|
int bufLen = MultiByteToWideChar(CP_ACP, 0, str, strLen, NULL, 0);
|
||||||
if (bufLen > 0)
|
if (bufLen > 0)
|
||||||
{
|
{
|
||||||
szWide.resize(bufLen - 1);
|
szWide.resize(bufLen);
|
||||||
MultiByteToWideChar(CP_ACP, 0, str, strLen, &szWide[0], bufLen);
|
MultiByteToWideChar(CP_ACP, 0, str, strLen, &szWide[0], bufLen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -500,11 +500,11 @@ std::string ConvertToUTF8(LPCWSTR str)
|
|||||||
|
|
||||||
if (str && *str)
|
if (str && *str)
|
||||||
{
|
{
|
||||||
int strLen = (int)wcslen(str) + 1;
|
int strLen = (int)wcslen(str);
|
||||||
int bufLen = WideCharToMultiByte(CP_UTF8, 0, str, strLen, NULL, 0, NULL, NULL);
|
int bufLen = WideCharToMultiByte(CP_UTF8, 0, str, strLen, NULL, 0, NULL, NULL);
|
||||||
if (bufLen > 0)
|
if (bufLen > 0)
|
||||||
{
|
{
|
||||||
szAscii.resize(bufLen - 1);
|
szAscii.resize(bufLen);
|
||||||
WideCharToMultiByte(CP_UTF8, 0, str, strLen, &szAscii[0], bufLen, NULL, NULL);
|
WideCharToMultiByte(CP_UTF8, 0, str, strLen, &szAscii[0], bufLen, NULL, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -517,11 +517,11 @@ std::wstring ConvertUTF8ToWide(LPCSTR str)
|
|||||||
|
|
||||||
if (str && *str)
|
if (str && *str)
|
||||||
{
|
{
|
||||||
int strLen = (int)strlen(str) + 1;
|
int strLen = (int)strlen(str);
|
||||||
int bufLen = MultiByteToWideChar(CP_UTF8, 0, str, strLen, NULL, 0);
|
int bufLen = MultiByteToWideChar(CP_UTF8, 0, str, strLen, NULL, 0);
|
||||||
if (bufLen > 0)
|
if (bufLen > 0)
|
||||||
{
|
{
|
||||||
szWide.resize(bufLen - 1);
|
szWide.resize(bufLen);
|
||||||
MultiByteToWideChar(CP_UTF8, 0, str, strLen, &szWide[0], bufLen);
|
MultiByteToWideChar(CP_UTF8, 0, str, strLen, &szWide[0], bufLen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user