From fbd0e4489c936394a55f8084af2aab4ef2456360 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 28 Aug 2015 10:34:43 +0200 Subject: Copy the state to the picture paintengine when updating the state When the state of the paint changes then the one used for the picture paintengine needs to be kept in sync. Otherwise the rendering will be incorrect. Task-number: QTBUG-43145 Change-Id: Ia55a4e940d109bedb7c2eff4d985d3b212da75a4 Reviewed-by: Lars Knoll --- src/printsupport/kernel/qpaintengine_alpha.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/printsupport/kernel') diff --git a/src/printsupport/kernel/qpaintengine_alpha.cpp b/src/printsupport/kernel/qpaintengine_alpha.cpp index 010a628e4f..a81f3eae43 100644 --- a/src/printsupport/kernel/qpaintengine_alpha.cpp +++ b/src/printsupport/kernel/qpaintengine_alpha.cpp @@ -146,8 +146,16 @@ void QAlphaPaintEngine::updateState(const QPaintEngineState &state) d->m_hasalpha = d->m_alphaOpacity || d->m_alphaBrush || d->m_alphaPen; - if (d->m_picengine) + if (d->m_picengine) { + const QPainter *p = painter(); + d->m_picpainter->setPen(p->pen()); + d->m_picpainter->setBrush(p->brush()); + d->m_picpainter->setBrushOrigin(p->brushOrigin()); + d->m_picpainter->setFont(p->font()); + d->m_picpainter->setOpacity(p->opacity()); + d->m_picpainter->setTransform(p->combinedTransform()); d->m_picengine->updateState(state); + } } void QAlphaPaintEngine::drawPath(const QPainterPath &path) -- cgit v1.2.3 From a5f470240f31d35e694a40fe837fc4f49bc32072 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 28 Sep 2015 16:41:34 +0200 Subject: qprintengine_win.cpp: Check access to members of DOCINFO in warning. DOCINFO::lpszOutput can be 0. Task-number: QTBUG-48203 Change-Id: Ia3940b5b3200143d8d50caa8f4f44c4b22bfff75 Reviewed-by: Andy Shaw --- src/printsupport/kernel/qprintengine_win.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/printsupport/kernel') diff --git a/src/printsupport/kernel/qprintengine_win.cpp b/src/printsupport/kernel/qprintengine_win.cpp index b377401ed9..a4209d833a 100644 --- a/src/printsupport/kernel/qprintengine_win.cpp +++ b/src/printsupport/kernel/qprintengine_win.cpp @@ -93,9 +93,10 @@ static QByteArray msgBeginFailed(const char *function, const DOCINFO &d) { QString result; QTextStream str(&result); - str << "QWin32PrintEngine::begin: " << function << " failed, document \"" - << QString::fromWCharArray(d.lpszDocName) << '"'; - if (d.lpszOutput[0]) + str << "QWin32PrintEngine::begin: " << function << " failed"; + if (d.lpszDocName && d.lpszDocName[0]) + str << ", document \"" << QString::fromWCharArray(d.lpszDocName) << '"'; + if (d.lpszOutput && d.lpszOutput[0]) str << ", file \"" << QString::fromWCharArray(d.lpszOutput) << '"'; return result.toLocal8Bit(); } -- cgit v1.2.3 From bba86a01c9828d03b1564984a08561d62686d329 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 13 Oct 2015 09:26:59 +0200 Subject: Libraries: Fix single-character string literals. Use character literals where applicable. Change-Id: I8e198774c2247c1cc1d852a41b59b301199b7878 Reviewed-by: Marc Mutz --- src/printsupport/kernel/qprintengine_win.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/printsupport/kernel') diff --git a/src/printsupport/kernel/qprintengine_win.cpp b/src/printsupport/kernel/qprintengine_win.cpp index a4209d833a..c8ce2e482d 100644 --- a/src/printsupport/kernel/qprintengine_win.cpp +++ b/src/printsupport/kernel/qprintengine_win.cpp @@ -1150,7 +1150,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant & d->updateMetrics(); d->doReinit(); #ifdef QT_DEBUG_METRICS - qDebug() << "QWin32PrintEngine::setProperty(PPK_Orientation," << orientation << ")"; + qDebug() << "QWin32PrintEngine::setProperty(PPK_Orientation," << orientation << ')'; d->debugMetrics(); #endif // QT_DEBUG_METRICS break; @@ -1173,7 +1173,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant & d->setPageSize(pageSize); d->doReinit(); #ifdef QT_DEBUG_METRICS - qDebug() << "QWin32PrintEngine::setProperty(PPK_PageSize," << value.toInt() << ")"; + qDebug() << "QWin32PrintEngine::setProperty(PPK_PageSize," << value.toInt() << ')'; d->debugMetrics(); #endif // QT_DEBUG_METRICS } @@ -1189,7 +1189,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant & d->setPageSize(pageSize); d->doReinit(); #ifdef QT_DEBUG_METRICS - qDebug() << "QWin32PrintEngine::setProperty(PPK_PaperName," << value.toString() << ")"; + qDebug() << "QWin32PrintEngine::setProperty(PPK_PaperName," << value.toString() << ')'; d->debugMetrics(); #endif // QT_DEBUG_METRICS } @@ -1228,7 +1228,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant & d->stretch_y = d->dpi_y / double(d->resolution); d->updateMetrics(); #ifdef QT_DEBUG_METRICS - qDebug() << "QWin32PrintEngine::setProperty(PPK_Resolution," << value.toInt() << ")"; + qDebug() << "QWin32PrintEngine::setProperty(PPK_Resolution," << value.toInt() << ')'; d->debugMetrics(); #endif // QT_DEBUG_METRICS break; @@ -1242,7 +1242,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant & d->setPageSize(pageSize); d->doReinit(); #ifdef QT_DEBUG_METRICS - qDebug() << "QWin32PrintEngine::setProperty(PPK_WindowsPageSize," << value.toInt() << ")"; + qDebug() << "QWin32PrintEngine::setProperty(PPK_WindowsPageSize," << value.toInt() << ')'; d->debugMetrics(); #endif // QT_DEBUG_METRICS break; @@ -1258,7 +1258,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant & d->setPageSize(pageSize); d->doReinit(); #ifdef QT_DEBUG_METRICS - qDebug() << "QWin32PrintEngine::setProperty(PPK_CustomPaperSize," << value.toSizeF() << ")"; + qDebug() << "QWin32PrintEngine::setProperty(PPK_CustomPaperSize," << value.toSizeF() << ')'; d->debugMetrics(); #endif // QT_DEBUG_METRICS } @@ -1273,7 +1273,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant & margins.at(2).toReal(), margins.at(3).toReal())); d->updateMetrics(); #ifdef QT_DEBUG_METRICS - qDebug() << "QWin32PrintEngine::setProperty(PPK_PageMargins," << margins << ")"; + qDebug() << "QWin32PrintEngine::setProperty(PPK_PageMargins," << margins << ')'; d->debugMetrics(); #endif // QT_DEBUG_METRICS break; @@ -1288,7 +1288,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant & d->setPageSize(pageSize); d->doReinit(); #ifdef QT_DEBUG_METRICS - qDebug() << "QWin32PrintEngine::setProperty(PPK_QPageSize," << pageSize << ")"; + qDebug() << "QWin32PrintEngine::setProperty(PPK_QPageSize," << pageSize << ')'; d->debugMetrics(); #endif // QT_DEBUG_METRICS } @@ -1301,7 +1301,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant & d->m_pageLayout.setMargins(pair.first); d->updateMetrics(); #ifdef QT_DEBUG_METRICS - qDebug() << "QWin32PrintEngine::setProperty(PPK_QPageMargins," << pair.first << pair.second << ")"; + qDebug() << "QWin32PrintEngine::setProperty(PPK_QPageMargins," << pair.first << pair.second << ')'; d->debugMetrics(); #endif // QT_DEBUG_METRICS break; @@ -1317,7 +1317,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant & d->m_pageLayout.setMargins(pageLayout.margins()); d->updateMetrics(); #ifdef QT_DEBUG_METRICS - qDebug() << "QWin32PrintEngine::setProperty(PPK_QPageLayout," << pageLayout << ")"; + qDebug() << "QWin32PrintEngine::setProperty(PPK_QPageLayout," << pageLayout << ')'; d->debugMetrics(); #endif // QT_DEBUG_METRICS } -- cgit v1.2.3