From 50ec06da2c8a1c680d48b84f8c1267fe78a86b6a Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 25 Oct 2012 06:43:01 +0200 Subject: Only use the user set page margins for custom paper When the QPrinter is initalized then it will set up page margins based on the default paper size. If the paper size is changed to be a custom one then it should disregard the margins for the default paper size. If the page margins are set explicitly beforehand then it will use these page margins. Change-Id: Ic535c3a80b8b217dbd5eb5f4fb2cbc0ab1354563 Reviewed-by: Titta Heikkala Reviewed-by: Friedemann Kleint Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/plugins/platforms/cocoa/qprintengine_mac.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/cocoa/qprintengine_mac.mm b/src/plugins/platforms/cocoa/qprintengine_mac.mm index f2c567f0eb..94c89ad8db 100644 --- a/src/plugins/platforms/cocoa/qprintengine_mac.mm +++ b/src/plugins/platforms/cocoa/qprintengine_mac.mm @@ -795,13 +795,15 @@ QVariant QMacPrintEngine::property(PrintEnginePropertyKey key) const if (d->hasCustomPageMargins) { margins << d->leftMargin << d->topMargin << d->rightMargin << d->bottomMargin; - } else { + } else if (!d->hasCustomPaperSize) { PMPaperMargins paperMargins; PMPaper paper; PMGetPageFormatPaper(d->format(), &paper); PMPaperGetMargins(paper, &paperMargins); margins << paperMargins.left << paperMargins.top << paperMargins.right << paperMargins.bottom; + } else { + margins << 0 << 0 << 0 << 0; } ret = margins; break; -- cgit v1.2.3