From 1fa7deed0a6441b20493c49bb3d5b53e55a9bcae Mon Sep 17 00:00:00 2001 From: Teemu Katajisto Date: Thu, 10 May 2012 11:54:28 +0300 Subject: printsupport: set duplex setting correctly to CUPS printer If CUPS printer default is not DuplexNone then setting duplex to None for printer did not have any effect on duplex setting. (backported from qtbase/385e584926f2957d6e9ec4c2c4e89b37a5e0c80c) Change-Id: Ia72f599a9e5fa511b3214c6b8016e21f40409b86 Reviewed-by: Andy Shaw --- src/gui/painting/qpdf.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp index 304d237f34..7a23f17170 100644 --- a/src/gui/painting/qpdf.cpp +++ b/src/gui/painting/qpdf.cpp @@ -1855,22 +1855,22 @@ void QPdfBaseEnginePrivate::closePrintDevice() options.append(QPair("Collate", "True")); } - if (duplex != QPrinter::DuplexNone) { - switch(duplex) { - case QPrinter::DuplexNone: break; - case QPrinter::DuplexAuto: - if (orientation == QPrinter::Portrait) - options.append(QPair("sides", "two-sided-long-edge")); - else - options.append(QPair("sides", "two-sided-short-edge")); - break; - case QPrinter::DuplexLongSide: + switch (duplex) { + case QPrinter::DuplexNone: + options.append(QPair("sides", "one-sided")); + break; + case QPrinter::DuplexAuto: + if (orientation == QPrinter::Portrait) options.append(QPair("sides", "two-sided-long-edge")); - break; - case QPrinter::DuplexShortSide: + else options.append(QPair("sides", "two-sided-short-edge")); - break; - } + break; + case QPrinter::DuplexLongSide: + options.append(QPair("sides", "two-sided-long-edge")); + break; + case QPrinter::DuplexShortSide: + options.append(QPair("sides", "two-sided-short-edge")); + break; } if (QCUPSSupport::cupsVersion() >= 10300 && orientation == QPrinter::Landscape) { -- cgit v1.2.3