diff options
Diffstat (limited to 'src/printsupport/kernel/qplatformprintdevice.cpp')
-rw-r--r-- | src/printsupport/kernel/qplatformprintdevice.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/printsupport/kernel/qplatformprintdevice.cpp b/src/printsupport/kernel/qplatformprintdevice.cpp index ac8628685d..a2ee51f887 100644 --- a/src/printsupport/kernel/qplatformprintdevice.cpp +++ b/src/printsupport/kernel/qplatformprintdevice.cpp @@ -75,6 +75,10 @@ bool QPlatformPrintDevice::isValidPageLayout(const QPageLayout &layout, int reso if (!supportedPageSize(layout.pageSize()).isValid()) return false; + // In fullpage mode, margins outside the printable area are valid + if (layout.mode() == QPageLayout::FullPageMode) + return true; + // Check the margins are valid QMarginsF pointMargins = layout.margins(QPageLayout::Point); QMarginsF printMargins = printableMargins(layout.pageSize(), layout.orientation(), resolution); @@ -127,7 +131,7 @@ QPageSize QPlatformPrintDevice::supportedPageSize(const QPageSize &pageSize) con // e.g. Windows defines DMPAPER_11X17 and DMPAPER_TABLOID with names "11x17" and "Tabloid", but both // map to QPageSize::Tabloid / PPD Key "Tabloid" / ANSI B Tabloid if (pageSize.id() != QPageSize::Custom) { - for (const QPageSize &ps : qAsConst(m_pageSizes)) { + for (const QPageSize &ps : std::as_const(m_pageSizes)) { if (ps.id() == pageSize.id() && ps.name() == pageSize.name()) return ps; } @@ -135,7 +139,7 @@ QPageSize QPlatformPrintDevice::supportedPageSize(const QPageSize &pageSize) con // Next try match on id only if not custom if (pageSize.id() != QPageSize::Custom) { - for (const QPageSize &ps : qAsConst(m_pageSizes)) { + for (const QPageSize &ps : std::as_const(m_pageSizes)) { if (ps.id() == pageSize.id()) return ps; } @@ -150,7 +154,7 @@ QPageSize QPlatformPrintDevice::supportedPageSize(QPageSize::PageSizeId pageSize if (!m_havePageSizes) loadPageSizes(); - for (const QPageSize &ps : qAsConst(m_pageSizes)) { + for (const QPageSize &ps : std::as_const(m_pageSizes)) { if (ps.id() == pageSizeId) return ps; } @@ -164,7 +168,7 @@ QPageSize QPlatformPrintDevice::supportedPageSize(const QString &pageName) const if (!m_havePageSizes) loadPageSizes(); - for (const QPageSize &ps : qAsConst(m_pageSizes)) { + for (const QPageSize &ps : std::as_const(m_pageSizes)) { if (ps.name() == pageName) return ps; } @@ -197,7 +201,7 @@ QPageSize QPlatformPrintDevice::supportedPageSizeMatch(const QPageSize &pageSize return pageSize; // Try to find a supported page size based on point size - for (const QPageSize &ps : qAsConst(m_pageSizes)) { + for (const QPageSize &ps : std::as_const(m_pageSizes)) { if (ps.sizePoints() == pageSize.sizePoints()) return ps; } |