[Libreoffice] rounding problem with twips in writer
Caolán McNamara
caolanm at redhat.com
Tue Jan 17 04:23:41 PST 2012
On Tue, 2012-01-17 at 13:03 +0100, Winfried Donkers wrote:
> >> This is caused by MM100 to TWIP conversion. An A4 page is 210mm,
> >> 11906twip. The calculated document width is 210mm, 11907twip.
> >Do you know where the code is that calculates 11907 as the result ?
>
> No. I know that: -a macro (MM100_TO_TWIP) is used. -the paper width
> is calculated from (leftMargin * 2 + (columns-1)*labelPitch +
> labelWidth (core/sw/source/ui/app/applab.cxx) and each has converted
> form MM100 to TWIP before that. The problem is not here, because when I
> apply bugfix 44516 (which I have not yet submitted), the paper width is
> taken from the label definition and amounts to 11906twip.
Well, 11906 is the correct value in twips (twenty in a point, 72 points
in an inch => 1440 twips in an inch) for 210mm anyway (11905.51 twips),
Unless the calculation of adding up bits of a page can be done in
100thmm of a mm and the final value converted to twips there's going to
be rounding errors, sloppyFit might be the easiest solution and/or
something of that nature.
C.
More information about the LibreOffice
mailing list