lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LYNX-DEV the printing function and submit/image/reset buttons


From: Klaus Weide
Subject: Re: LYNX-DEV the printing function and submit/image/reset buttons
Date: Mon, 7 Apr 1997 19:47:58 -0500 (CDT)

On Mon, 7 Apr 1997, Laura Eaves wrote:

> Last month I posted mail about the problem of lynx translating
> submit/image/reset buttons into underscores when printing a rendered page,
> whether or not they have alt or value strings defined.
> 
> Below are some minor changes to GridText.c and HTML.c that correct the 
> problem.
> I assume this is a safe fix, since the "value" of these fields never change
> (or do they?????).  Assuming they don't, there's no need to suppress their
> default value.
> 
> Let me know if there's any reason not to make this change.
> Thanks.

I haven't looked at your code in detail or tested it.
So I cannot say whether your patch creates problems (I just supect
it may, given how complicated that FORM-handling stuff is...)
Just some quick comments:

> *** old/GridText.c    Mon Apr  7 06:39:30 1997
> --- src/GridText.c    Mon Apr  7 16:11:27 1997
> ***************
> *** 3924,3931 ****
>           StrAllocCopy(f->value, "[IMAGE]-Submit");
>           f->size = 14;
>       } else {
> -         StrAllocCopy(f->value, "[IMAGE]-Submit");
> -         f->size = 14;
>           StrAllocCopy(f->value, "Submit");
>           f->size = 6;
>       }
> --- 3924,3929 ----

That one looks like a safe change to make :)

> *** fm/HTML.c Mon Apr  7 07:08:20 1997
> --- src/HTML.c        Mon Apr  7 16:06:26 1997
> ***************
> *** 3818,3824 ****
>               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
> --- 3819,3836 ----
>               I.md = (char *)value[HTML_INPUT_MD];
>   
>           chars = HText_beginInput(me->text, &I);
> !         /*
> !          * Value for submit and reset buttons saved in I by
> !          * HText_beginInput(), so it can be output correctly 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

Have you checked whether your code handles e.g. submit fields, possibly
with a long value lable, adequately when within a PRE section... ?

> ***************
> *** 3830,3837 ****
>               }
>               HText_setIgnoreExcess(me->text, TRUE);
>           }
> !         for (; chars > 0; chars--)
> !             HTML_put_character(me, '_');
>           HText_setIgnoreExcess(me->text, FALSE);
>       }
>       break;
> --- 3842,3855 ----
>               }
>               HText_setIgnoreExcess(me->text, TRUE);
>           }
> !         /*--LE*/
> !         if ( !is_submit_or_reset ) {
> !             for (; chars > 0; chars--)
> !                 HTML_put_character(me, '_');
> !         } else { int i;
> !             for ( i = 0;  i < chars;  ++i )
                             ^^^^^^^^^^
> !                 HTML_put_character(me, I.value[i]);
> !         }
>           HText_setIgnoreExcess(me->text, FALSE);
>       }
>       break;

You should probably test for end of string (a '\0' char) there,
or explain why that is not necessary.

       Klaus

;
; To UNSUBSCRIBE:  Send a mail message to address@hidden
;                  with "unsubscribe lynx-dev" (without the
;                  quotation marks) on a line by itself.
;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]