[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] odd/zero_columns 08a994b 6/7: Comment early-return s
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] odd/zero_columns 08a994b 6/7: Comment early-return statement that are not in master |
Date: |
Mon, 6 May 2019 07:21:25 -0400 (EDT) |
branch: odd/zero_columns
commit 08a994b9025808c0f26b85018043cd8a968e4077
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Comment early-return statement that are not in master
---
wx_table_generator.cpp | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
index af5158f..50f714e 100644
--- a/wx_table_generator.cpp
+++ b/wx_table_generator.cpp
@@ -177,6 +177,9 @@ void wx_table_generator::output_headers
,oenum_render_or_only_measure output_mode
)
{
+ // Does this added line prevent any actual problem?
+ if(0 == lmi::ssize(all_columns_)) return;
+
int const anticipated_pos_y =
pos_y
+ draw_separators_
@@ -234,12 +237,6 @@ void wx_table_generator::output_headers
,headers_by_line.begin() + (1 + i) * number_of_columns
);
x = left_margin_;
-if(0 == lmi::ssize(all_columns_))
- {
- warning() << __LINE__ << " RETURNING" << LMI_FLUSH;
- pos_y = anticipated_pos_y;
- return;
- }
do_output_single_row(x, pos_y, nth_line);
}
@@ -386,6 +383,9 @@ void wx_table_generator::output_horz_separator
if(!(begin_column < end_column))
{
+ // This assertion really would fail. Is
+ // begin_column < end_column
+ // a precondition?
warning() << "assertion would have failed" << LMI_FLUSH; return;
}
LMI_ASSERT(begin_column < end_column);
@@ -431,6 +431,7 @@ wxRect wx_table_generator::external_text_rect(int a_column,
int y) const
wxRect wx_table_generator::text_rect(int column, int y) const
{
+ // Does this added line prevent any actual problem?
if(!(column < lmi::ssize(all_columns()))) return wxRect{};
LMI_ASSERT(column < lmi::ssize(all_columns()));
wxRect z = cell_rect(column, y).Deflate(dc().GetCharWidth(), 0);
- [lmi-commits] [lmi] odd/zero_columns updated (f5a1790 -> e5b9a61), Greg Chicares, 2019/05/06
- [lmi-commits] [lmi] odd/zero_columns b503329 1/7: Remove lines that served only to locate failures, Greg Chicares, 2019/05/06
- [lmi-commits] [lmi] odd/zero_columns 8e2dd5d 2/7: Don't circumvent an assertion that does not fail, Greg Chicares, 2019/05/06
- [lmi-commits] [lmi] odd/zero_columns 7c26437 3/7: Rewrite a couple of lines for clarity, Greg Chicares, 2019/05/06
- [lmi-commits] [lmi] odd/zero_columns e5b9a61 7/7: Remove an unnecessary early-return statement, Greg Chicares, 2019/05/06
- [lmi-commits] [lmi] odd/zero_columns 29925fd 5/7: Explain a seeming anomaly, Greg Chicares, 2019/05/06
- [lmi-commits] [lmi] odd/zero_columns 08a994b 6/7: Comment early-return statement that are not in master,
Greg Chicares <=
- [lmi-commits] [lmi] odd/zero_columns ced5a90 4/7: Suppress a misleading error message when no columns are requested, Greg Chicares, 2019/05/06