[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master ed689f9 6/6: Remove temporary assertions adde
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master ed689f9 6/6: Remove temporary assertions added in the last commit |
Date: |
Fri, 25 May 2018 07:00:58 -0400 (EDT) |
branch: master
commit ed689f916cc0184f47c374257afe6b0aec3d9f0c
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Remove temporary assertions added in the last commit
---
group_quote_pdf_gen_wx.cpp | 2 --
miscellany.cpp | 2 --
wx_table_generator.cpp | 18 ++++++++----------
3 files changed, 8 insertions(+), 14 deletions(-)
diff --git a/group_quote_pdf_gen_wx.cpp b/group_quote_pdf_gen_wx.cpp
index dcf727a..b2c7d99 100644
--- a/group_quote_pdf_gen_wx.cpp
+++ b/group_quote_pdf_gen_wx.cpp
@@ -823,9 +823,7 @@ int
group_quote_pdf_generator_wx::compute_pages_for_table_rows
int const first_row_y = pdf_writer.get_vert_margin() + header_height;
int const page_area_y = last_row_y - first_row_y;
int const rows_per_page = page_area_y / row_height;
- auto total_pagesX = total_pages + (remaining_rows + rows_per_page - 1)
/ rows_per_page;
total_pages += outward_quotient(remaining_rows, rows_per_page);
-LMI_ASSERT(total_pagesX == total_pages);
*remaining_space = page_area_y;
remaining_rows %= rows_per_page;
}
diff --git a/miscellany.cpp b/miscellany.cpp
index 193d544..467c171 100644
--- a/miscellany.cpp
+++ b/miscellany.cpp
@@ -315,9 +315,7 @@ int page_count
int const used_per_page = groups_per_page * rows_per_group;
// Finally determine how many pages are needed to show all the rows.
- int number_of_pagesX = (total_rows + used_per_page - 1) / used_per_page;
int number_of_pages = outward_quotient(total_rows, used_per_page);
-LMI_ASSERT(number_of_pagesX == number_of_pages);
// The last page may not be needed if all the rows on it can fit into the
// remaining space, too small for a full group, but perhaps sufficient for
diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
index 85e4a42..5bb02bb 100644
--- a/wx_table_generator.cpp
+++ b/wx_table_generator.cpp
@@ -398,11 +398,10 @@ void wx_table_generator::compute_column_widths()
// Also calculate the number of pixels by which it overflows for each column
// We need to round up in division here to be sure that all columns
// fit into the available width.
- auto const overflow_per_columnX =
- (overflow + number_of_columns - 1) / number_of_columns;
- auto const overflow_per_column =
- outward_quotient(overflow, number_of_columns);
-LMI_ASSERT(overflow_per_columnX == overflow_per_column);
+ auto const overflow_per_column = outward_quotient
+ (overflow
+ ,number_of_columns
+ );
// Now determine whether reducing the margins will make the table fit.
// If that works, then do it; else don't do it, and print a warning.
//
@@ -500,11 +499,10 @@ LMI_ASSERT(overflow_per_columnX == overflow_per_column);
// to consume all available space.
if(number_of_elastic_columns)
{
- int const width_of_each_elastic_columnX
- = (total_width_ - total_inelastic_width +
number_of_elastic_columns - 1) / number_of_elastic_columns;
- int const width_of_each_elastic_column
- = outward_quotient(total_width_ - total_inelastic_width,
number_of_elastic_columns);
-LMI_ASSERT(width_of_each_elastic_columnX == width_of_each_elastic_column);
+ int const width_of_each_elastic_column = outward_quotient
+ (total_width_ - total_inelastic_width
+ ,number_of_elastic_columns
+ );
for(auto& i : all_columns_)
{
- [lmi-commits] [lmi] master updated (9f0eebc -> ed689f9), Greg Chicares, 2018/05/25
- [lmi-commits] [lmi] master 43d57bf 1/6: Consolidate and improve commentary, Greg Chicares, 2018/05/25
- [lmi-commits] [lmi] master e21dd5c 5/6: Refactor: use outward_quotient(), asserting equivalence, Greg Chicares, 2018/05/25
- [lmi-commits] [lmi] master ed689f9 6/6: Remove temporary assertions added in the last commit,
Greg Chicares <=
- [lmi-commits] [lmi] master 1f212b8 4/6: Rename math_functors* to math_functions*, Greg Chicares, 2018/05/25
- [lmi-commits] [lmi] master ce477e3 3/6: Add a utility function for integer division rounded outward, Greg Chicares, 2018/05/25
- [lmi-commits] [lmi] master 4c4abe6 2/6: Store specimen font measurements statically for reference, Greg Chicares, 2018/05/25