John Levon wrote:
> There is a problem with "Layout/Document/Paper" settings:
> If I leave the headheight, headsep, footskip empty, I would assume they
> are
> zero.  But they are by default NOT!  I do not know the default values.
[snip]

This is a bug. It applies also to the custom margins. If the fields are empty, 
then the default margins from geometry are used, which are not "0", but "0" 
will be read in as empty field. So it's a rather grave bug.

AFAICS, the bug is in xforms_helpers.C (void updateWidgetsFromLength), line 
155 (len.zero()):
        
        if (len.zero()) {
                fl_set_input(input, "");
                fl_set_choice_text(choice, default_unit.c_str());
        } else {
                ostringstream buffer;
                buffer << len.value();
                fl_set_input(input, buffer.str().c_str());

                // Set the choice to the desired unit, if present in the choice.
                // Else set the choice to the default unit.
                string const unit = subst(stringFromUnit(len.unit()),"%","%%");

                vector<string> const vec = getVector(choice);
                vector<string>::const_iterator it =
                        std::find(vec.begin(), vec.end(), unit);
                if (it != vec.end()) {
                        fl_set_choice_text(choice, unit.c_str());
                } else {
                        fl_set_choice_text(choice, default_unit.c_str());
                }
        }

Obviously, len.zero() does not make a difference between values with "0" and 
empty values. This has to be changed. I'm shure it is easy, but I don't know 
how. Any hints?

Thanks,
Jürgen.

Reply via email to