summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_adapter.cpp
diff options
context:
space:
mode:
authorMichael Brüning <michael.bruning@qt.io>2018-02-26 14:38:13 +0100
committerKai Koehne <kai.koehne@qt.io>2018-03-06 07:26:35 +0000
commit66a6518422bb32a85a481088a213a790ffd48785 (patch)
tree920945700398fa97a6f8e734137971ca16c1d910 /src/core/web_contents_adapter.cpp
parent0d9ba4179245d89e163494ea0a3652e790ec08a0 (diff)
Explicitly use custom margins for printing to pdf
3cec2ccb0ffdd41a41ab55d4c1ba88d4866e71d1 introduced a regression because it was assumed that the page was only printed to pdf when a filename was given. This is not the case when the pdf data is handed to the callback, though. Correct this by explicitly stating when margins should be used. Task-number: QTBUG-66654 Change-Id: I663f578ff5d01c77cc62e6f3756a17f78168a9aa Reviewed-by: Szabolcs David <davidsz@inf.u-szeged.hu> Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r--src/core/web_contents_adapter.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index c7b2e6e93..081dbd28d 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -1149,7 +1149,8 @@ void WebContentsAdapter::printToPDF(const QPageLayout &pageLayout, const QString
}
quint64 WebContentsAdapter::printToPDFCallbackResult(const QPageLayout &pageLayout,
- const bool colorMode)
+ bool colorMode,
+ bool useCustomMargins)
{
#if BUILDFLAG(ENABLE_BASIC_PRINTING)
Q_D(WebContentsAdapter);
@@ -1158,6 +1159,7 @@ quint64 WebContentsAdapter::printToPDFCallbackResult(const QPageLayout &pageLayo
d->nextRequestId);
PrintViewManagerQt::FromWebContents(webContents())->PrintToPDFWithCallback(pageLayout,
colorMode,
+ useCustomMargins,
callback);
return d->nextRequestId++;
#else