mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
PrintLayout: add estimateTotalDives()
estimateTotalDives() is used to calculate the total dives to be printed, it requires a 'struct dive' pointer and a couple of 'int' pointers for the iterator 'i' and 'total' return. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
ecf483db46
commit
08cf1be212
2 changed files with 15 additions and 0 deletions
|
|
@ -91,6 +91,17 @@ void PrintLayout::setup()
|
|||
scaledPageH = pageRect.height() / scaleY;
|
||||
}
|
||||
|
||||
// go trought the dive table and find how many dives we are a going to print
|
||||
void PrintLayout::estimateTotalDives(struct dive *dive, int *i, int *total) const
|
||||
{
|
||||
*total = 0;
|
||||
for_each_dive(*i, dive) {
|
||||
if (!dive->selected && printOptions->print_selected)
|
||||
continue;
|
||||
(*total)++;
|
||||
}
|
||||
}
|
||||
|
||||
/* the used formula here is:
|
||||
* s = (S - (n - 1) * p) / n
|
||||
* where:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue