lmi-commits
[Top][All Lists]
Advanced

[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);



reply via email to

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