For Microsoft XPS Document Writer printer, the paper list is very
logn, and contains duplicates (e.g., two portrait Letter), as well
as rotated variants (e.g., landscape Letter).
The code that looks for matching paper in setPaperSizes would find
all elelemts with matching Paper value, regardless of orientation;
and would use the last match. It happened, that for A4 and Letter,
the last matches were landscape, so the perfect portrait-oriented
matches would get skipped.
This change checks orientation for exact matches as well; and will
prefer the first found best match.
Change-Id: Iaa93292ef60b94ab1f807b21e8a3494099c0b002
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199841
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>