summaryrefslogtreecommitdiffstats
path: root/src/plugins/printsupport
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2018-08-29 10:59:24 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2018-09-03 08:53:46 +0000
commit5cc5b43d0f66ac05a2d31ac6557644769578e981 (patch)
tree8e3c129f4afa6c256d55cec4b41e7bc8bc12d157 /src/plugins/printsupport
parent179c88a1a99c4b035e0b195c5fea9b23e0d06479 (diff)
Remove some misplaced sizeof() scalings on array sizes for new[]
Noticed during review of clang-tidy warnings. I have searched the source tree (using grep) and only this one file contains examples of this mistake. Change-Id: I3bbcec736e5a184db7251962fd3671a21ab5d238 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Diffstat (limited to 'src/plugins/printsupport')
-rw-r--r--src/plugins/printsupport/windows/qwindowsprintdevice.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/printsupport/windows/qwindowsprintdevice.cpp b/src/plugins/printsupport/windows/qwindowsprintdevice.cpp
index 071bc01192..f01e93d611 100644
--- a/src/plugins/printsupport/windows/qwindowsprintdevice.cpp
+++ b/src/plugins/printsupport/windows/qwindowsprintdevice.cpp
@@ -210,7 +210,7 @@ void QWindowsPrintDevice::loadPageSizes() const
&& DeviceCapabilities((LPWSTR)m_id.utf16(), NULL, DC_PAPERS, NULL, NULL) == paperCount) {
QScopedArrayPointer<wchar_t> paperNames(new wchar_t[paperCount*64]);
- QScopedArrayPointer<POINT> winSizes(new POINT[paperCount*sizeof(POINT)]);
+ QScopedArrayPointer<POINT> winSizes(new POINT[paperCount]);
QScopedArrayPointer<wchar_t> papers(new wchar_t[paperCount]);
// Get the details and match the default paper size
@@ -356,7 +356,7 @@ void QWindowsPrintDevice::loadInputSlots() const
if (int(binCount) > 0
&& DeviceCapabilities(printerId, nullptr, DC_BINNAMES, nullptr, nullptr) == binCount) {
- QScopedArrayPointer<WORD> bins(new WORD[binCount*sizeof(WORD)]);
+ QScopedArrayPointer<WORD> bins(new WORD[binCount]);
QScopedArrayPointer<wchar_t> binNames(new wchar_t[binCount*24]);
// Get the details and match the default paper size