lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 48f47f6: Fix group quotes output to conform t


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 48f47f6: Fix group quotes output to conform to pagination logic
Date: Mon, 20 Aug 2018 10:03:19 -0400 (EDT)

branch: master
commit 48f47f6a7dc0f5630826d550553e4b1faa13652e
Author: Vadim Zeitlin <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Fix group quotes output to conform to pagination logic
    
    Actually output the number of rows we're supposed to output per page
    according to compute_pages_for_table_rows() logic instead of (almost
    always) outputting one more than computed.
    
    Do this by checking whether the next row will fit into the available
    space before outputting it and not after.
    
    This also fixes assertions about the footer not fitting on the last page
    which actually happened because, for big enough censuses, we outputted
    one less page than planned due to the off-by-1 error above.
---
 group_quote_pdf_gen_wx.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/group_quote_pdf_gen_wx.cpp b/group_quote_pdf_gen_wx.cpp
index c052fb5..787fd41 100644
--- a/group_quote_pdf_gen_wx.cpp
+++ b/group_quote_pdf_gen_wx.cpp
@@ -753,7 +753,8 @@ void group_quote_pdf_generator_wx::save(std::string const& 
output_filename)
 
         table_gen.output_row(pos_y, visible_values);
 
-        if(last_row_y <= pos_y)
+        // If there is no space left for another row, start a new page.
+        if(last_row_y <= pos_y + table_gen.row_height())
             {
             output_page_number_and_version(pdf_writer, total_pages, 
current_page);
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]