[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 2207a63 3/6: Refactor: move one line, for a r
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 2207a63 3/6: Refactor: move one line, for a reason soon to be revealed |
Date: |
Fri, 7 Sep 2018 19:33:54 -0400 (EDT) |
branch: master
commit 2207a63ec5ab9a6bf5da068d70ccc3206e096053
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Refactor: move one line, for a reason soon to be revealed
---
report_table.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/report_table.cpp b/report_table.cpp
index bb801f4..807c9e5 100644
--- a/report_table.cpp
+++ b/report_table.cpp
@@ -208,11 +208,12 @@ paginator::paginator(int total_rows, int rows_per_group,
int max_lines_per_page)
page_count_ = outward_quotient(total_rows_, rows_per_page_);
+ int const rows_on_last_page = total_rows_ - (page_count_ - 1) *
rows_per_page_;
+
// Avoid widowing a partial group on the last page, by moving it
// to the preceding page if there's room.
if(1 < page_count_)
{
- int const rows_on_last_page = total_rows_ - (page_count_ - 1) *
rows_per_page_;
int const free_lines = max_lines_per_page_ - lines_per_group_ *
groups_per_page_;
LMI_ASSERT(free_lines < rows_per_group_);
if(rows_on_last_page <= free_lines)
- [lmi-commits] [lmi] master updated (7376c94 -> f27b89f), Greg Chicares, 2018/09/07
- [lmi-commits] [lmi] master 033d6b6 2/6: Avoid 'auto' where it is not helpful, Greg Chicares, 2018/09/07
- [lmi-commits] [lmi] master 2207a63 3/6: Refactor: move one line, for a reason soon to be revealed,
Greg Chicares <=
- [lmi-commits] [lmi] master ef971ec 1/6: Move test_main function to end where it belongs, Greg Chicares, 2018/09/07
- [lmi-commits] [lmi] master baa8825 5/6: Calculate the exact number of lines on the last page, Greg Chicares, 2018/09/07
- [lmi-commits] [lmi] master a873fa4 4/6: Introduce additional paginator data members, Greg Chicares, 2018/09/07
- [lmi-commits] [lmi] master f27b89f 6/6: Demonstrate pagination with the simplest possible control structure, Greg Chicares, 2018/09/07