summaryrefslogtreecommitdiffstats
path: root/printer.cpp
diff options
context:
space:
mode:
authorGravatar Gehad elrobey <gehadelrobey@gmail.com>2015-08-22 16:05:13 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2015-08-22 18:39:08 +0300
commitcc864794753eb586e89470d87196e13568cb9031 (patch)
treecf15a36d12b315c38b40f06fe70c1bd398f4f07b /printer.cpp
parentf45fdc8660f912845f37809cae41e2f3b02bc800 (diff)
downloadsubsurface-cc864794753eb586e89470d87196e13568cb9031.tar.gz
Printing: replace usage of std::ceil()
std::ceil() in printer.cpp throws errors when compiled with mingw, so replace all std::ceil calls with qCeil(). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Diffstat (limited to 'printer.cpp')
-rw-r--r--printer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/printer.cpp b/printer.cpp
index 3068a6fef..f0197d446 100644
--- a/printer.cpp
+++ b/printer.cpp
@@ -207,8 +207,8 @@ void Printer::print()
connect(&t, SIGNAL(progressUpdated(int)), this, SLOT(templateProgessUpdated(int)));
dpi = printerPtr->resolution();
//rendering resolution = selected paper size in inchs * printer dpi
- pageSize.setHeight(std::ceil(printerPtr->pageRect(QPrinter::Inch).height() * dpi));
- pageSize.setWidth(std::ceil(printerPtr->pageRect(QPrinter::Inch).width() * dpi));
+ pageSize.setHeight(qCeil(printerPtr->pageRect(QPrinter::Inch).height() * dpi));
+ pageSize.setWidth(qCeil(printerPtr->pageRect(QPrinter::Inch).width() * dpi));
webView->page()->setViewportSize(pageSize);
webView->page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
// export border width with at least 1 pixel
@@ -237,7 +237,7 @@ void Printer::print()
if (divesPerPage == 0) {
flowRender();
} else {
- Pages = ceil(getTotalWork(printOptions) / (float)divesPerPage);
+ Pages = qCeil(getTotalWork(printOptions) / (float)divesPerPage);
render(Pages);
}
}