qt/qt-copy-kde#162793.patch

19 lines
854 B
Diff
Raw Normal View History

--- trunk/qt-copy/src/gui/dialogs/qprintdialog_unix.cpp 2008/07/22 18:43:59 836671
+++ trunk/qt-copy/src/gui/dialogs/qprintdialog_unix.cpp 2008/07/22 18:46:17 836672
@@ -936,9 +936,12 @@
void QUnixPrintWidgetPrivate::setupPrinter()
{
- // printer or file name
- if (widget.printers->currentIndex() >= widget.printers->count() - 2) {
- if (widget.printers->currentIndex() == widget.printers->count() - 2)
+ const int printerCount = widget.printers->count();
+ const int index = widget.printers->currentIndex();
+
+ if (filePrintersAdded && index > printerCount - 3) { // PDF or postscript
+ Q_ASSERT(index != printerCount - 3); // separator
+ if (index == printerCount - 2)
printer->setOutputFormat(QPrinter::PdfFormat);
else
printer->setOutputFormat(QPrinter::PostScriptFormat);