[Ttssh2-commit] [8184] SetDlgTexts()による言語ファイル変換が成功したかどうかを把握したいため、関数に返り値を追加した。

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2019年 9月 18日 (水) 23:21:48 JST


Revision: 8184
          https://osdn.net/projects/ttssh2/scm/svn/commits/8184
Author:   yutakapon
Date:     2019-09-18 23:21:48 +0900 (Wed, 18 Sep 2019)
Log Message:
-----------
SetDlgTexts()による言語ファイル変換が成功したかどうかを把握したいため、関数に返り値を追加した。
内部動作の変更のみなので、改版履歴には記載不要。

branches/serial_port_improvedからリビジョン8159をマージ:
SetDlgTexts()による言語ファイル変換が成功したかどうかを把握したいため、
関数に返り値を追加した。

........

Modified Paths:
--------------
    trunk/teraterm/common/i18n.c
    trunk/teraterm/common/i18n.h
    trunk/teraterm/common/ttlib.c
    trunk/teraterm/common/ttlib.h

Property Changed:
----------------
    trunk/
    trunk/teraterm/

-------------- next part --------------
Index: trunk
===================================================================
--- trunk	2019-09-18 14:14:24 UTC (rev 8183)
+++ trunk	2019-09-18 14:21:48 UTC (rev 8184)

Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
## -2,7 +2,7 ##
 /branches/flowctrl_dsrdtr:7825-7827
 /branches/openssl_1_1_1_v2:7888
 /branches/portfwd_memleak:7732,7736-7737,7764
-/branches/serial_port_improved:8119,8140-8141,8144,8150,8158
+/branches/serial_port_improved:8119,8140-8141,8144,8150,8158-8159
 /branches/ssh_ed25519:5495-5544
 /branches/ttproxy_improved:8041,8055-8056
 /branches/ttssh_improved:8027,8036,8040,8044,8053-8054,8058,8060,8063,8081,8085
Index: trunk/teraterm
===================================================================
--- trunk/teraterm	2019-09-18 14:14:24 UTC (rev 8183)
+++ trunk/teraterm	2019-09-18 14:21:48 UTC (rev 8184)

Property changes on: trunk/teraterm
___________________________________________________________________
Modified: svn:mergeinfo
## -1,4 +1,4 ##
 /branches/drag_and_drop/teraterm:7130,7139,7141,7143-7147
 /branches/flowctrl_dsrdtr/teraterm:7825-7827
-/branches/serial_port_improved/teraterm:8119,8140-8141,8144,8150,8158
+/branches/serial_port_improved/teraterm:8119,8140-8141,8144,8150,8158-8159
 /branches/vs2015_warn/teraterm:6194-6285
\ No newline at end of property
Modified: trunk/teraterm/common/i18n.c
===================================================================
--- trunk/teraterm/common/i18n.c	2019-09-18 14:14:24 UTC (rev 8183)
+++ trunk/teraterm/common/i18n.c	2019-09-18 14:21:48 UTC (rev 8184)
@@ -110,15 +110,24 @@
 	return TRUE;
 }
 
-void WINAPI SetI18DlgStrs(const char *section, HWND hDlgWnd,
+/*
+ * \x8C\xBE\x8C\xEA\x83t\x83@\x83C\x83\x8B\x82\xA9\x82\xE7Dialog\x82̃R\x83\x93\x83|\x81[\x83l\x83\x93\x83g\x82̕\xB6\x8E\x9A\x97\xF1\x82\xF0\x95ϊ\xB7\x82\xB7\x82\xE9
+ *
+ * [return]
+ *    \x8C\xBE\x8C\xEA\x83t\x83@\x83C\x83\x8B\x82ŕϊ\xB7\x82ł\xAB\x82\xBD\x89\xF1\x90\x94(infoCount\x88ȉ\xBA\x82̐\x94\x82ɂȂ\xE9)
+ *
+ */
+int WINAPI SetI18DlgStrs(const char *section, HWND hDlgWnd,
 				   const DlgTextInfo *infos, size_t infoCount, const char *UILanguageFile)
 {
 	size_t i;
+	int translatedCount = 0;
+
 	assert(hDlgWnd != NULL);
 	assert(infoCount > 0);
 	for (i = 0 ; i < infoCount; i++) {
 		const char *key = infos[i].key;
-		TCHAR uimsg[MAX_UIMSG];
+		TCHAR uimsg[MAX_UIMSG] = {0};  // \x83I\x81[\x83\x8B\x83[\x83\x8D\x82ŏ\x89\x8A\x{227B0B5}\x82Ă\xA8\x82\xAD
 		GetI18nStrT(section, key, uimsg, sizeof(uimsg), _T(""), UILanguageFile);
 		if (uimsg[0] != _T('\0')) {
 			const int nIDDlgItem = infos[i].nIDDlgItem;
@@ -131,8 +140,13 @@
 				assert(r != 0);
 			}
 			(void)r;
+
+			if (r)
+				translatedCount++;
 		}
 	}
+
+	return (translatedCount);
 }
 
 void WINAPI SetI18MenuStrs(const char *section, HMENU hMenu,

Modified: trunk/teraterm/common/i18n.h
===================================================================
--- trunk/teraterm/common/i18n.h	2019-09-18 14:14:24 UTC (rev 8183)
+++ trunk/teraterm/common/i18n.h	2019-09-18 14:21:48 UTC (rev 8184)
@@ -51,7 +51,7 @@
 #endif
 DllExport void WINAPI GetI18nStr(const char *section, const char *key, PCHAR buf, int buf_len, const char *def, const char *iniFile);
 DllExport int WINAPI GetI18nLogfont(const char *section, const char *key, PLOGFONTA logfont, int ppi, const char *iniFile);
-DllExport void WINAPI SetI18DlgStrs(const char *section, HWND hDlgWnd,
+DllExport int WINAPI SetI18DlgStrs(const char *section, HWND hDlgWnd,
 							 const DlgTextInfo *infos, size_t infoCount, const char *UILanguageFile);
 DllExport void WINAPI SetI18MenuStrs(const char *section, HMENU hMenu,
 							  const DlgTextInfo *infos, size_t infoCount, const char *UILanguageFile);

Modified: trunk/teraterm/common/ttlib.c
===================================================================
--- trunk/teraterm/common/ttlib.c	2019-09-18 14:14:24 UTC (rev 8183)
+++ trunk/teraterm/common/ttlib.c	2019-09-18 14:21:48 UTC (rev 8184)
@@ -1821,9 +1821,9 @@
 	return TRUE;
 }
 
-void SetDlgTexts(HWND hDlgWnd, const DlgTextInfo *infos, int infoCount, const char *UILanguageFile)
+int SetDlgTexts(HWND hDlgWnd, const DlgTextInfo *infos, int infoCount, const char *UILanguageFile)
 {
-	SetI18DlgStrs("Tera Term", hDlgWnd, infos, infoCount, UILanguageFile);
+	return SetI18DlgStrs("Tera Term", hDlgWnd, infos, infoCount, UILanguageFile);
 }
 
 void SetDlgMenuTexts(HMENU hMenu, const DlgTextInfo *infos, int infoCount, const char *UILanguageFile)

Modified: trunk/teraterm/common/ttlib.h
===================================================================
--- trunk/teraterm/common/ttlib.h	2019-09-18 14:14:24 UTC (rev 8183)
+++ trunk/teraterm/common/ttlib.h	2019-09-18 14:21:48 UTC (rev 8184)
@@ -122,7 +122,7 @@
 
 #define CheckFlag(var, flag)	(((var) & (flag)) != 0)
 
-void SetDlgTexts(HWND hDlgWnd, const DlgTextInfo *infos, int infoCount, const char *UILanguageFile);
+int SetDlgTexts(HWND hDlgWnd, const DlgTextInfo *infos, int infoCount, const char *UILanguageFile);
 void SetDlgMenuTexts(HMENU hMenu, const DlgTextInfo *infos, int infoCount, const char *UILanguageFile);
 int GetMonitorDpiFromWindow(HWND hWnd);
 


Ttssh2-commit メーリングリストの案内
Back to archive index