From 8486d8dd941e56aaffeab179ef84c4a1b8992e6b Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Fri, 25 Jan 2019 01:47:34 +0300 Subject: [PATCH] Attempt to ignore printer rectangle if page size is equal to printer page size --- limereport/lrreportengine.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/limereport/lrreportengine.cpp b/limereport/lrreportengine.cpp index ab09828..0cd8628 100644 --- a/limereport/lrreportengine.cpp +++ b/limereport/lrreportengine.cpp @@ -323,14 +323,14 @@ void ReportEnginePrivate::printReport(ReportPages pages, QPrinter &printer) renderPage.pageItem()->rightMargin(), renderPage.pageItem()->bottomMargin(), QPrinter::Millimeter); - printer.setOrientation((QPrinter::Orientation)renderPage.pageItem()->pageOrientation()); + printer.setOrientation(static_cast(renderPage.pageItem()->pageOrientation())); QSizeF pageSize = (renderPage.pageItem()->pageOrientation()==PageItemDesignIntf::Landscape)? QSizeF(renderPage.pageItem()->sizeMM().height(),renderPage.pageItem()->sizeMM().width()): renderPage.pageItem()->sizeMM(); printer.setPaperSize(pageSize,QPrinter::Millimeter); } else { printer.setFullPage(renderPage.pageItem()->fullPage()); - printer.setOrientation((QPrinter::Orientation)renderPage.pageItem()->pageOrientation()); + printer.setOrientation(static_cast(renderPage.pageItem()->pageOrientation())); if (renderPage.pageItem()->pageSize()==PageItemDesignIntf::Custom){ QSizeF pageSize = (renderPage.pageItem()->pageOrientation()==PageItemDesignIntf::Landscape)? QSizeF(renderPage.pageItem()->sizeMM().height(),renderPage.pageItem()->sizeMM().width()): @@ -339,7 +339,7 @@ void ReportEnginePrivate::printReport(ReportPages pages, QPrinter &printer) printer.setPaperSize(pageSize,QPrinter::Millimeter); } else { if (page->getSetPageSizeToPrinter() || printer.outputFormat() == QPrinter::PdfFormat) - printer.setPaperSize((QPrinter::PageSize)renderPage.pageItem()->pageSize()); + printer.setPaperSize(static_cast(renderPage.pageItem()->pageSize())); } } @@ -354,7 +354,9 @@ void ReportEnginePrivate::printReport(ReportPages pages, QPrinter &printer) printerPageRect = QRectF(0,0,(printerPageRect.size().width() + rightMargin + leftMargin) * Const::mmFACTOR, (printerPageRect.size().height() + bottomMargin +topMargin) * Const::mmFACTOR); - if (printerPageRect.width() < page->geometry().width()){ + if (printer.pageSize() != static_cast(page->pageSize()) && + printerPageRect.width() < page->geometry().width()) + { qreal pageWidth = page->geometry().width(); QRectF currentPrintingRect = printerPageRect; while (pageWidth>0){