diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-07-28 07:27:30 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-07-28 07:27:30 -0700 |
commit | f2e2be0f67146941d9a05815db2d1335a975765e (patch) | |
tree | 31813fc61ad44048baf72cd71e016b521bd6afbe /printer.cpp | |
parent | 7d0c6f895d813b366a3c9ff5b26ed3db1b2fba02 (diff) | |
parent | 01645d64b91b29878d6927dcf7cd5c2381e0bfaa (diff) | |
download | subsurface-f2e2be0f67146941d9a05815db2d1335a975765e.tar.gz |
Merge branch 'custom-print' of github.com:neolit123/subsurface
Diffstat (limited to 'printer.cpp')
-rw-r--r-- | printer.cpp | 7 |
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); } |