mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Print: rename the variable 'isHeading' to 'newHeading'
This better describes what the variable (flag) does. It's used to inform the loop that the last row goes our of the page limit and that we need to place a new heading on a new page. In that context 'newHeading' is more meaningful. The name 'isHeading' is confusing for (i == 0), since it remains 'false' yet the 0 index row is actually a heading. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
81125d190a
commit
cec1ea182e
1 changed files with 4 additions and 4 deletions
|
@ -385,7 +385,7 @@ void PrintLayout::printTable()
|
||||||
* two should be enough! */
|
* two should be enough! */
|
||||||
const int passes[] = { 70, 10 };
|
const int passes[] = { 70, 10 };
|
||||||
int tableHeight = 0, lastAccIndex = 0, rowH, accH, headings, headingRowHeightD2, headingRowHeight;
|
int tableHeight = 0, lastAccIndex = 0, rowH, accH, headings, headingRowHeightD2, headingRowHeight;
|
||||||
bool isHeading = false;
|
bool newHeading = false;
|
||||||
|
|
||||||
for (unsigned int pass = 0; pass < sizeof(passes) / sizeof(passes[0]); pass++) {
|
for (unsigned int pass = 0; pass < sizeof(passes) / sizeof(passes[0]); pass++) {
|
||||||
progress = headings = accH = 0;
|
progress = headings = accH = 0;
|
||||||
|
@ -399,15 +399,15 @@ void PrintLayout::printTable()
|
||||||
if (rowH > pageH - headingRowHeight) // skip huge rows. we don't support row spanning on multiple pages.
|
if (rowH > pageH - headingRowHeight) // skip huge rows. we don't support row spanning on multiple pages.
|
||||||
continue;
|
continue;
|
||||||
accH += rowH;
|
accH += rowH;
|
||||||
if (isHeading) {
|
if (newHeading) {
|
||||||
headings += rowH;
|
headings += rowH;
|
||||||
isHeading = false;
|
newHeading = false;
|
||||||
}
|
}
|
||||||
if (accH > pageH) {
|
if (accH > pageH) {
|
||||||
lastAccIndex = i;
|
lastAccIndex = i;
|
||||||
pageIndexes.append(pageIndexes.last() + (accH - rowH));
|
pageIndexes.append(pageIndexes.last() + (accH - rowH));
|
||||||
addTablePrintHeadingRow(&model, i);
|
addTablePrintHeadingRow(&model, i);
|
||||||
isHeading = true;
|
newHeading = true;
|
||||||
accH = 0;
|
accH = 0;
|
||||||
i--;
|
i--;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue