From 03e3e4ebe0fee7bbe8014014b77a21d22cc090a8 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> Date: Tue, 6 Apr 2010 00:55:48 +0000 Subject: Fixed translation issue Removed unneeded/duplicated code (thus shaved few more kb from the dll) git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@496 4f64403b-2f21-0410-a795-97e2b3489a10 --- updater/utils.cpp | 52 +++++----------------------------------------------- 1 file changed, 5 insertions(+), 47 deletions(-) (limited to 'updater/utils.cpp') diff --git a/updater/utils.cpp b/updater/utils.cpp index 5be5897..daed5a8 100644 --- a/updater/utils.cpp +++ b/updater/utils.cpp @@ -94,53 +94,11 @@ bool CreatePath(const TCHAR *path) { */ } -// must 'free' return val -TCHAR *GetTString(const char *asc) { - if(!asc) return 0; - -#ifdef _UNICODE - wchar_t *ret; - int code_page = CP_ACP; - if(ServiceExists(MS_LANGPACK_GETCODEPAGE)) code_page = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0); - int size = MultiByteToWideChar(code_page, MB_PRECOMPOSED, asc, -1, 0, 0); - ret = (wchar_t *)malloc(sizeof(wchar_t) * size); - MultiByteToWideChar(code_page, MB_PRECOMPOSED, asc, -1, ret, size); - return ret; -#else - return _strdup(asc); -#endif -} - -TCHAR *GetTStringACP(const char *asc) { - if(!asc) return 0; - -#ifdef _UNICODE - wchar_t *ret; - - int size = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, asc, -1, 0, 0); - ret = (wchar_t *)malloc(sizeof(wchar_t) * size); - MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, asc, -1, ret, size); - return ret; -#else - return _strdup(asc); -#endif -} - -char *GetAString(const TCHAR *t) { - if(!t) return 0; - -#ifdef _UNICODE - char *ret; - - int code_page = CP_ACP; - if(ServiceExists(MS_LANGPACK_GETCODEPAGE)) code_page = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0); - int size = WideCharToMultiByte(code_page, 0, t, -1, 0, 0, 0, 0); - ret = (char *)malloc(size); - WideCharToMultiByte(code_page, 0, t, -1, ret, size, 0, 0); - return ret; -#else - return _strdup(t); -#endif +// must 'mir_free' return val +TCHAR *GetTString(const char *asc) +{ + if (!asc) return NULL; + return (TCHAR*)CallService(MS_LANGPACK_PCHARTOTCHAR, 0, (LPARAM)asc); } void RemoveFolder(const TCHAR *src_folder) { -- cgit v1.2.3