lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master e6009c1 5/5: Demote an assertion to a conditi


From: Greg Chicares
Subject: [lmi-commits] [lmi] master e6009c1 5/5: Demote an assertion to a conditional
Date: Mon, 30 Jul 2018 07:23:16 -0400 (EDT)

branch: master
commit e6009c1c7d01b51386a11c8ced4b6a75d79b3bfc
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Demote an assertion to a conditional
    
    Replaced, in effect,
      assert(is_safe_to_execute_next_statement); foo();
    by
      if(is_safe_to_execute_next_statement) {foo();}
    
    The assertion has been observed to fail:
    
    https://lists.nongnu.org/archive/html/lmi/2018-07/msg00020.html
    | Assertion '0 <= ci.col_width - column_margin()' failed.
    
    and the obvious workaround is to bypass the block where it fails, so
    it really should be a conditional: if there's no room for an elastic
    column, then is should be omitted, silently.
---
 wx_table_generator.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
index 17bbc4a..0793757 100644
--- a/wx_table_generator.cpp
+++ b/wx_table_generator.cpp
@@ -464,12 +464,11 @@ void wx_table_generator::do_output_single_row
                     break;
                 }
 
-            if(ci.is_clipped())
+            if(ci.is_clipped() && 0 <= ci.col_width() - one_em_)
                 {
                 // Write clipped text with bilateral column margins:
                 //  - aligned left, indented 1em for a left margin; and
                 //  - clipped on the right to width minus a 1em margin.
-                LMI_ASSERT(0 <= ci.col_width() - one_em_);
                 wxDCClipper clip
                     (dc_
                     ,wxRect



reply via email to

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