-----BEGIN PGP SIGNED MESSAGE-----

On Freitag, 28. Februar 2003 17:34, Jean-Marc Lasgouttes wrote:

...
> The problem is the following code in lyxlength.C:
>
> string const LyXLength::asLatexString() const
> {
>       ostringstream buffer;
>       switch (unit_) {
>       case PTW:
>           buffer << abs(static_cast<int>(val_/100)) << '.'
>                  << abs(static_cast<int>(val_)%100) << "\\textwidth";
>           break;
>
> This is obviously broken. Who had this bright idea? ;) What was the
> reason why
>   double(abs(val_))/100
> is not good enough? I remember some discussion on the subject, but not
> the substance of these discussions.

I think, it was the internalisation. (E.g. print "50.5" as "50,5")

How about

{
        char val_buf[10];
        ostringstream buffer;

        sprintf(val_buf, "%d.%02d", abs(static_cast<int>(val_/100)), 
abs(static_cast<int>(val_)%100));
        switch (unit_) {
        case PTW:
                buffer << val_buf << "\\textwidth";
                break;
        ...

        Kornel
- -- 
Kornel Benko
[EMAIL PROTECTED]
-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8

iQCVAwUBPmB2jrewfbDGmeqhAQE3JgP/c4XqYQFEvGVzjrjPmiDYRGi18HtDCyNf
oPY2Wg/8BSOGARy3S/dgtqGE4FkdL2Kz2Rc+rw7AOeDOZzV7eASt73pzwii//8Ya
q0BKuznHgrElxjCqV4zBy28f2OEEUUgIP149fsDmzkovYFFqmIgB88daRGDa0GxL
Znn0bZyb70U=
=LLWG
-----END PGP SIGNATURE-----

Reply via email to