• R/O
  • SSH
  • HTTPS

ttssh2: コミット


コミットメタ情報

リビジョン8628 (tree)
日時2020-03-27 00:40:01
作者zmatsuo

ログメッセージ

CListDlg, FilenameBox を unicode化

変更サマリ

差分

--- branches/unicode_macro/teraterm/common/codeconv.cpp (revision 8627)
+++ branches/unicode_macro/teraterm/common/codeconv.cpp (revision 8628)
@@ -1277,19 +1277,17 @@
12771277 tstr_ = NULL;
12781278 }
12791279
1280-#if 0
1281-tc::tc(const char *strA)
1280+wc::wc(const char *strA)
12821281 {
12831282 tstr_ = NULL;
12841283 assign(strA, CP_ACP);
12851284 }
12861285
1287-tc::tc(const char *strA, int code_page)
1286+wc::wc(const char *strA, int code_page)
12881287 {
12891288 tstr_ = NULL;
12901289 assign(strA, code_page);
12911290 }
1292-#endif
12931291
12941292 wc::wc(const wchar_t *strW)
12951293 {
@@ -1319,20 +1317,19 @@
13191317 }
13201318 }
13211319
1322-#if 0
1323-tc& tc::operator=(const char *strA)
1320+wc& wc::operator=(const char *strA)
13241321 {
13251322 assign(strA, CP_ACP);
13261323 return *this;
13271324 }
13281325
1329-tc& tc::operator=(const wchar_t *strW)
1326+wc& wc::operator=(const wchar_t *strW)
13301327 {
13311328 assign(strW);
13321329 return *this;
13331330 }
13341331
1335-tc &tc::operator=(const tc &obj)
1332+wc &wc::operator=(const wc &obj)
13361333 {
13371334 copy(obj);
13381335 return *this;
@@ -1339,13 +1336,12 @@
13391336 }
13401337
13411338 #if defined(MOVE_CONSTRUCTOR_ENABLE)
1342-tc& tc::operator=(tc &&obj) noexcept
1339+wc& wc::operator=(wc &&obj) noexcept
13431340 {
13441341 move(obj);
13451342 return *this;
13461343 }
13471344 #endif
1348-#endif
13491345
13501346 wc wc::fromUtf8(const char *strU8)
13511347 {
--- branches/unicode_macro/teraterm/ttpmacro/ListDlg.cpp (revision 8627)
+++ branches/unicode_macro/teraterm/ttpmacro/ListDlg.cpp (revision 8628)
@@ -71,7 +71,7 @@
7171 while (*p) {
7272 SIZE size;
7373 int ListWidth;
74- SendDlgItemMessage(IDC_LISTBOX, LB_ADDSTRING, 0, (LPARAM)(*p));
74+ SendDlgItemMessageW(IDC_LISTBOX, LB_ADDSTRING, 0, (LPARAM)(*p));
7575 GetTextExtentPoint32W(DC, *p, wcslen(*p), &size);
7676 ListWidth = size.cx;
7777 if (ListWidth > ListMaxWidth) {
--- branches/unicode_macro/teraterm/ttpmacro/ttl_gui.cpp (revision 8627)
+++ branches/unicode_macro/teraterm/ttpmacro/ttl_gui.cpp (revision 8628)
@@ -49,6 +49,7 @@
4949 #include "ttl.h"
5050 #include "ttl_gui.h"
5151 #include "codeconv.h"
52+#include "layer_for_unicode.h"
5253
5354 // add 'clipb2var' (2006.9.17 maya)
5455 WORD TTLClipb2Var()
@@ -230,15 +231,13 @@
230231 TStrVal Str1;
231232 WORD Err, ValType;
232233 TVarId VarId;
233- OPENFILENAME ofn;
234- TCHAR uimsg[MAX_UIMSG];
235234 BOOL SaveFlag = FALSE;
236235 TStrVal InitDir = "";
237- tc InitDirT;
236+ wc InitDirT;
238237
239238 Err = 0;
240239 GetStrVal(Str1,&Err);
241- tc Str1T = tc::fromUtf8(Str1);
240+ wc Str1T = tc::fromUtf8(Str1);
242241
243242 if (Err!=0) return Err;
244243
@@ -261,15 +260,17 @@
261260
262261 SetInputStr("");
263262 if (CheckVar("inputstr", &ValType, &VarId) && (ValType==TypString)) {
264- TCHAR filename[MaxStrLen];
263+ wchar_t uimsg[MAX_UIMSG];
264+ OPENFILENAMEW ofn;
265+ wchar_t filename[MaxStrLen];
265266 filename[0] = 0;
266267 memset(&ofn, 0, sizeof(ofn));
267- ofn.lStructSize = get_OPENFILENAME_SIZE();
268+ ofn.lStructSize = get_OPENFILENAME_SIZEW();
268269 ofn.hwndOwner = GetHWND();
269270 ofn.lpstrTitle = Str1T;
270271 ofn.lpstrFile = filename;
271272 ofn.nMaxFile = _countof(filename);
272- get_lang_msgT("FILEDLG_ALL_FILTER", uimsg, _countof(uimsg), _T("All(*.*)\\0*.*\\0\\0"), UILanguageFile);
273+ get_lang_msgW("FILEDLG_ALL_FILTER", uimsg, _countof(uimsg), L"All(*.*)\\0*.*\\0\\0", UILanguageFile);
273274 ofn.lpstrFilter = uimsg;
274275 ofn.lpstrInitialDir = NULL;
275276 if (strlen(InitDir) > 0) {
@@ -279,17 +280,17 @@
279280 BOOL ret;
280281 if (SaveFlag) {
281282 ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
282- ret = GetSaveFileName(&ofn);
283+ ret = _GetSaveFileNameW(&ofn);
283284 }
284285 else {
285286 ofn.Flags = OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT;
286- ret = GetOpenFileName(&ofn);
287+ ret = _GetOpenFileNameW(&ofn);
287288 }
288289
289- const char *filenameU8 = ToU8T(filename);
290+ char *filenameU8 = ToU8W(filename);
290291 char *dest = StrVarPtr(VarId);
291292 strcpy(dest, filenameU8);
292- free((void *)filenameU8);
293+ free(filenameU8);
293294
294295 SetResult(ret);
295296 }
旧リポジトリブラウザで表示