Changeset 2e733771095b…
Parent 1c302f225d77…
by
Changes to 3 files · Browse files at 2e733771095b Showing diff from parent 1c302f225d77 Diff from another changeset...
@@ -140,9 +140,9 @@ )
{
std::wstring subkey = L"Software\\TortoiseHg\\CMenu\\";
- subkey += _WCSTR(lang.c_str());
+ subkey += MultibyteToWide(lang);
subkey += L"\\";
- subkey += _WCSTR(name.c_str());
+ subkey += MultibyteToWide(name);
TDEBUG_TRACEW(L"GetCMenuTranslation: " << subkey);
@@ -683,7 +683,8 @@ if (uFlags & GCS_UNICODE)
{
wchar_t* const dest = reinterpret_cast<wchar_t*>(pszName);
- const wchar_t* const src = pszw ? pszw : _WCSTR(psz);
+ std::wstring wpsz = MultibyteToWide(psz);
+ const wchar_t* const src = pszw ? pszw : wpsz.c_str();
wcsncpy(dest, src, cchMax-1);
*(dest + cchMax-1) = 0;
|
@@ -11,17 +11,6 @@ #include "shlwapi.h"
-LPWSTR hf_mbtowc(LPWSTR lpw, LPCSTR lpa, int nChars)
-{
- assert(lpa != NULL);
- assert(lpw != NULL);
-
- lpw[0] = '\0';
- MultiByteToWideChar(CP_ACP, 0, lpa, -1, lpw, nChars);
- return lpw;
-}
-
-
std::string GetTHgProgRoot()
{
LPCSTR regname = "Software\\TortoiseHg";
|
@@ -6,10 +6,6 @@ #include <string>
#include <vector>
-#define _WCSTR(str) hf_mbtowc((LPWSTR)alloca((strlen(str) + 1) * sizeof(WCHAR)),(str),strlen(str) + 1)
-
-LPWSTR hf_mbtowc(LPWSTR lpw, LPCSTR lpa, int nChars);
-
std::string GetTHgProgRoot();
std::string GetTemporaryFile(LPCSTR prefix="THG");
bool IsDirectory(const std::string&);
|
Loading...