[Ttssh2-commit] [3359] 複数のif文を一つにまとめた / switchで書き直した

svnno****@sourc***** svnno****@sourc*****
2009年 4月 29日 (水) 03:15:20 JST


Revision: 3359
          http://svn.sourceforge.jp/view?root=ttssh2&view=rev&rev=3359
Author:   doda
Date:     2009-04-29 03:15:20 +0900 (Wed, 29 Apr 2009)

Log Message:
-----------
複数のif文を一つにまとめた/switchで書き直した

Modified Paths:
--------------
    trunk/teraterm/teraterm/vtwin.cpp
    trunk/teraterm/ttpdlg/ttdlg.c
    trunk/teraterm/ttpset/ttset.c


-------------- next part --------------
Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2009-04-28 17:16:59 UTC (rev 3358)
+++ trunk/teraterm/teraterm/vtwin.cpp	2009-04-28 18:15:20 UTC (rev 3359)
@@ -1433,10 +1433,8 @@
 /* called by the [Setup] Terminal command */
 void CVTWindow::SetupTerm()
 {
-	if (ts.Language==IdJapanese)
+	if (ts.Language==IdJapanese || ts.Language==IdKorean)
 		ResetCharSet();
-	if (ts.Language==IdKorean)  // HKS
-		ResetCharSet();
 	cv.CRSend = ts.CRSend;
 
 	// for russian mode

Modified: trunk/teraterm/ttpdlg/ttdlg.c
===================================================================
--- trunk/teraterm/ttpdlg/ttdlg.c	2009-04-28 17:16:59 UTC (rev 3358)
+++ trunk/teraterm/ttpdlg/ttdlg.c	2009-04-28 18:15:20 UTC (rev 3359)
@@ -2881,14 +2881,19 @@
 {
 	int i;
 
-	if (ts->Language==IdJapanese) // Japanese mode
+	switch (ts->Language) {
+	case IdJapanese: // Japanese mode
 		i = IDD_TERMDLGJ;
-	else if (ts->Language==IdRussian) // Russian mode
+		break;
+	case IdKorean: // Russian mode
+		i = IDD_TERMDLGK;
+		break;
+	case IdRussian: // Korean mode //HKS
 		i = IDD_TERMDLGR;
-	else if (ts->Language==IdKorean) // Korean mode //HKS
-		i = IDD_TERMDLGK;
-	else
+		break;
+	default:  // English mode
 		i = IDD_TERMDLG;
+	}
 
 	return
 		(BOOL)DialogBoxParam(hInst,

Modified: trunk/teraterm/ttpset/ttset.c
===================================================================
--- trunk/teraterm/ttpset/ttset.c	2009-04-28 17:16:59 UTC (rev 3358)
+++ trunk/teraterm/ttpset/ttset.c	2009-04-28 18:15:20 UTC (rev 3359)
@@ -1282,14 +1282,20 @@
 	WritePrivateProfileString(Section, "Version", "2.3", FName);
 
 	/* Language */
-	if (ts->Language == IdJapanese)
+	switch (ts->Language) {
+	case IdJapanese:
 		strncpy_s(Temp, sizeof(Temp), "Japanese", _TRUNCATE);
-	else if (ts->Language == IdRussian)
-		strncpy_s(Temp, sizeof(Temp), "Russian", _TRUNCATE);
-	else if (ts->Language == IdKorean) //HKS
-		strncpy_s(Temp, sizeof(Temp), "Korean", _TRUNCATE);
-	else
-		strncpy_s(Temp, sizeof(Temp), "English", _TRUNCATE);
+		break;
+	case IdKorean:
+	  	strncpy_s(Temp, sizeof(Temp), "Korean",   _TRUNCATE);
+		break;
+	case IdRussian:
+	  	strncpy_s(Temp, sizeof(Temp), "Russian",  _TRUNCATE);
+		break;
+	default:
+	  	strncpy_s(Temp, sizeof(Temp), "English",  _TRUNCATE);
+	}
+
 	WritePrivateProfileString(Section, "Language", Temp, FName);
 
 	/* Port type */



Ttssh2-commit メーリングリストの案内