[Ttssh2-commit] [4100] Selective Erase で SGR 属性を消去しないようにした。

svnno****@sourc***** svnno****@sourc*****
2010年 9月 13日 (月) 15:36:24 JST


Revision: 4100
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4100
Author:   doda
Date:     2010-09-13 15:36:24 +0900 (Mon, 13 Sep 2010)

Log Message:
-----------
Selective Erase で SGR 属性を消去しないようにした。

Modified Paths:
--------------
    trunk/teraterm/common/tttypes.h
    trunk/teraterm/teraterm/buffer.c


-------------- next part --------------
Modified: trunk/teraterm/common/tttypes.h
===================================================================
--- trunk/teraterm/common/tttypes.h	2010-09-12 16:01:17 UTC (rev 4099)
+++ trunk/teraterm/common/tttypes.h	2010-09-13 06:36:24 UTC (rev 4100)
@@ -53,6 +53,7 @@
   /* Color attribute bit masks */
 #define Attr2Fore         0x01
 #define Attr2Back         0x02
+#define AttrSgrMask       (AttrBold | AttrUnder | AttrBlink | AttrReverse)
 #define AttrColorMask     (AttrBold | AttrBlink | AttrReverse)
 #define Attr2ColorMask    (Attr2Fore | Attr2Back)
 

Modified: trunk/teraterm/teraterm/buffer.c
===================================================================
--- trunk/teraterm/teraterm/buffer.c	2010-09-12 16:01:17 UTC (rev 4099)
+++ trunk/teraterm/teraterm/buffer.c	2010-09-13 06:36:24 UTC (rev 4100)
@@ -3293,10 +3293,7 @@
 		for (j = TmpPtr + offset; j < TmpPtr + NumOfColumns - offset; j++) {
 			if (!(AttrBuff2[j] & Attr2Protect)) {
 				CodeBuff[j] = 0x20;
-				AttrBuff[j] = AttrDefault;
-				AttrBuff2[j] = CurCharAttr.Attr2 & Attr2ColorMask;
-				AttrBuffFG[j] = CurCharAttr.Fore;
-				AttrBuffBG[j] = CurCharAttr.Back;
+				AttrBuff[j] &= AttrSgrMask;
 			}
 		}
 		offset = 0;
@@ -3334,10 +3331,7 @@
 		for (j = TmpPtr; j < TmpPtr + offset; j++) {
 			if (!(AttrBuff2[j] & Attr2Protect)) {
 				CodeBuff[j] = 0x20;
-				AttrBuff[j] = AttrDefault;
-				AttrBuff2[j] = CurCharAttr.Attr2 & Attr2ColorMask;
-				AttrBuffFG[j] = CurCharAttr.Fore;
-				AttrBuffBG[j] = CurCharAttr.Back;
+				AttrBuff[j] &= AttrSgrMask;
 			}
 		}
 		TmpPtr = NextLinePtr(TmpPtr);
@@ -3377,27 +3371,18 @@
 		    ((AttrBuff[Ptr+XStart-1] & AttrKanji) != 0) &&
 		    ((AttrBuff2[Ptr+XStart-1] & Attr2Protect) == 0)) {
 			CodeBuff[Ptr+XStart-1] = 0x20;
-			AttrBuff[Ptr+XStart-1] = CurCharAttr.Attr;
-			AttrBuff2[Ptr+XStart-1] = CurCharAttr.Attr2;
-			AttrBuffFG[Ptr+XStart-1] = CurCharAttr.Fore;
-			AttrBuffBG[Ptr+XStart-1] = CurCharAttr.Back;
+			AttrBuff[Ptr+XStart-1] &= AttrSgrMask;
 		}
 		if ((XStart+C<NumOfColumns) &&
 		    ((AttrBuff[Ptr+XStart+C-1] & AttrKanji) != 0) &&
 		    ((AttrBuff2[Ptr+XStart+C-1] & Attr2Protect) == 0)) {
 			CodeBuff[Ptr+XStart+C] = 0x20;
-			AttrBuff[Ptr+XStart+C] = CurCharAttr.Attr;
-			AttrBuff2[Ptr+XStart+C] = CurCharAttr.Attr2;
-			AttrBuffFG[Ptr+XStart+C] = CurCharAttr.Fore;
-			AttrBuffBG[Ptr+XStart+C] = CurCharAttr.Back;
+			AttrBuff[Ptr+XStart+C] &= AttrSgrMask;
 		}
 		for (j=Ptr+XStart; j<Ptr+XStart+C; j++) {
 			if (!(AttrBuff2[j] & Attr2Protect)) {
 				CodeBuff[j] = 0x20;
-				AttrBuff[j] = AttrDefault;
-				AttrBuff2[j] = CurCharAttr.Attr2 & Attr2ColorMask;
-				AttrBuffFG[j] = CurCharAttr.Fore;
-				AttrBuffBG[j] = CurCharAttr.Back;
+				AttrBuff[j] &= AttrSgrMask;
 			}
 		}
 		Ptr = NextLinePtr(Ptr);
@@ -3429,10 +3414,7 @@
 	for (i=XStart; i < XStart + Count; i++) {
 		if (!(AttrLine2[i] & Attr2Protect)) {
 			CodeLine[i] = 0x20;
-			AttrLine[i] = AttrDefault;
-			AttrLine2[i] = CurCharAttr.Attr2 & Attr2ColorMask;
-			AttrLineFG[i] = CurCharAttr.Fore;
-			AttrLineBG[i] = CurCharAttr.Back;
+			AttrLine[i] &= AttrSgrMask;
 		}
 	}
 



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