summaryrefslogtreecommitdiffstats
path: root/src/printsupport
diff options
context:
space:
mode:
authorJarkko Koivikko <jarkko.koivikko@code-q.fi>2024-03-12 15:56:10 +0200
committerJarkko Koivikko <jarkko.koivikko@code-q.fi>2024-04-12 19:55:46 +0000
commit223b92490edfd4e3e75e634831258c54d5b0a501 (patch)
tree2509e245d5b56a0424e19b7855b1b684cfe131de /src/printsupport
parent5a775fc5f73ec3a39d17c261e4ea7e715eff44d1 (diff)
print: windows: Fix setting page orientation
Previously when PPK_Orientation property was set, updateMetrics() was called before doReinit() and updateMetrics() used physical dimensions of the DC initialized with previous orientation, which resulted in miscalculation of m_paintRectPixels, origin_x and origin_y variables. This bug manifested itself as all sorts of weird behavior, such as unexpected margins when changing paper size and printing beyond paper margins. Pick-to: 6.7 6.5 Change-Id: I2d0e104bee11165e3541e7f3119b29edd4b882c8 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/printsupport')
-rw-r--r--src/printsupport/platform/windows/qprintengine_win.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/printsupport/platform/windows/qprintengine_win.cpp b/src/printsupport/platform/windows/qprintengine_win.cpp
index e1ff6f1d83..d11f20dde2 100644
--- a/src/printsupport/platform/windows/qprintengine_win.cpp
+++ b/src/printsupport/platform/windows/qprintengine_win.cpp
@@ -1150,8 +1150,8 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &
d->devMode->dmOrientation = orientation == QPageLayout::Landscape ? DMORIENT_LANDSCAPE : DMORIENT_PORTRAIT;
d->devMode->dmFields |= DM_ORIENTATION;
d->m_pageLayout.setOrientation(orientation);
- d->updateMetrics();
d->doReinit();
+ d->updateMetrics();
#ifdef QT_DEBUG_METRICS
qDebug() << "QWin32PrintEngine::setProperty(PPK_Orientation," << orientation << ')';
d->debugMetrics();