summaryrefslogtreecommitdiffstats
path: root/printer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'printer.cpp')
-rw-r--r--printer.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/printer.cpp b/printer.cpp
index 5b1995501..10942865a 100644
--- a/printer.cpp
+++ b/printer.cpp
@@ -160,7 +160,12 @@ void Printer::print()
divesPerPage = 1; // print each dive in a single page if the attribute is missing or malformed
//TODO: show warning
}
- int Pages = ceil(getTotalWork(printOptions) / (float)divesPerPage);
+ int Pages;
+ if (divesPerPage == 0) {
+ Pages = ceil(webView->page()->mainFrame()->contentsSize().height() / (float)pageSize.height());
+ } else {
+ Pages = ceil(getTotalWork(printOptions) / (float)divesPerPage);
+ }
render(Pages);
}