[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 1612829 3/6: Investigate failure of the asser
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 1612829 3/6: Investigate failure of the assertion just added |
Date: |
Wed, 22 Aug 2018 19:18:24 -0400 (EDT) |
branch: master
commit 16128296ede3584f4c56967a66c2477f6b51df44
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Investigate failure of the assertion just added
Added temporary instrumentation. It shows that strings in super-headers
typically either fit in the intended rectangle, or exceed it slightly:
e.g., 104 points of text in a rectangle of width 94.
---
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 f7ee1df..a361d0b 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"
@@ -216,7 +217,17 @@ void wx_table_generator::output_super_header
for(auto const& i : lines)
{
- LMI_ASSERT(dc().GetTextExtent(i).x <= rect.width);
+// LMI_ASSERT(dc().GetTextExtent(i).x <= rect.width);
+ if(rect.width < dc().GetTextExtent(i).x)
+ {
+ warning()
+ << "Super-header transgresses its rectangle:\n"
+ << "'" << i << "' super-header text\n"
+ << dc().GetTextExtent(i).x << " dc().GetTextExtent(i).x\n"
+ << rect.width << " rect.width\n"
+ << LMI_FLUSH
+ ;
+ }
dc_.DrawLabel(i, rect, wxALIGN_CENTER_HORIZONTAL);
rect.y += row_height_;
pos_y += row_height_;
- [lmi-commits] [lmi] master updated (d5a3be5 -> 4da8dbb), Greg Chicares, 2018/08/22
- [lmi-commits] [lmi] master 6330347 2/6: Assert an apparent requirement, Greg Chicares, 2018/08/22
- [lmi-commits] [lmi] master 1612829 3/6: Investigate failure of the assertion just added,
Greg Chicares <=
- [lmi-commits] [lmi] master 4e69646 4/6: Work around the problem analyzed in the preceding commit, Greg Chicares, 2018/08/22
- [lmi-commits] [lmi] master 4da8dbb 6/6: Remove parallel implementation and its associated assertion, Greg Chicares, 2018/08/22
- [lmi-commits] [lmi] master 3f962fd 1/6: Make minimum margin a set_column_widths() argument, Greg Chicares, 2018/08/22
- [lmi-commits] [lmi] master f0673e0 5/6: Fix the problem analyzed in the penultimate commit, Greg Chicares, 2018/08/22