Fix QPlatformPrintDevice::supportedPageSizeMatch

First check if the pagesize is one of the known ones before
comparing the page sizes. It's veeeery similar but without
it when running the qprinter tests i get a failure since we
set "Index Card 3x5in" but get back "Photo 3x5in"

Change-Id: I72671231c2abec39e036de829d226784f06e1b41
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
bb10
Albert Astals Cid 2018-02-19 13:07:30 +01:00
parent 4629a6b238
commit d145d291cd
1 changed files with 4 additions and 0 deletions

View File

@ -247,6 +247,10 @@ QPageSize QPlatformPrintDevice::supportedPageSize(const QSizeF &size, QPageSize:
QPageSize QPlatformPrintDevice::supportedPageSizeMatch(const QPageSize &pageSize) const
{
// If it's a known page size, just return itself
if (m_pageSizes.contains(pageSize))
return pageSize;
// Try to find a supported page size based on point size
for (const QPageSize &ps : m_pageSizes) {
if (ps.sizePoints() == pageSize.sizePoints())