From 3464e1e5c7b5b01ae13c99e3529dd02af1d36958 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Wed, 5 Dec 2018 19:48:05 +0000 Subject: 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 Reviewed-by: Luca Beldi Reviewed-by: Friedemann Kleint --- src/printsupport/kernel/qplatformprintdevice.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/printsupport/kernel') 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; } -- cgit v1.2.3