[Ttssh2-commit] [6595] 改行の正規化

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2017年 2月 21日 (火) 03:46:41 JST


Revision: 6595
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6595
Author:   doda
Date:     2017-02-21 03:46:41 +0900 (Tue, 21 Feb 2017)
Log Message:
-----------
改行の正規化
ticket:36721

Modified Paths:
--------------
    trunk/doc/en/html/about/history.html
    trunk/doc/en/html/menu/setup-additional.html
    trunk/doc/ja/html/about/history.html
    trunk/doc/ja/html/menu/setup-additional.html
    trunk/installer/release/TERATERM.INI
    trunk/installer/release/lang/English.lng
    trunk/installer/release/lang/French.lng
    trunk/installer/release/lang/German.lng
    trunk/installer/release/lang/Japanese.lng
    trunk/installer/release/lang/Korean.lng
    trunk/installer/release/lang/Russian.lng
    trunk/installer/release/lang/Simplified Chinese.lng
    trunk/installer/release/lang/Traditional Chinese.lng
    trunk/teraterm/common/tt_res.h
    trunk/teraterm/common/tttypes.h
    trunk/teraterm/teraterm/addsetting.cpp
    trunk/teraterm/teraterm/clipboar.c
    trunk/teraterm/teraterm/ttermpro.rc
    trunk/teraterm/ttpset/ttset.c

-------------- next part --------------
Modified: trunk/doc/en/html/about/history.html
===================================================================
--- trunk/doc/en/html/about/history.html	2017-02-20 18:46:35 UTC (rev 6594)
+++ trunk/doc/en/html/about/history.html	2017-02-20 18:46:41 UTC (rev 6595)
@@ -36,6 +36,10 @@
   <li>Changes
     <ul>
       <li>added `&amp;u' parameter to log file name that can convert the logon user name.</li>
+      <!-- li>\x93\\x82\xE8\x95t\x82\xAF\x8E\x9E\x82ɉ\xFC\x8Ds\x82𐳋K\x89\xBB\x82\xB7\x82\xE9\x8B@\x94\\x82\xF0\x92lj\xC1\x82\xB5\x82\xBD\x81B\x83f\x83t\x83H\x83\x8B\x83g\x82ł͖\xB3\x8C\xF8\x81B
+        <ul>
+          <li><a href="../menu/setup-additional.html#NormalizeLineBreak">Additional settings\x83_\x83C\x83A\x83\x8D\x83O</a>\x82\xCCCopy and Paste \x83^\x83u\x82Őݒ\xE8\x82\xF0\x97L\x8C\xF8\x89\xBB\x82ł\xAB\x82\xE9\x82悤\x82ɂ\xB5\x82\xBD\x81B</li>
+        </ul></li -->
     </ul>
   </li>
 

Modified: trunk/doc/en/html/menu/setup-additional.html
===================================================================
--- trunk/doc/en/html/menu/setup-additional.html	2017-02-20 18:46:35 UTC (rev 6594)
+++ trunk/doc/en/html/menu/setup-additional.html	2017-02-20 18:46:41 UTC (rev 6595)
@@ -190,6 +190,11 @@
 	Remove trailing new line character when pasting.
       </dd>
 
+      <dt id="NormalizeLineBreak">Normalize line break when pasting</dt>
+      <!-- dd>
+        \x93\\x82\xE8\x95t\x82\xAF\x8E\x9E\x82ɉ\xFC\x8Ds\x82𐳋K\x89\xBB\x82\xB5\x82܂\xB7\x81B\x83N\x83\x8A\x83b\x83v\x83{\x81[\x83h\x82̓\xE0\x97e\x82̉\xFC\x8Ds\x82\xAA CR \x82\xE2 LF \x82\xBE\x82\xC1\x82\xBD\x8E\x9E\x82ɁA\x82\xB7\x82ׂ\xC4 CR+LF \x82ɕϊ\xB7\x82\xB5\x82܂\xB7\x81B
+      </dd -->
+
       <dt id="ConfirmChangePaste">Confirm change paste</dt>
       <dd>
 	When the Clipboard includes CR/LF, the confirmation

Modified: trunk/doc/ja/html/about/history.html
===================================================================
--- trunk/doc/ja/html/about/history.html	2017-02-20 18:46:35 UTC (rev 6594)
+++ trunk/doc/ja/html/about/history.html	2017-02-20 18:46:41 UTC (rev 6595)
@@ -36,6 +36,10 @@
   <li>\x95ύX
     <ul>
       <li>\x83\x8D\x83O\x83t\x83@\x83C\x83\x8B\x96\xBC\x92\x86\x82\xCC &amp;u \x82\xF0\x81A\x83\x8D\x83O\x83I\x83\x93\x92\x86\x82̃\x86\x81[\x83U\x96\xBC\x82ɕϊ\xB7\x82\xB7\x82\xE9\x8B@\x94\\x82\xF0\x92lj\xC1\x82\xB5\x82\xBD\x81B</li>
+      <li>\x93\\x82\xE8\x95t\x82\xAF\x8E\x9E\x82ɉ\xFC\x8Ds\x82𐳋K\x89\xBB\x82\xB7\x82\xE9\x8B@\x94\\x82\xF0\x92lj\xC1\x82\xB5\x82\xBD\x81B\x83f\x83t\x83H\x83\x8B\x83g\x82ł͖\xB3\x8C\xF8\x81B
+        <ul>
+          <li><a href="../menu/setup-additional.html#NormalizeLineBreak">Additional settings\x83_\x83C\x83A\x83\x8D\x83O</a>\x82\xCCCopy and Paste \x83^\x83u\x82Őݒ\xE8\x82\xF0\x97L\x8C\xF8\x89\xBB\x82ł\xAB\x82\xE9\x82悤\x82ɂ\xB5\x82\xBD\x81B</li>
+        </ul></li>
     </ul>
   </li>
 

Modified: trunk/doc/ja/html/menu/setup-additional.html
===================================================================
--- trunk/doc/ja/html/menu/setup-additional.html	2017-02-20 18:46:35 UTC (rev 6594)
+++ trunk/doc/ja/html/menu/setup-additional.html	2017-02-20 18:46:41 UTC (rev 6595)
@@ -188,6 +188,11 @@
 	\x93\\x82\xE8\x95t\x82\xAF\x8E\x9E\x82ɖ\x96\x94\xF6\x82̉\xFC\x8Ds\x82\xF0\x8D폜\x82\xB7\x82\xE9\x81B
       </dd>
 
+      <dt id="NormalizeLineBreak">Normalize line break when pasting</dt>
+      <dd>
+	\x93\\x82\xE8\x95t\x82\xAF\x8E\x9E\x82ɉ\xFC\x8Ds\x82𐳋K\x89\xBB\x82\xB5\x82܂\xB7\x81B\x83N\x83\x8A\x83b\x83v\x83{\x81[\x83h\x82̓\xE0\x97e\x82̉\xFC\x8Ds\x82\xAA CR \x82\xE2 LF \x82\xBE\x82\xC1\x82\xBD\x8E\x9E\x82ɁA\x82\xB7\x82ׂ\xC4 CR+LF \x82ɕϊ\xB7\x82\xB5\x82܂\xB7\x81B
+      </dd>
+
       <dt id="ConfirmChangePaste">Confirm change paste</dt>
       <dd>
 	\x83N\x83\x8A\x83b\x83v\x83{\x81[\x83h\x82ɉ\xFC\x8Ds\x83R\x81[\x83h(CR/LF)\x82\xF0\x8A܂ޏꍇ\x81A\x83}\x83E\x83X\x82̉E\x83N\x83\x8A\x83b\x83N\x82\xA8\x82\xE6\x82\xD1Alt+V\x82\xC5

Modified: trunk/installer/release/TERATERM.INI
===================================================================
--- trunk/installer/release/TERATERM.INI	2017-02-20 18:46:35 UTC (rev 6594)
+++ trunk/installer/release/TERATERM.INI	2017-02-20 18:46:41 UTC (rev 6595)
@@ -559,6 +559,9 @@
 ; Nonblinking cursor
 NonblinkingCursor=off
 
+; Normalize line break when pasting
+NormalizeLineBreakOnPaste=off
+
 ; Polygon cursor for KILLFOCUS
 KillFocusCursor=on
 

Modified: trunk/installer/release/lang/English.lng
===================================================================
--- trunk/installer/release/lang/English.lng	2017-02-20 18:46:35 UTC (rev 6594)
+++ trunk/installer/release/lang/English.lng	2017-02-20 18:46:41 UTC (rev 6595)
@@ -202,6 +202,7 @@
 DLG_TAB_COPYPASTE_MOUSEPASTEM=Disable mouse &M button paste
 DLG_TAB_COPYPASTE_SELECTLBUTTON=Select &only by L button
 DLG_TAB_COPYPASTE_TRIM_TRAILING_NL=&Trim trailing new line character when pasting
+DLG_TAB_COPYPASTE_NORMALIZE_LINEBREAK=&Normalize line break when pasting
 DLG_TAB_COPYPASTE_CONFIRM_CHANGE_PASTE=Confirm change &paste
 DLG_TAB_CONFIRM_STRING_FILE=&String file
 DLG_TAB_COPYPASTE_DELIMITER=Del&imiter characters

Modified: trunk/installer/release/lang/French.lng
===================================================================
--- trunk/installer/release/lang/French.lng	2017-02-20 18:46:35 UTC (rev 6594)
+++ trunk/installer/release/lang/French.lng	2017-02-20 18:46:41 UTC (rev 6595)
@@ -203,6 +203,7 @@
 DLG_TAB_COPYPASTE_MOUSEPASTEM=Interdire coller avec molette
 DLG_TAB_COPYPASTE_SELECTLBUTTON=Selection seulement avec bouton G
 DLG_TAB_COPYPASTE_TRIM_TRAILING_NL=&Trim trailing new line character when pasting
+DLG_TAB_COPYPASTE_NORMALIZE_LINEBREAK=&Normalize line break when pasting
 DLG_TAB_COPYPASTE_CONFIRM_CHANGE_PASTE=Confirmer changer coller
 DLG_TAB_CONFIRM_STRING_FILE=Fichier cha\xEEne
 DLG_TAB_COPYPASTE_DELIMITER=Caract\xE8res d\xE9limiteurs

Modified: trunk/installer/release/lang/German.lng
===================================================================
--- trunk/installer/release/lang/German.lng	2017-02-20 18:46:35 UTC (rev 6594)
+++ trunk/installer/release/lang/German.lng	2017-02-20 18:46:41 UTC (rev 6595)
@@ -203,6 +203,7 @@
 DLG_TAB_COPYPASTE_MOUSEPASTEM=Einf\xFCgen mit mittlerer Maustaste ein
 DLG_TAB_COPYPASTE_SELECTLBUTTON=&Auswahl nur \xFCber Button
 DLG_TAB_COPYPASTE_TRIM_TRAILING_NL=&Trim trailing new line character when pasting
+DLG_TAB_COPYPASTE_NORMALIZE_LINEBREAK=&Normalize line break when pasting
 DLG_TAB_COPYPASTE_CONFIRM_CHANGE_PASTE=Confirm change &paste
 DLG_TAB_CONFIRM_STRING_FILE=&String file
 DLG_TAB_COPYPASTE_DELIMITER=&Begrenzungszeichen

Modified: trunk/installer/release/lang/Japanese.lng
===================================================================
--- trunk/installer/release/lang/Japanese.lng	2017-02-20 18:46:35 UTC (rev 6594)
+++ trunk/installer/release/lang/Japanese.lng	2017-02-20 18:46:41 UTC (rev 6595)
@@ -202,6 +202,7 @@
 DLG_TAB_COPYPASTE_MOUSEPASTEM=\x92\x86\x83N\x83\x8A\x83b\x83N\x82ł̓\\x82\xE8\x95t\x82\xAF\x82𖳌\xF8\x82ɂ\xB7\x82\xE9(&M)
 DLG_TAB_COPYPASTE_SELECTLBUTTON=\x8D\xB6\x83N\x83\x8A\x83b\x83N\x82ł̂ݑI\x91\xF0\x82\xF0\x8AJ\x8En\x82\xB7\x82\xE9(&O)
 DLG_TAB_COPYPASTE_TRIM_TRAILING_NL=\x93\\x82\xE8\x95t\x82\xAF\x8E\x9E\x82ɖ\x96\x94\xF6\x82̉\xFC\x8Ds\x82\xF0\x8D폜\x82\xB7\x82\xE9(&T)
+DLG_TAB_COPYPASTE_NORMALIZE_LINEBREAK=\x93\\x82\xE8\x95t\x82\xAF\x8E\x9E\x82ɉ\xFC\x8Ds\x82𐳋K\x89\xBB\x82\xB7\x82\xE9(&N)
 DLG_TAB_COPYPASTE_CONFIRM_CHANGE_PASTE=\x8A댯\x82ȃN\x83\x8A\x83b\x83v\x83{\x81[\x83h\x82̓\\x82\xE8\x95t\x82\xAF\x82\xF0\x8Am\x94F\x82\xB7\x82\xE9(&P)
 DLG_TAB_CONFIRM_STRING_FILE=\x83L\x81[\x83\x8F\x81[\x83h\x83t\x83@\x83C\x83\x8B(&S)
 DLG_TAB_COPYPASTE_DELIMITER=\x8B\xE6\x90؂蕶\x8E\x9A(&I)

Modified: trunk/installer/release/lang/Korean.lng
===================================================================
--- trunk/installer/release/lang/Korean.lng	2017-02-20 18:46:35 UTC (rev 6594)
+++ trunk/installer/release/lang/Korean.lng	2017-02-20 18:46:41 UTC (rev 6595)
@@ -203,6 +203,7 @@
 DLG_TAB_COPYPASTE_MOUSEPASTEM=\xB8\xB6\xBF콺 \xB0\xA1\xBF \xB9\xF6ư \xBAٿ\xA9\xB3ֱ\xE2 \xBA\xF1Ȱ\xBC\xBAȭ(&M)
 DLG_TAB_COPYPASTE_SELECTLBUTTON=\xB8\xB6\xBF콺 \xBF\xDE\xC2\xCA \xB9\xF6ư\xBF\xA1 \xC0\xC7\xC7ؼ\xAD\xB8\xB8 \xBC\xB1\xC5\xC3(&O)
 DLG_TAB_COPYPASTE_TRIM_TRAILING_NL=&Trim trailing new line character when pasting
+DLG_TAB_COPYPASTE_NORMALIZE_LINEBREAK=&Normalize line break when pasting
 DLG_TAB_COPYPASTE_CONFIRM_CHANGE_PASTE=\xBA\xAF\xB0\xE6-\xBAٿ\xA9\xB3ֱ\xE2 Ȯ\xC0\xCE(&P)
 DLG_TAB_CONFIRM_STRING_FILE=\xB9\xAE\xC0ڿ\xAD \xC6\xC4\xC0\xCF(&S)
 DLG_TAB_COPYPASTE_DELIMITER=\xB1\xB8\xBA\xD0\xC0\xDA \xB9\xAE\xC0\xDA(&I)

Modified: trunk/installer/release/lang/Russian.lng
===================================================================
--- trunk/installer/release/lang/Russian.lng	2017-02-20 18:46:35 UTC (rev 6594)
+++ trunk/installer/release/lang/Russian.lng	2017-02-20 18:46:41 UTC (rev 6595)
@@ -203,6 +203,7 @@
 DLG_TAB_COPYPASTE_MOUSEPASTEM=&\xCE\xF2\xEA\xEB\xFE\xF7\xE8\xF2\xFC \xE2\xF1\xF2\xE0\xE2\xEA\xF3 \xF1\xF0\xE5\xE4\xED\xE5\xE9 \xEA\xED\xEE\xEF\xEA\xEE\xE9 \xEC\xFB\xF8\xE8
 DLG_TAB_COPYPASTE_SELECTLBUTTON=&\xC8\xF1\xEF\xEE\xEB\xFC\xE7\xEE\xE2\xE0\xF2\xFC \xF2\xEE\xEB\xFC\xEA\xEE \xEB\xE5\xE2\xF3\xFE \xEA\xED\xEE\xEF\xEA\xF3 \xEC\xFB\xF8\xE8
 DLG_TAB_COPYPASTE_TRIM_TRAILING_NL=&Trim trailing new line character when pasting
+DLG_TAB_COPYPASTE_NORMALIZE_LINEBREAK=&Normalize line break when pasting
 DLG_TAB_COPYPASTE_CONFIRM_CHANGE_PASTE=&\xD0\xE0\xE7\xF0\xE5\xF8\xE8\xF2\xFC \xE2\xF1\xF2\xE0\xE2\xEA\xF3 \xE8\xE7\xEC\xE5\xED\xE5\xED\xE8\xFF
 DLG_TAB_CONFIRM_STRING_FILE=&\xD2\xE5\xEA\xF1\xF2\xEE\xE2\xFB\xE9 \xF4\xE0\xE9\xEB
 DLG_TAB_COPYPASTE_DELIMITER=&\xD0\xE0\xE7\xE4\xE5\xEB\xE8\xF2\xE5\xEB\xFC \xF1\xE8\xEC\xE2\xEE\xEB\xEE\xE2

Modified: trunk/installer/release/lang/Simplified Chinese.lng
===================================================================
--- trunk/installer/release/lang/Simplified Chinese.lng	2017-02-20 18:46:35 UTC (rev 6594)
+++ trunk/installer/release/lang/Simplified Chinese.lng	2017-02-20 18:46:41 UTC (rev 6595)
@@ -203,6 +203,7 @@
 DLG_TAB_COPYPASTE_MOUSEPASTEM=\xBD\xFB\xD3\xC3\xD6м\xFC\xB5\xA5\xBB\xF7ճ\xCC\xF9(&M)
 DLG_TAB_COPYPASTE_SELECTLBUTTON=\xBD\xF6\xD3\xC3\xCA\xF3\xB1\xEA\xD7\xF3\xBC\xFC(&O)
 DLG_TAB_COPYPASTE_TRIM_TRAILING_NL=&Trim trailing new line character when pasting
+DLG_TAB_COPYPASTE_NORMALIZE_LINEBREAK=&Normalize line break when pasting
 DLG_TAB_COPYPASTE_CONFIRM_CHANGE_PASTE=\xA1\xB0Σ\xCF\xD5ճ\xCC\xF9\xBC\xF4\xCC\xF9\xB0塱ȷ\xC8\xCF(&P)
 DLG_TAB_CONFIRM_STRING_FILE=\xB9ؼ\xFC\xD7\xD6\xCEļ\xFE(&S)
 DLG_TAB_COPYPASTE_DELIMITER=\xB7ָ\xF4\xB7\xFB(&I)

Modified: trunk/installer/release/lang/Traditional Chinese.lng
===================================================================
--- trunk/installer/release/lang/Traditional Chinese.lng	2017-02-20 18:46:35 UTC (rev 6594)
+++ trunk/installer/release/lang/Traditional Chinese.lng	2017-02-20 18:46:41 UTC (rev 6595)
@@ -203,6 +203,7 @@
 DLG_TAB_COPYPASTE_MOUSEPASTEM=\xB8T\xA5Τ\xA4\xC1\xE4\xB3\xE6\xC0\xBB\xB6K\xA4W(&M)
 DLG_TAB_COPYPASTE_SELECTLBUTTON=\xB6ȥηƹ\xAB\xA5\xAA\xC1\xE4(&O)
 DLG_TAB_COPYPASTE_TRIM_TRAILING_NL=&Trim trailing new line character when pasting
+DLG_TAB_COPYPASTE_NORMALIZE_LINEBREAK=&Normalize line break when pasting
 DLG_TAB_COPYPASTE_CONFIRM_CHANGE_PASTE=\xA1uĵ\xA7i\xB6K\xA4W\xB0ŶKï\xA1v\xBDT\xBB{(&P)
 DLG_TAB_CONFIRM_STRING_FILE=\xC3\xF6\xC1\xE4\xA6r\xA4\xE5\xA5\xF3(&S)
 DLG_TAB_COPYPASTE_DELIMITER=\xA4\xC0\xB9j\xB2\xC5(&I)

Modified: trunk/teraterm/common/tt_res.h
===================================================================
--- trunk/teraterm/common/tt_res.h	2017-02-20 18:46:35 UTC (rev 6594)
+++ trunk/teraterm/common/tt_res.h	2017-02-20 18:46:41 UTC (rev 6595)
@@ -214,6 +214,7 @@
 #define IDC_SSH_SETUPDIR_STATIC_VSTORE  2562
 #define IDC_SSH_SETUPDIR_EDIT_VSTORE    2563
 #define IDC_TRIMNLCHAR                  2564
+#define IDC_NORMALIZE_LINEBREAK         2565
 #define ID_ACC_SENDBREAK                50001
 #define ID_ACC_COPY                     50002
 #define ID_ACC_NEWCONNECTION            50003
@@ -311,7 +312,7 @@
 #define _APS_NO_MFC                     1
 #define _APS_NEXT_RESOURCE_VALUE        126
 #define _APS_NEXT_COMMAND_VALUE         52031
-#define _APS_NEXT_CONTROL_VALUE         2565
+#define _APS_NEXT_CONTROL_VALUE         2566
 #define _APS_NEXT_SYMED_VALUE           101
 #endif
 #endif

Modified: trunk/teraterm/common/tttypes.h
===================================================================
--- trunk/teraterm/common/tttypes.h	2017-02-20 18:46:35 UTC (rev 6594)
+++ trunk/teraterm/common/tttypes.h	2017-02-20 18:46:41 UTC (rev 6595)
@@ -298,6 +298,7 @@
 #define CPF_CONFIRM_CHANGEPASTE    0x0010
 #define CPF_CONFIRM_CHANGEPASTE_CR 0x0020
 #define CPF_TRIM_TRAILING_NL       0x0100
+#define CPF_NORMALIZE_LINEBREAK    0x0200
 
 // Title Reporting Type
 #define IdTitleReportIgnore 0
@@ -1085,6 +1086,9 @@
  * Increment the number of this macro value
  * when you change TMap or member of TMap.
  *
+ * - At version 4.94, ttset_memfilemap was replaced with ttset_memfilemap_30.
+ *   paste related settings are integrated into tttset.PasteFlag
+ *
  * - At version 4.92, ttset_memfilemap was replaced with ttset_memfilemap_29.
  *   added tttset.TrimTrailingNLonPaste
  *
@@ -1260,4 +1264,4 @@
  *   added tttset.VTCompatTab.
  */
 
-#define TT_FILEMAPNAME "ttset_memfilemap_29"
+#define TT_FILEMAPNAME "ttset_memfilemap_30"

Modified: trunk/teraterm/teraterm/addsetting.cpp
===================================================================
--- trunk/teraterm/teraterm/addsetting.cpp	2017-02-20 18:46:35 UTC (rev 6594)
+++ trunk/teraterm/teraterm/addsetting.cpp	2017-02-20 18:46:41 UTC (rev 6595)
@@ -498,6 +498,7 @@
 		SendDlgItemMessage(IDC_DISABLE_PASTE_MBUTTON, WM_SETFONT, (WPARAM)DlgCopypasteFont, MAKELPARAM(TRUE,0));
 		SendDlgItemMessage(IDC_SELECT_LBUTTON, WM_SETFONT, (WPARAM)DlgCopypasteFont, MAKELPARAM(TRUE,0));
 		SendDlgItemMessage(IDC_TRIMNLCHAR, WM_SETFONT, (WPARAM)DlgCopypasteFont, MAKELPARAM(TRUE,0));
+		SendDlgItemMessage(IDC_NORMALIZE_LINEBREAK, WM_SETFONT, (WPARAM)DlgCopypasteFont, MAKELPARAM(TRUE,0));
 		SendDlgItemMessage(IDC_CONFIRM_CHANGE_PASTE, WM_SETFONT, (WPARAM)DlgCopypasteFont, MAKELPARAM(TRUE,0));
 		SendDlgItemMessage(IDC_CONFIRM_STRING_FILE_LABEL, WM_SETFONT, (WPARAM)DlgCopypasteFont, MAKELPARAM(TRUE,0));
 		SendDlgItemMessage(IDC_CONFIRM_STRING_FILE, WM_SETFONT, (WPARAM)DlgCopypasteFont, MAKELPARAM(TRUE,0));
@@ -530,6 +531,9 @@
 	GetDlgItemText(IDC_TRIMNLCHAR, uimsg, sizeof(uimsg));
 	get_lang_msg("DLG_TAB_COPYPASTE_TRIM_TRAILING_NL", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
 	SetDlgItemText(IDC_TRIMNLCHAR, ts.UIMsg);
+	GetDlgItemText(IDC_NORMALIZE_LINEBREAK, uimsg, sizeof(uimsg));
+	get_lang_msg("DLG_TAB_COPYPASTE_NORMALIZE_LINEBREAK", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
+	SetDlgItemText(IDC_NORMALIZE_LINEBREAK, ts.UIMsg);
 	GetDlgItemText(IDC_CONFIRM_CHANGE_PASTE, uimsg, sizeof(uimsg));
 	get_lang_msg("DLG_TAB_COPYPASTE_CONFIRM_CHANGE_PASTE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
 	SetDlgItemText(IDC_CONFIRM_CHANGE_PASTE, ts.UIMsg);
@@ -576,7 +580,11 @@
 	btn = (CButton *)GetDlgItem(IDC_TRIMNLCHAR);
 	btn->SetCheck((ts.PasteFlag & CPF_TRIM_TRAILING_NL)?BST_CHECKED:BST_UNCHECKED);
 
-	// (7)ConfirmChangePaste
+	// (7)NormalizeLineBreak
+	btn = (CButton *)GetDlgItem(IDC_NORMALIZE_LINEBREAK);
+	btn->SetCheck((ts.PasteFlag & CPF_NORMALIZE_LINEBREAK)?BST_CHECKED:BST_UNCHECKED);
+
+	// (8)ConfirmChangePaste
 	btn = (CButton *)GetDlgItem(IDC_CONFIRM_CHANGE_PASTE);
 	btn->SetCheck((ts.PasteFlag & CPF_CONFIRM_CHANGEPASTE)?BST_CHECKED:BST_UNCHECKED);
 
@@ -592,10 +600,10 @@
 		btn->EnableWindow(FALSE);
 	}
 
-	// (8)delimiter characters
+	// (9)delimiter characters
 	SetDlgItemText(IDC_DELIM_LIST, ts.DelimList);
 
-	// (9)PasteDelayPerLine
+	// (10)PasteDelayPerLine
 	_snprintf_s(buf, sizeof(buf), "%d", ts.PasteDelayPerLine);
 	SetDlgItemText(IDC_PASTEDELAY_EDIT, buf);
 
@@ -711,7 +719,16 @@
 		ts.PasteFlag &= ~CPF_TRIM_TRAILING_NL;
 	}
 
-	// (7)IDC_CONFIRM_CHANGE_PASTE
+	// (7)
+	btn = (CButton *)GetDlgItem(IDC_NORMALIZE_LINEBREAK);
+	if (btn->GetCheck()) {
+		ts.PasteFlag |= CPF_NORMALIZE_LINEBREAK;
+	}
+	else {
+		ts.PasteFlag &= ~CPF_NORMALIZE_LINEBREAK;
+	}
+
+	// (8)IDC_CONFIRM_CHANGE_PASTE
 	btn = (CButton *)GetDlgItem(IDC_CONFIRM_CHANGE_PASTE);
 	if (btn->GetCheck()) {
 		ts.PasteFlag |= CPF_CONFIRM_CHANGEPASTE;
@@ -721,10 +738,10 @@
 	}
 	GetDlgItemText(IDC_CONFIRM_STRING_FILE, ts.ConfirmChangePasteStringFile, sizeof(ts.ConfirmChangePasteStringFile));
 
-	// (8)
+	// (9)
 	GetDlgItemText(IDC_DELIM_LIST, ts.DelimList, sizeof(ts.DelimList));
 
-	// (9)
+	// (10)
 	GetDlgItemText(IDC_PASTEDELAY_EDIT, buf, sizeof(buf));
 	val = atoi(buf);
 	ts.PasteDelayPerLine = min(max(0, val), 5000);

Modified: trunk/teraterm/teraterm/clipboar.c
===================================================================
--- trunk/teraterm/teraterm/clipboar.c	2017-02-20 18:46:35 UTC (rev 6594)
+++ trunk/teraterm/teraterm/clipboar.c	2017-02-20 18:46:41 UTC (rev 6595)
@@ -158,6 +158,96 @@
 	return TRUE;
 }
 
+// \x89\xFC\x8Ds\x82\xF0 CR+LF \x82ɐ\xB3\x8BK\x89\xBB\x82\xB7\x82\xE9
+BOOL NormalizeLineBreak(BOOL AddCR, BOOL Bracketed) {
+	char *p, *p2;
+	unsigned int len, need_len, alloc_len;
+	HGLOBAL TmpHandle;
+
+	if (!(ts.PasteFlag & CPF_NORMALIZE_LINEBREAK)) {
+		return TRUE;
+	}
+
+	p = CBMemPtr;
+
+	// \x93\\x82\xE8\x95t\x82\xAF\x83f\x81[\x83^\x82̒\xB7\x82\xB3(len)\x81A\x82\xA8\x82\xE6\x82ѐ\xB3\x8BK\x89\xBB\x8C\xE3\x82̃f\x81[\x83^\x82̒\xB7\x82\xB3(need_len)\x82̃J\x83E\x83\x93\x83g
+	for (len=0, need_len=0, p=CBMemPtr; *p != '\0'; p++, len++, need_len++) {
+		if (*p == CR) {
+			need_len++;
+			if (*(p+1) == LF) {
+				len++;
+				p++;
+			}
+		}
+		else if (*p == LF) {
+			need_len++;
+		}
+	}
+
+	// \x90\xB3\x8BK\x89\xBB\x8C\xE3\x82\xE0\x83f\x81[\x83^\x92\xB7\x82\xAA\x95ς\xED\x82\xE7\x82Ȃ\xA2 => \x90\xB3\x8BK\x89\xBB\x82͕K\x97v\x82Ȃ\xB5
+	if (need_len == len) {
+		return TRUE;
+	}
+
+	// AddCR / Bracketed \x82̎\x9E\x82͂\xBB\x82̕\xAA\x82̃o\x83b\x83t\x83@\x82\xE0\x8Cv\x8EZ\x82ɓ\xFC\x82\xEA\x82\xE9
+	// \x82\xA0\x82܂肱\x82\xB1\x82ł͂\xE2\x82肽\x82\xAD\x82Ȃ\xA2\x82񂾂\xAF\x82\xEA\x82\xC7
+	alloc_len = need_len + 1;
+	if (AddCR) {
+		alloc_len++;
+	}
+	if (Bracketed) {
+		// \x8E蔲\x82\xAB
+		alloc_len += 12;
+	}
+
+	// \x83o\x83b\x83t\x83@\x83T\x83C\x83Y\x82\xAA\x90\xB3\x8BK\x89\xBB\x8C\xE3\x82ɕK\x97v\x82ƂȂ\xE9\x92l\x82\xE6\x82菬\x82\xB3\x82\xA2\x8Fꍇ\x82̓o\x83b\x83t\x83@\x82\xF0\x8Am\x95ۂ\xB5\x92\xBC\x82\xB7
+	if (GlobalSize(CBMemHandle) < alloc_len) {
+		GlobalUnlock(CBMemHandle);
+		CBMemPtr = NULL;
+		if ((TmpHandle = GlobalReAlloc(CBMemHandle, alloc_len, 0)) == NULL) {
+			// \x83\x81\x83\x82\x83\x8A\x8DĊ\x84\x82蓖\x82Ď\xB8\x94s
+			CBMemPtr = GlobalLock(CBMemHandle);
+
+			// \x82Ƃ肠\x82\xA6\x82\xB8\x90\xB3\x8BK\x89\xBB\x82Ȃ\xB5\x82œ\\x82\xE8\x95t\x82\xAF\x82鎖\x82ɂ\xB7\x82\xE9
+			return TRUE;
+		}
+		CBMemHandle = TmpHandle;
+		CBMemPtr = GlobalLock(CBMemHandle);
+	}
+
+	p = CBMemPtr + len - 1;
+	p2 = CBMemPtr + need_len;
+	*p2-- = '\0';
+
+	while (len > 0 && p < p2) {
+		if (*p == LF) {
+			*p2-- = *p--;
+			if (--len == 0) {
+				*p2 = CR;
+				break;
+			}
+			if (*p != CR) {
+				*p2-- = CR;
+				if (p2 <= p) {
+					break;
+				}
+				else {
+					continue;
+				}
+			}
+		}
+		else if (*p == CR) {
+			*p2-- = LF;
+			if (p == p2)
+				break;
+		}
+		*p2-- = *p--;
+		len--;
+	}
+
+	return TRUE;
+}
+
 // \x83t\x83@\x83C\x83\x8B\x82ɒ\xE8\x8B`\x82\xB3\x82ꂽ\x95\xB6\x8E\x9A\x97񂪁Atext\x82Ɋ܂܂\xEA\x82邩\x82𒲂ׂ\xE9\x81B
 BOOL search_dict(char *filename, char *text)
 {
@@ -360,6 +450,11 @@
 		return;
 	}
 
+	if (!NormalizeLineBreak(AddCR, Bracketed)) {
+		CBEndPaste();
+		return;
+	}
+
 	if (!CheckClipboardContent(HWin, AddCR, Bracketed)) {
 		CBEndPaste();
 		return;

Modified: trunk/teraterm/teraterm/ttermpro.rc
===================================================================
--- trunk/teraterm/teraterm/ttermpro.rc	2017-02-20 18:46:35 UTC (rev 6594)
+++ trunk/teraterm/teraterm/ttermpro.rc	2017-02-20 18:46:41 UTC (rev 6595)
@@ -48,7 +48,7 @@
     EDITTEXT        IDC_EDIT_COMMENT,6,3,189,12,ES_AUTOHSCROLL
 END
 
-IDD_TABSHEET_GENERAL DIALOGEX 0, 0, 258, 158
+IDD_TABSHEET_GENERAL DIALOGEX 0, 0, 258, 188
 STYLE DS_SETFONT | DS_CONTROL | WS_CHILD | WS_SYSMENU
 FONT 8, "Tahoma", 0, 0, 0x0
 BEGIN
@@ -66,7 +66,7 @@
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,100,220,10
 END
 
-IDD_TABSHEET_SEQUENCE DIALOGEX 0, 0, 258, 158
+IDD_TABSHEET_SEQUENCE DIALOGEX 0, 0, 258, 188
 STYLE DS_SETFONT | DS_CONTROL | WS_CHILD | WS_SYSMENU
 FONT 8, "Tahoma", 0, 0, 0x0
 BEGIN
@@ -85,7 +85,7 @@
     COMBOBOX        IDC_CLIPBOARD_ACCESS,162,114,45,52,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
 END
 
-IDD_TABSHEET_COPYPASTE DIALOGEX 0, 0, 258, 158
+IDD_TABSHEET_COPYPASTE DIALOGEX 0, 0, 258, 188
 STYLE DS_SETFONT | DS_CONTROL | WS_CHILD | WS_SYSMENU
 FONT 8, "Tahoma", 0, 0, 0x0
 BEGIN
@@ -99,18 +99,20 @@
     CONTROL         "Select &only by L button",IDC_SELECT_LBUTTON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,70,200,10
     CONTROL         "&Trim trailing new line character when pasting",IDC_TRIMNLCHAR,
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,85,200,10
-    CONTROL         "Confirm change &paste",IDC_CONFIRM_CHANGE_PASTE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,100,200,10
-    LTEXT           "&String file",IDC_CONFIRM_STRING_FILE_LABEL,22,115,68,8
-    EDITTEXT        IDC_CONFIRM_STRING_FILE,95,113,106,12,ES_AUTOHSCROLL
-    PUSHBUTTON      "...",IDC_CONFIRM_STRING_FILE_PATH,206,113,13,12
-    LTEXT           "Del&imiter characters",IDC_DELIMITER,11,130,65,10
-    EDITTEXT        IDC_DELIM_LIST,95,128,130,12,ES_AUTOHSCROLL
-    LTEXT           "P&aste delay per line",IDC_PASTEDELAY_LABEL,11,145,70,10
-    EDITTEXT        IDC_PASTEDELAY_EDIT,95,143,24,12,ES_AUTOHSCROLL | ES_NUMBER
-    LTEXT           "ms",IDC_PASTEDELAY_LABEL2,123,145,23,10
+    CONTROL         "&Normalize line break when pasting",IDC_NORMALIZE_LINEBREAK,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,100,200,10
+    CONTROL         "Confirm change &paste",IDC_CONFIRM_CHANGE_PASTE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,115,200,10
+    LTEXT           "&String file",IDC_CONFIRM_STRING_FILE_LABEL,22,130,68,8
+    EDITTEXT        IDC_CONFIRM_STRING_FILE,95,128,106,12,ES_AUTOHSCROLL
+    PUSHBUTTON      "...",IDC_CONFIRM_STRING_FILE_PATH,206,128,13,12
+    LTEXT           "Del&imiter characters",IDC_DELIMITER,11,145,65,10
+    EDITTEXT        IDC_DELIM_LIST,95,143,130,12,ES_AUTOHSCROLL
+    LTEXT           "P&aste delay per line",IDC_PASTEDELAY_LABEL,11,160,70,10
+    EDITTEXT        IDC_PASTEDELAY_EDIT,95,158,24,12,ES_AUTOHSCROLL | ES_NUMBER
+    LTEXT           "ms",IDC_PASTEDELAY_LABEL2,123,160,23,10
 END
 
-IDD_TABSHEET_VISUAL DIALOGEX 0, 0, 258, 158
+IDD_TABSHEET_VISUAL DIALOGEX 0, 0, 258, 188
 STYLE DS_SETFONT | DS_CONTROL | WS_CHILD | WS_SYSMENU
 FONT 8, "Tahoma", 0, 0, 0x0
 BEGIN
@@ -149,7 +151,7 @@
     LTEXT           "(*)Need to Save setup and restart Tera Term",IDC_RESTART,5,147,247,8
 END
 
-IDD_TABSHEET_LOG DIALOGEX 0, 0, 258, 158
+IDD_TABSHEET_LOG DIALOGEX 0, 0, 258, 188
 STYLE DS_SETFONT | DS_CONTROL | WS_CHILD | WS_SYSMENU
 FONT 8, "Tahoma", 0, 0, 0x0
 BEGIN
@@ -178,7 +180,7 @@
     EDITTEXT        IDC_ROTATE_STEP,195,135,30,12,ES_AUTOHSCROLL
 END
 
-IDD_TABSHEET_CYGWIN DIALOGEX 0, 0, 258, 158
+IDD_TABSHEET_CYGWIN DIALOGEX 0, 0, 258, 188
 STYLE DS_SETFONT | DS_CONTROL | WS_CHILD | WS_SYSMENU
 FONT 8, "Tahoma", 0, 0, 0x0
 BEGIN
@@ -341,7 +343,7 @@
         LEFTMARGIN, 5
         RIGHTMARGIN, 252
         TOPMARGIN, 5
-        BOTTOMMARGIN, 155
+        BOTTOMMARGIN, 185
     END
 
     IDD_TABSHEET_SEQUENCE, DIALOG
@@ -349,7 +351,7 @@
         LEFTMARGIN, 5
         RIGHTMARGIN, 252
         TOPMARGIN, 5
-        BOTTOMMARGIN, 155
+        BOTTOMMARGIN, 185
     END
 
     IDD_TABSHEET_COPYPASTE, DIALOG
@@ -357,7 +359,7 @@
         LEFTMARGIN, 5
         RIGHTMARGIN, 252
         TOPMARGIN, 5
-        BOTTOMMARGIN, 155
+        BOTTOMMARGIN, 185
     END
 
     IDD_TABSHEET_VISUAL, DIALOG
@@ -365,7 +367,7 @@
         LEFTMARGIN, 5
         RIGHTMARGIN, 252
         TOPMARGIN, 5
-        BOTTOMMARGIN, 155
+        BOTTOMMARGIN, 185
     END
 
     IDD_TABSHEET_LOG, DIALOG
@@ -373,7 +375,7 @@
         LEFTMARGIN, 5
         RIGHTMARGIN, 252
         TOPMARGIN, 5
-        BOTTOMMARGIN, 155
+        BOTTOMMARGIN, 185
     END
 
     IDD_TABSHEET_CYGWIN, DIALOG
@@ -381,7 +383,7 @@
         LEFTMARGIN, 5
         RIGHTMARGIN, 252
         TOPMARGIN, 5
-        BOTTOMMARGIN, 155
+        BOTTOMMARGIN, 185
     END
 
     IDD_BROADCAST_DIALOG, DIALOG

Modified: trunk/teraterm/ttpset/ttset.c
===================================================================
--- trunk/teraterm/ttpset/ttset.c	2017-02-20 18:46:35 UTC (rev 6594)
+++ trunk/teraterm/ttpset/ttset.c	2017-02-20 18:46:41 UTC (rev 6595)
@@ -1923,6 +1923,10 @@
 	if (GetOnOff(Section, "TrimTrailingNLonPaste", FName, FALSE))
 		ts->PasteFlag |= CPF_TRIM_TRAILING_NL;
 
+	// Normalize line break when pasting
+	if (GetOnOff(Section, "NormalizeLineBreakOnPaste", FName, FALSE))
+		ts->PasteFlag |= CPF_NORMALIZE_LINEBREAK;
+
 	// CygTerm Configuration File
 	ReadCygtermConfFile(ts);
 }
@@ -3184,6 +3188,10 @@
 	WriteOnOff(Section, "TrimTrailingNLonPaste", FName,
 		(WORD) (ts->PasteFlag & CPF_TRIM_TRAILING_NL));
 
+	// Normalize line break when pasting
+	WriteOnOff(Section, "NormalizeLineBreakOnPaste", FName,
+		(WORD) (ts->PasteFlag & CPF_NORMALIZE_LINEBREAK));
+
 	// CygTerm Configuration File
 	WriteCygtermConfFile(ts);
 }



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