lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 40a94aa 12/12: Explain why width of an elasti


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 40a94aa 12/12: Explain why width of an elastic column is initialized to zero
Date: Tue, 22 May 2018 17:09:23 -0400 (EDT)

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

    Explain why width of an elastic column is initialized to zero
---
 wx_table_generator.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
index a255c3b..96a2ba7 100644
--- a/wx_table_generator.cpp
+++ b/wx_table_generator.cpp
@@ -284,6 +284,10 @@ void wx_table_generator::enroll_column(column_parameters 
const& z)
     // A hidden column's width must be initialized to zero, because
     // other member functions calculate total width by accumulating
     // the widths of all columns, whether hidden or not.
+    //
+    // An elastic column's width must be initialized to zero, because
+    // compute_column_widths() skips setting it when there's no room
+    // for any elastic column.
     int width = 0;
     if(oe_shown == z.visibility)
         {
@@ -318,8 +322,7 @@ LMI_ASSERT(std::size_t(h / lh) == 1u + 
count_newlines(z.header));
                 break;
             case oe_elastic:
                 {
-                // Set width to the special value of 0 for the elastic columns.
-                width = 0;
+                ; // Do nothing: 'width' already initialized to zero.
                 }
                 break;
             }



reply via email to

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