lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master cc8d6e6 4/6: Fix table column shrinking when


From: Greg Chicares
Subject: [lmi-commits] [lmi] master cc8d6e6 4/6: Fix table column shrinking when some columns are hidden
Date: Thu, 8 Mar 2018 21:04:49 -0500 (EST)

branch: master
commit cc8d6e6475f36a1da795d7235a99d63a65eb0fed
Author: Vadim Zeitlin <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Fix table column shrinking when some columns are hidden
    
    Only count the visible columns as the hidden ones don't contribute to
    the total column width in any case and so can't be shrunk.
---
 wx_table_generator.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
index 78c73cb..846254c 100644
--- a/wx_table_generator.cpp
+++ b/wx_table_generator.cpp
@@ -175,6 +175,7 @@ void 
wx_table_generator::do_compute_column_widths_if_necessary()
 
     has_column_widths_ = true;
 
+    int num_columns = 0; // This counts only visible columns.
     int num_expand = 0;
     int total_fixed = 0;
 
@@ -185,6 +186,8 @@ void 
wx_table_generator::do_compute_column_widths_if_necessary()
             continue;
             }
 
+        num_columns++;
+
         if(0 == i.width_)
             {
             num_expand++;
@@ -204,7 +207,6 @@ void 
wx_table_generator::do_compute_column_widths_if_necessary()
         // reduce them by up to half if really needed.
         if(!num_expand)
             {
-            int const num_columns = columns_.size();
             auto const overflow_per_column =
                 (overflow + num_columns - 1)/num_columns;
             if(overflow_per_column <= column_margin_)



reply via email to

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