[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 271db22 14/15: Fix over eager assert in pdf_w
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 271db22 14/15: Fix over eager assert in pdf_writer_wx::output_html() |
Date: |
Fri, 27 Jul 2018 17:23:17 -0400 (EDT) |
branch: master
commit 271db223c99b5af88d6edb3bebb57cc6bdceccba
Author: Vadim Zeitlin <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Fix over eager assert in pdf_writer_wx::output_html()
Only check for overflowing the page when rendering, not when measuring.
This avoids spurious assertion failures when generating group quotes
consisting from more than one page.
---
pdf_writer_wx.cpp | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/pdf_writer_wx.cpp b/pdf_writer_wx.cpp
index 5e6903d..4fd7c03 100644
--- a/pdf_writer_wx.cpp
+++ b/pdf_writer_wx.cpp
@@ -304,9 +304,20 @@ int pdf_writer_wx::output_html
,output_mode
);
- // Should have fit on this page, otherwise this is not the right overload
- // to use -- call paginate_html() and the generic overload above instead.
- LMI_ASSERT(height <= get_total_height() - y);
+ switch(output_mode)
+ {
+ case oe_render:
+ // When rendering, all the text should have fit on this page,
+ // otherwise this is not the right overload to use -- call
+ // paginate_html() and the generic overload above instead.
+ LMI_ASSERT(height <= get_total_height() - y);
+ break;
+ case oe_only_measure:
+ // It's fine if the output doesn't fit when measuring it, as this
+ // could be used to decide whether another page is needed or not,
+ // so don't do anything here.
+ break;
+ }
return height;
}
- [lmi-commits] [lmi] master updated (caaecd8 -> 12d84c9), Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master 37e9b0b 01/15: Update to wxWidgets v3.1.1-319-g9daf5bec98 snapshot, Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master 6465704 04/15: Restore the use of wxDCClipper in PDF table generation code, Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master a8d5e26 08/15: Look for image files referenced in templates under data directory, Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master 005b3eb 06/15: Replace pdf_writer_wx::get_page_height() with get_total_height(), Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master 28e3c42 11/15: Remove workarounds for wx 3.1.1 warnings not relevant any more, Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master b6b6827 03/15: Do call EndPage() in PDF generation code, Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master a86d90a 02/15: Use more recent wxPdfDocument fixing the text origin bug, Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master 554eb23 13/15: Forbid page breaks inside paragraphs in the illustrations, Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master 271db22 14/15: Fix over eager assert in pdf_writer_wx::output_html(),
Greg Chicares <=
- [lmi-commits] [lmi] master 12d84c9 15/15: Fix regression in font sizes used for the group quotes PDF, Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master 2bd38fa 12/15: Use standard <img> tag instead of <scaled_image> in templates, Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master 4cfcfe4 07/15: Refactor: remove render_page_template() helper function, Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master e821acd 05/15: Require specifying font sizes when using pdf_writer_wx, Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master c56a67f 09/15: Implement and use simple HTML output pagination, Greg Chicares, 2018/07/27
- [lmi-commits] [lmi] master f03ff64 10/15: Merge first two notes pages of regular individual illustrations, Greg Chicares, 2018/07/27