lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] odd/zero_columns ced5a90 4/7: Suppress a misleading


From: Greg Chicares
Subject: [lmi-commits] [lmi] odd/zero_columns ced5a90 4/7: Suppress a misleading error message when no columns are requested
Date: Mon, 6 May 2019 07:21:22 -0400 (EDT)

branch: odd/zero_columns
commit ced5a90cde731975907f52a9eecc88a60f9cacbc
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Suppress a misleading error message when no columns are requested
    
    The error message
      "Not enough room for even the first column."
    suggests that at least one column was requested and the first is too
    wide. If no columns were requested, then there is no first column
    (so the error message was misleading), and all (zero) columns should
    fit in a table (so throwing an exception was wrong).
---
 report_table.cpp | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/report_table.cpp b/report_table.cpp
index 0972569..03dfd40 100644
--- a/report_table.cpp
+++ b/report_table.cpp
@@ -127,21 +127,9 @@ std::vector<int> set_column_widths
         else break;
         }
 
-    if(0 == n_columns_to_show)
+    if(0 == n_columns_to_show && 0 != cardinality)
         {
-        warning()
-            << "BIG TROUBLE\n"
-            << max_table_width << " max_table_width\n"
-            << desired_margin << " desired_margin\n"
-            << minimum_margin << " minimum_margin\n"
-            << cardinality << " cardinality\n"
-// Indexing [0] would crash:
-//          << all_columns[0].col_width() << " all_columns[0].col_width()\n"
-            << data_width << " data_width\n"
-            << LMI_FLUSH
-            ;
-        warning() << "Not enough room for even the first column." << LMI_FLUSH;
-//      alarum() << "Not enough room for even the first column." << LMI_FLUSH;
+        alarum() << "Not enough room for even the first column." << LMI_FLUSH;
         }
 
     // These two are boolean, but vector<bool> isn't a Container.



reply via email to

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