diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-12-23 00:15:30 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-12-23 09:38:38 +0000 |
commit | b78097b22d11a7279551709b28ef49d403407449 (patch) | |
tree | df23177fb98e02da88b8be66293e0f8856f38a15 /src/printsupport/kernel/qplatformprintdevice.cpp | |
parent | 2d4295f16761a0e47b5218bbb1db5c14d16ce4fe (diff) |
QtPrintSupport: eradicate all Q_FOREACH loops
Saves more than 2KiB in text size on optimized GCC 4.9 Linux
AMD64 builds, iow: ~0.5% of the total library size.
Change-Id: I84e1dc208da13eefdf1573c9b7ac7c9d76a7f5c7
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/printsupport/kernel/qplatformprintdevice.cpp')
-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 6385f58aa1..507c66d895 100644 --- a/src/printsupport/kernel/qplatformprintdevice.cpp +++ b/src/printsupport/kernel/qplatformprintdevice.cpp @@ -168,7 +168,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) { - foreach (const QPageSize &ps, m_pageSizes) { + for (const QPageSize &ps : m_pageSizes) { if (ps.id() == pageSize.id() && ps.name() == pageSize.name()) return ps; } @@ -176,7 +176,7 @@ QPageSize QPlatformPrintDevice::supportedPageSize(const QPageSize &pageSize) con // Next try match on id only if not custom if (pageSize.id() != QPageSize::Custom) { - foreach (const QPageSize &ps, m_pageSizes) { + for (const QPageSize &ps : m_pageSizes) { if (ps.id() == pageSize.id()) return ps; } @@ -191,7 +191,7 @@ QPageSize QPlatformPrintDevice::supportedPageSize(QPageSize::PageSizeId pageSize if (!m_havePageSizes) loadPageSizes(); - foreach (const QPageSize &ps, m_pageSizes) { + for (const QPageSize &ps : m_pageSizes) { if (ps.id() == pageSizeId) return ps; } @@ -205,7 +205,7 @@ QPageSize QPlatformPrintDevice::supportedPageSize(const QString &pageName) const if (!m_havePageSizes) loadPageSizes(); - foreach (const QPageSize &ps, m_pageSizes) { + for (const QPageSize &ps : m_pageSizes) { if (ps.name() == pageName) return ps; } @@ -234,7 +234,7 @@ QPageSize QPlatformPrintDevice::supportedPageSize(const QSizeF &size, QPageSize: QPageSize QPlatformPrintDevice::supportedPageSizeMatch(const QPageSize &pageSize) const { // Try to find a supported page size based on point size - foreach (const QPageSize &ps, m_pageSizes) { + for (const QPageSize &ps : m_pageSizes) { if (ps.sizePoints() == pageSize.sizePoints()) return ps; } |