Re: PRINTs landscape despite configured as portrait (Mac OS) (bug 92190)

2017-11-13 Thread Tor Lillqvist
> I experimented with manually editing the .ppd file for my printer
> (/etc/cups/ppd/HP_LaserJet_1010___sniff.ppd in my case). I changed the
> "*DefaultPageSize: A4" line to use Letter and not A4.
>

Correction: I had also in System Preferences... > Printers & Scanners
changed the "Default paper size" to "US Letter". And in fact now it seems
that editing the PPD file was irrelevant, it was that System Preferences
... setting that helped reproducing the bug.

This is a good example of how difficult it is to carefully search for a way
to reproduce some bug... you tend to forget something you did, and think it
was something else that affected it.

--tml
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: PRINTs landscape despite configured as portrait (Mac OS) (bug 92190)

2017-11-13 Thread Tor Lillqvist
I experimented with manually editing the .ppd file for my printer
(/etc/cups/ppd/HP_LaserJet_1010___sniff.ppd in my case). I changed the
"*DefaultPageSize: A4" line to use Letter and not A4. Then in LibreOffice I
set the Format > Page... > Page > Format: of my test document to Letter,
too. Orientation was kept as portrait everywhere. Then I printed it.
Without the 38c03901406b439ea3453279838894d9c0b4bd3d fix, it came out in
landscape, and with the fix, in portrait.

Of course as my actual printer physically uses A4 paper (and the printer
doesn't know that I have faked the DefaultPageSize entry in its PPD file),
I can't be 100% sure that it isn't the system printing layer that turns the
orientation. On the other hand, why would it, and not just scale a bit
instead? So maybe the fix indeed was all that was needed? But why did the
bug show up for Letter only, not A4? No idea. Some back-and-forth
conversion between metric and Imperial units rounding thing? But it
wouldn't be the first time we fix a bug without actually understanding
fully why the fix works.

Anyway, Telesto, can you confirm that the simple one-liner files the
problem for you, too?

--tml
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: PRINTs landscape despite configured as portrait (Mac OS) (bug 92190)

2017-11-13 Thread Tor Lillqvist
> 3.  I also found a different approach. It doesn't fix the underlying
> problem (similar to my initial solution), but it will work (without any
> side effect, as far I can tell) and limited to MacOS printer code
> I switched the orientation order in https://opengrok.libreoffice.
> org/xref/core/vcl/osx/salprn.cxx#68. Instead of Orientation
> ::
> Landscape 
> : Orientation
> ::
> Portrait 
> -> Orientation
> ::
> Portrait 
> : Orientation
> ::
> Landscape 
>
That indeed clearly was a copy-paste error, introduced by me in 2014, in
5f27a6864420815d0d0abc409333fec963536faf . But whether fixing that has any
effect on tdf#92190 is unclear.

For this bug, I don't think we need to bother with investigating what
happens if the user goes into the "Expert Configuration" (Preferences.. >
Advanced > Open Expert Configuration) and changes settings there; by
definition people doing that are asking for trouble, and taking into
account such situations will just confuse things further.

--tml
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: PRINTs landscape despite configured as portrait (Mac OS) (bug 92190)

2017-11-13 Thread Tor Lillqvist
Hi, thanks for your email (although I do think it would have been good to
have it as a comment in the bug instead, or to include the development
list).

The thing that I was most interested in was whether changing the

#define IN2MM100( v ) \
((long)(((v) * 2540) + 0.5))

to

#define IN2MM100( v ) \
((long)(((v) * 2540)))

really helped? That is how I understood the first fix mentioned in your
comment #76. That seems like a complete mystery to me, as both versions of
the macro produce the same result for 8.5 and 11.

--tml
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice