Avoid duplicate setPen() in PDF when reusing QPrinter
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Mon, 10 Sep 2012 12:10:41 +0000 (14:10 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 11 Sep 2012 07:35:28 +0000 (09:35 +0200)
The simplePen property was not reset when reusing the QPrinter,
thus we would output two identical setPen() commands in the PDF
making the autotest that compares the results fail.

Task-number: QTBUG-27171
Change-Id: I601042ec59e45ef72a56f230f6112a91a259b4a5
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
src/gui/painting/qpdf.cpp
tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp

index cfa0a28..1371e3f 100644 (file)
@@ -1521,6 +1521,7 @@ bool QPdfEngine::begin(QPaintDevice *pdev)
     d->info = 0;
     d->graphicsState = 0;
     d->patternColorSpace = 0;
+    d->simplePen = false;
 
     d->pages.clear();
     d->imageCache.clear();
index 4b4756b..ca7fd4f 100644 (file)
@@ -985,9 +985,6 @@ void tst_QPrinter::taskQTBUG4497_reusePrinterOnDifferentFiles()
     QFile file2("out2.ps");
     QVERIFY(file2.open(QIODevice::ReadOnly));
 
-#ifndef Q_OS_WIN
-    QEXPECT_FAIL("", "QTBUG-22562, QTBUG-22296", Abort);
-#endif
     QCOMPARE(file1.readAll(), file2.readAll());
 }