From 3e001feb4d03d350ecea76f136c503675a2431ab Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 28 Nov 2017 15:41:30 +0100 Subject: If the page size is not valid on the new printer, set a custom size When the page size was not valid on the new printer, it would end up having the wrong page size name on the new printer. What should happen in this case is that it should set the originally set page size as a custom page size on the printer instead. Task-number: QTBUG-62221 Change-Id: Iaca34ae262f5d0685ca60e4ca4b38229a2283289 Reviewed-by: Albert Astals Cid --- src/printsupport/kernel/qprintengine_win.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/printsupport') diff --git a/src/printsupport/kernel/qprintengine_win.cpp b/src/printsupport/kernel/qprintengine_win.cpp index a943d24cb1..ca4d1d0bd6 100644 --- a/src/printsupport/kernel/qprintengine_win.cpp +++ b/src/printsupport/kernel/qprintengine_win.cpp @@ -1234,7 +1234,10 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant & if (printDevice.isValid()) { d->m_printDevice = printDevice; d->initialize(); - setProperty(PPK_QPageSize, pageSize); + if (d->m_printDevice.supportedPageSize(pageSize.value()).isValid()) + setProperty(PPK_QPageSize, pageSize); + else + setProperty(PPK_CustomPaperSize, pageSize.value().size(QPageSize::Point)); setProperty(PPK_FullPage, QVariant(isFullPage)); setProperty(PPK_Orientation, orientation); setProperty(PPK_QPageMargins, margins); -- cgit v1.2.3