xforms-development
[Top][All Lists]
Advanced

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

[XForms] Small Bug


From: Serge Bromow
Subject: [XForms] Small Bug
Date: Sat, 02 Nov 2013 08:14:41 -0400
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.0

Hi Jens,

I just finished testing 94pre20. All went without incident but for these 2 problems;

1) Calling "fl_get_browser_topline(" on on empty browser abends. The problem is in "fli_tbox_get_topline(" when the var "sp->def_height" == 0. The following line is the culprit;

int i = FL_min( sp->yoffset / sp->def_height, sp->num_lines - 1);
(div/0) thing.

Interesting is the program does not fault using GCC 4.5.1 but does under 4.7.2. Go figure.

2) When using a tab folder the tabs label colors are always BLACK even though I have set the color to WHITE in both the folder and the forms placed in the folder.

Any thoughts?

And last, I was wondering if you would mind if we added string formatting to certain functions. The same approach as "printf(".

i.e.   fl_set_object_label(FL_OBJECT *ob, const char *label)  TO
        fl_set_object_label(FL_OBJECT *ob, const char *format, ...)

This would save pre formatting strings before submitting them to the functions.

Others would be fl_set_input, fl_set_form_title, etc. Anything that takes a string as an argument. This should not disturb current code that uses fixed strings but would add flexibility in the future.

I can provide the code to you so it should only be a copy and paste for you. There is one problem that I can see;

fl_set_object_label( FL_OBJECT  * obj,  const char *format, ... )
{
va_list argp;

int need_show = 0;

char buf[512], *label;

if ( ! obj ) {
    M_err( "fl_set_object_label", "NULL object" );
    return;
    }

va_start(argp, format);
vsprintf(buf, format,  argp);
va_end(argp);

label = buf;

// Rest of code stays the same
}

The problem is the buffer has to be set to some maximum size since we do not know the size of the resulting string. I would think 512 chars would be adequate but can't be sure. Any thoughts on how to solve this problem?

Thanks,
 

Serge


reply via email to

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