lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 7bfe072 2/6: Replace an assertion with a more


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 7bfe072 2/6: Replace an assertion with a more elaborate alarum
Date: Sun, 30 Sep 2018 17:07:12 -0400 (EDT)

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

    Replace an assertion with a more elaborate alarum
---
 wx_table_generator.cpp | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
index 7c6fca0..2c6797f 100644
--- a/wx_table_generator.cpp
+++ b/wx_table_generator.cpp
@@ -23,6 +23,7 @@
 
 #include "wx_table_generator.hpp"
 
+#include "alert.hpp"
 #include "assert_lmi.hpp"
 #include "miscellany.hpp"               // count_newlines(), split_into_lines()
 #include "ssize_lmi.hpp"
@@ -247,7 +248,17 @@ void wx_table_generator::output_super_header
 
     for(auto const& i : lines)
         {
-        LMI_ASSERT(dc().GetTextExtent(i).x <= rect.width);
+        if(rect.width < dc().GetTextExtent(i).x)
+            {
+            alarum()
+                << "Superheader width ("
+                << dc().GetTextExtent(i).x
+                << ") exceeds available space ("
+                << rect.width
+                << "): text is '" << i << "'."
+                << LMI_FLUSH
+                ;
+            }
         dc_.DrawLabel(i, rect, wxALIGN_CENTER_HORIZONTAL);
         rect.y += row_height_;
         pos_y  += row_height_;



reply via email to

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