[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master bb36d25 02/13: Assert that measure-only and r
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master bb36d25 02/13: Assert that measure-only and render passes have the same side effects |
Date: |
Tue, 8 May 2018 19:51:05 -0400 (EDT) |
branch: master
commit bb36d25613aaf667f596cd792d6d64ebca8e6bf8
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Assert that measure-only and render passes have the same side effects
---
wx_table_generator.cpp | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
index 25c8b07..b822816 100644
--- a/wx_table_generator.cpp
+++ b/wx_table_generator.cpp
@@ -751,12 +751,14 @@ void wx_table_generator::output_header
,oenum_render_or_only_measure output_mode
)
{
+ int const anticipated_pos_y = *pos_y + row_height() * max_header_lines_;
+
switch(output_mode)
{
case oe_render:
break;
case oe_only_measure:
- *pos_y += max_header_lines_ * row_height_;
+ *pos_y = anticipated_pos_y;
return;
}
@@ -809,6 +811,8 @@ void wx_table_generator::output_header
do_output_horz_separator(left_margin_, x, *pos_y - 1);
do_output_horz_separator(left_margin_, x, *pos_y );
}
+
+ LMI_ASSERT(anticipated_pos_y == *pos_y);
}
void wx_table_generator::output_super_header
@@ -820,13 +824,14 @@ void wx_table_generator::output_super_header
)
{
std::vector<std::string> const lines(split_into_lines(header));
+ int const anticipated_pos_y = *pos_y + row_height() * lines.size();
switch(output_mode)
{
case oe_render:
break;
case oe_only_measure:
- *pos_y += row_height_ * lines.size();
+ *pos_y = anticipated_pos_y;
return;
}
@@ -844,6 +849,8 @@ void wx_table_generator::output_super_header
rect.y += row_height_;
*pos_y += row_height_;
}
+
+ LMI_ASSERT(anticipated_pos_y == *pos_y);
}
void wx_table_generator::output_row
- [lmi-commits] [lmi] master updated (05e57fd -> 0c90de6), Greg Chicares, 2018/05/08
- [lmi-commits] [lmi] master 1480161 06/13: Add more detail to a comment, Greg Chicares, 2018/05/08
- [lmi-commits] [lmi] master bb36d25 02/13: Assert that measure-only and render passes have the same side effects,
Greg Chicares <=
- [lmi-commits] [lmi] master 86ed6fe 01/13: Correct a comment, Greg Chicares, 2018/05/08
- [lmi-commits] [lmi] master fad1828 03/13: Explicitly assert some implicit assumptions, Greg Chicares, 2018/05/08
- [lmi-commits] [lmi] master b0c3633 05/13: Improve documentation, Greg Chicares, 2018/05/08
- [lmi-commits] [lmi] master d5096d9 11/13: Paste out to spreadsheet: show dates as YYYYMMDD, Greg Chicares, 2018/05/08
- [lmi-commits] [lmi] master d92a865 09/13: Grow only multiline "Comments" control, Greg Chicares, 2018/05/08
- [lmi-commits] [lmi] master a5d5799 10/13: Widen all date-picker controls, Greg Chicares, 2018/05/08
- [lmi-commits] [lmi] master 274f13e 04/13: Assert that the clipping width is nonnegative, Greg Chicares, 2018/05/08
- [lmi-commits] [lmi] master 6ac7331 07/13: Use a dummy name for a dummy variable, Greg Chicares, 2018/05/08
- [lmi-commits] [lmi] master 0c90de6 13/13: Designate release candidate 20180508T2349Z, Greg Chicares, 2018/05/08
- [lmi-commits] [lmi] master 7320efb 08/13: Adjust layout of certain controls, Greg Chicares, 2018/05/08