[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: LYNX-DEV the printing function and submit/image/reset buttons
From: |
Laura Eaves |
Subject: |
Re: LYNX-DEV the printing function and submit/image/reset buttons |
Date: |
Thu, 10 Apr 1997 18:24:04 -0400 (EDT) |
I just updated (and hopefully improved) the comments in my fix for the
print bug for submit/reset buttons. As far as I can tell, it works.
The diff is below -- diff against 2-7-1 + fotemods.
Files: src/GridText.c and src/HTML.c.
I hope you will consider picking it up.
I believe it is safe, and it is a small change (although it took
a lot of code reading before I figured out where to put it).
The code hasn't changed except for the comments.
I'm leaving on vacation for a week, so won't be replying to email...
Enjoy.
--le
*** old/GridText.c Wed Apr 9 17:11:42 1997
--- src/GridText.c Thu Apr 10 02:50:52 1997
***************
*** 3947,3954 ****
StrAllocCopy(f->value, "[IMAGE]-Submit");
f->size = 14;
} else {
- StrAllocCopy(f->value, "[IMAGE]-Submit");
- f->size = 14;
StrAllocCopy(f->value, "Submit");
f->size = 6;
}
--- 3947,3952 ----
***************
*** 3999,4004 ****
--- 3997,4013 ----
((f->value != NULL) ? f->value : ""),
f->size);
+ /*
+ * Save value for submit/reset buttons so they will be visible when
printing
+ * the page. --LE
+ */
+ switch ( f->type ) {
+ case F_SUBMIT_TYPE:
+ case F_IMAGE_SUBMIT_TYPE:
+ case F_RESET_TYPE:
+ I->value = f->value;
+ }
+
/*
* Return the SIZE of the input field.
*/
*** old/HTML.c Wed Apr 9 17:11:52 1997
--- src/HTML.c Thu Apr 10 18:00:50 1997
***************
*** 3563,3568 ****
--- 3563,3569 ----
int chars;
BOOL UseALTasVALUE = FALSE;
BOOL HaveSRClink = FALSE;
+ BOOL is_submit_or_reset = 0; /*--LE*/
/*
* Make sure we're in a form.
***************
*** 3826,3832 ****
I.md = (char *)value[HTML_INPUT_MD];
chars = HText_beginInput(me->text, &I);
! if (me->sp[0].tag_number == HTML_PRE && chars > 20) {
/*
* The code inadequately handles INPUT fields in PRE tags.
* We'll put up a minimum of 20 underscores, and if any
--- 3827,3850 ----
I.md = (char *)value[HTML_INPUT_MD];
chars = HText_beginInput(me->text, &I);
! /*
! * Value for submit/image/reset buttons is constructed by
! * HText_beginInput() and does not change. It is saved in
! * I.value for use below. Unlike other input fields,
! * the size returned by HText_beginInput() for submit/image/reset
! * buttons is always == lengt(value).
! * For submit/image/reset buttons, save the value in the buffer.
! * For all other input fields, output '_'s the size of the field.
! * This ensures submit/image/reset button values are not printed
! * as blanks during print operations. --LE
! */
! if ( I.type &&
! ( !strcasecomp(I.type,"submit")
! || !strcasecomp(I.type,"reset")
! || !strcasecomp(I.type,"image") ) )
! is_submit_or_reset = 1;
! if (me->sp[0].tag_number == HTML_PRE && chars > 20
! && !is_submit_or_reset) {
/*
* The code inadequately handles INPUT fields in PRE tags.
* We'll put up a minimum of 20 underscores, and if any
***************
*** 3838,3845 ****
}
HText_setIgnoreExcess(me->text, TRUE);
}
! for (; chars > 0; chars--)
! HTML_put_character(me, '_');
HText_setIgnoreExcess(me->text, FALSE);
}
break;
--- 3856,3870 ----
}
HText_setIgnoreExcess(me->text, TRUE);
}
! /*--LE*/
! if ( !is_submit_or_reset ) {
! for (; chars > 0; chars--)
! HTML_put_character(me, '_');
! } else { int i;
! /* chars should == length(I.value); see above --LE */
! for ( i = 0; i < chars; ++i )
! HTML_put_character(me, I.value[i]);
! }
HText_setIgnoreExcess(me->text, FALSE);
}
break;
***************
*** 4294,4300 ****
char *temp = NULL, *cp = NULL;
#ifdef CAREFUL /* parser assumed to produce good
nesting */
! if (element_number != me->sp[0].tag_number) {
fprintf(stderr,
"HTMLText: end of element %s when expecting end of %s\n",
HTML_dtd.tags[element_number].name,
--- 4319,4326 ----
char *temp = NULL, *cp = NULL;
#ifdef CAREFUL /* parser assumed to produce good
nesting */
! if (element_number != me->sp[0].tag_number
! && HTML_dtd.tags[element_number].contents != SGML_EMPTY) {
fprintf(stderr,
"HTMLText: end of element %s when expecting end of %s\n",
HTML_dtd.tags[element_number].name,
;
; To UNSUBSCRIBE: Send a mail message to address@hidden
; with "unsubscribe lynx-dev" (without the
; quotation marks) on a line by itself.
;