From 79f2f48ea82646dc419d38ea766b5d64df900a4f Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Sun, 27 Nov 1994 05:23:52 +0000 Subject: [PATCH] Fix many duplicated attribute sets --- lib/libncurses/lib_deleteln.c | 4 ---- lib/libncurses/lib_doupdate.c | 12 ++++++------ lib/libncurses/lib_insdel.c | 4 ---- lib/libncurses/lib_insertln.c | 4 ---- lib/libncurses/lib_scroll.c | 4 ---- 5 files changed, 6 insertions(+), 22 deletions(-) diff --git a/lib/libncurses/lib_deleteln.c b/lib/libncurses/lib_deleteln.c index 4720b549627d..054b99fc8ea7 100644 --- a/lib/libncurses/lib_deleteln.c +++ b/lib/libncurses/lib_deleteln.c @@ -24,10 +24,6 @@ int y, touched = 0; if (win->_idlok && (delete_line != NULL)) { wrefresh(win); - if (back_color_erase) { - T(("back_color_erase, turning attributes off")); - vidattr(curscr->_attrs = A_NORMAL); - } putp(delete_line); touched = 1; } diff --git a/lib/libncurses/lib_doupdate.c b/lib/libncurses/lib_doupdate.c index 0900ff20a457..e729a47e7370 100644 --- a/lib/libncurses/lib_doupdate.c +++ b/lib/libncurses/lib_doupdate.c @@ -147,7 +147,7 @@ sigaction_t act, oact; /* perhaps we should turn attributes off here */ - if (!(curscr->_attrs & A_NORMAL)) + if (curscr->_attrs != A_NORMAL) vidattr(curscr->_attrs = A_NORMAL); fflush(SP->_ofp); @@ -179,7 +179,7 @@ int i = 0, j = 0; int lastNonBlank; T(("ClrUpdate(%x) called", scr)); - if (back_color_erase) { + if (back_color_erase && curscr->_attrs != A_NORMAL) { T(("back_color_erase, turning attributes off")); vidattr(curscr->_attrs = A_NORMAL); } @@ -308,7 +308,7 @@ int attrchanged = 0; lastChar = columns - 1; GoTo(lineno, firstChar); if(clr_eol) { - if (back_color_erase) { + if (back_color_erase && curscr->_attrs != A_NORMAL) { T(("back_color_erase, turning attributes off")); vidattr(curscr->_attrs = A_NORMAL); } @@ -378,7 +378,7 @@ int attrchanged = 0; if (attrchanged) { GoTo(lineno, firstChar); - if (back_color_erase) { + if (back_color_erase && curscr->_attrs != A_NORMAL) { T(("back_color_erase, turning attributes off")); vidattr(curscr->_attrs = A_NORMAL); } @@ -412,7 +412,7 @@ int attrchanged = 0; if((nLastChar == firstChar) && clr_eol) { GoTo(lineno, firstChar); - if (back_color_erase) { + if (back_color_erase && curscr->_attrs != A_NORMAL) { T(("back_color_erase, turning attributes off")); vidattr(curscr->_attrs = A_NORMAL); } @@ -558,7 +558,7 @@ static void DelChar(int count) { T(("DelChar(%d) called", count)); - if (back_color_erase) { + if (back_color_erase && curscr->_attrs != A_NORMAL) { T(("back_color_erase, turning attributes off")); vidattr(curscr->_attrs = A_NORMAL); } diff --git a/lib/libncurses/lib_insdel.c b/lib/libncurses/lib_insdel.c index a9fcec5bdc67..879631fefb11 100644 --- a/lib/libncurses/lib_insdel.c +++ b/lib/libncurses/lib_insdel.c @@ -86,10 +86,6 @@ chtype blank = ' '; if (win->_maxx == columns && win->_idlok == TRUE) { wrefresh(win); - if (back_color_erase) { - T(("back_color_erase, turning attributes off")); - vidattr(curscr->_attrs = A_NORMAL); - } if (n > 0) { mvcur(-1, -1, win->_cury, 0); if (parm_insert_line) { diff --git a/lib/libncurses/lib_insertln.c b/lib/libncurses/lib_insertln.c index c43144098bd3..4a39ce0aaa68 100644 --- a/lib/libncurses/lib_insertln.c +++ b/lib/libncurses/lib_insertln.c @@ -24,10 +24,6 @@ int y, touched = 0; if (win->_idlok && (insert_line != NULL)) { wrefresh(win); - if (back_color_erase) { - T(("back_color_erase, turning attributes off")); - vidattr(curscr->_attrs = A_NORMAL); - } putp(insert_line); touched = 1; } diff --git a/lib/libncurses/lib_scroll.c b/lib/libncurses/lib_scroll.c index a348e70d37bd..c15e52ecb1c9 100644 --- a/lib/libncurses/lib_scroll.c +++ b/lib/libncurses/lib_scroll.c @@ -88,10 +88,6 @@ chtype blank = ' '; if (win->_maxx == columns && win->_regtop == 0 && win->_regbottom == lines) { wrefresh(win); - if (back_color_erase) { - T(("back_color_erase, turning attributes off")); - vidattr(curscr->_attrs = A_NORMAL); - } /* at the moment this relies on scroll_reverse and scroll_forward or parm_rindex and parm_index. we should add idl support as an alternative */