From ecd0dffb7901a7fbfff21f2c555bf894b2f351ee Mon Sep 17 00:00:00 2001 From: blymn Date: Mon, 8 Jul 2002 10:43:37 +0000 Subject: [PATCH] * Set character attributes when adding pad to field, null fields will now be displayed correctly (fixes part 1 of pr 17480) * Prevent field manipulations on null fields, the fields have nothing in them so they should not be manipulated. --- lib/libform/internals.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/libform/internals.c b/lib/libform/internals.c index 9d7add2796d8..fcb2a4ddecda 100644 --- a/lib/libform/internals.c +++ b/lib/libform/internals.c @@ -1,4 +1,4 @@ -/* $NetBSD: internals.c,v 1.23 2002/05/20 15:00:11 blymn Exp $ */ +/* $NetBSD: internals.c,v 1.24 2002/07/08 10:43:37 blymn Exp $ */ /*- * Copyright (c) 1998-1999 Brett Lymn @@ -1246,11 +1246,18 @@ _formi_redraw_field(FORM *form, int field) for (row = cur->row_count - cur->start_line; row < cur->rows; row++) { wmove(form->scrwin, (int) (cur->form_row + row), (int) cur->form_col); + + if (form->cur_field == field) + wattrset(form->scrwin, cur->fore); + else + wattrset(form->scrwin, cur->back); + for (i = 0; i < cur->cols; i++) { waddch(form->scrwin, cur->pad); } } + wattrset(form->scrwin, cur->back); return; } @@ -1551,6 +1558,8 @@ _formi_manipulate_field(FORM *form, int c) int len; cur = form->fields[form->cur_field]; + if ((cur->buffers[0].string == NULL) || (cur->buffers[0].length == 0)) + return E_REQUEST_DENIED; #ifdef DEBUG fprintf(dbg, "entry: request is REQ_%s\n", reqs[c - REQ_MIN_REQUEST]);