diff options
author | Sergio Martins <sergio.martins@kdab.com> | 2018-12-05 19:48:05 +0000 |
---|---|---|
committer | Sérgio Martins <sergio.martins@kdab.com> | 2018-12-10 11:47:28 +0000 |
commit | 3464e1e5c7b5b01ae13c99e3529dd02af1d36958 (patch) | |
tree | c64654aa734d71add2df23872fa77113193e6d0e /src/printsupport/kernel | |
parent | fc85a6b6b952aa619b87262d4187dc05865ab51a (diff) |
Add a few qAsConst() to range-for to prevent detachments
places indicated by clazy
As a drive-by, fixed minor styling issues in the affected lines.
Change-Id: I88d3fc0c8573cde0e61f19a18dd9ea697ee40c34
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/printsupport/kernel')
-rw-r--r-- | src/printsupport/kernel/qplatformprintdevice.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/printsupport/kernel/qplatformprintdevice.cpp b/src/printsupport/kernel/qplatformprintdevice.cpp index f778de8e71..3d76cad688 100644 --- a/src/printsupport/kernel/qplatformprintdevice.cpp +++ b/src/printsupport/kernel/qplatformprintdevice.cpp @@ -163,7 +163,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 : m_pageSizes) { + for (const QPageSize &ps : qAsConst(m_pageSizes)) { if (ps.id() == pageSize.id() && ps.name() == pageSize.name()) return ps; } @@ -171,7 +171,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 : m_pageSizes) { + for (const QPageSize &ps : qAsConst(m_pageSizes)) { if (ps.id() == pageSize.id()) return ps; } @@ -186,7 +186,7 @@ QPageSize QPlatformPrintDevice::supportedPageSize(QPageSize::PageSizeId pageSize if (!m_havePageSizes) loadPageSizes(); - for (const QPageSize &ps : m_pageSizes) { + for (const QPageSize &ps : qAsConst(m_pageSizes)) { if (ps.id() == pageSizeId) return ps; } @@ -200,7 +200,7 @@ QPageSize QPlatformPrintDevice::supportedPageSize(const QString &pageName) const if (!m_havePageSizes) loadPageSizes(); - for (const QPageSize &ps : m_pageSizes) { + for (const QPageSize &ps : qAsConst(m_pageSizes)) { if (ps.name() == pageName) return ps; } @@ -233,7 +233,7 @@ QPageSize QPlatformPrintDevice::supportedPageSizeMatch(const QPageSize &pageSize return pageSize; // Try to find a supported page size based on point size - for (const QPageSize &ps : m_pageSizes) { + for (const QPageSize &ps : qAsConst(m_pageSizes)) { if (ps.sizePoints() == pageSize.sizePoints()) return ps; } |