lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master fad1828 03/13: Explicitly assert some implici


From: Greg Chicares
Subject: [lmi-commits] [lmi] master fad1828 03/13: Explicitly assert some implicit assumptions
Date: Tue, 8 May 2018 19:51:05 -0400 (EDT)

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

    Explicitly assert some implicit assumptions
    
    See output_header() discussion here:
      https://lists.nongnu.org/archive/html/lmi/2018-04/msg00135.html
---
 wx_table_generator.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
index b822816..4c24db4 100644
--- a/wx_table_generator.cpp
+++ b/wx_table_generator.cpp
@@ -768,6 +768,12 @@ void wx_table_generator::output_header
     if(use_bold_headers_)
         {
         header_font_setter.Set(get_header_font());
+        // The distance from the font's descender line to its ascender
+        // line must not exceed the distance between lines.
+        LMI_ASSERT(dc_.GetCharHeight() <= row_height());
+        // do_output_values(), called below, uses a cached char_height_
+        // that is assumed not to differ from the bold GetCharHeight().
+        LMI_ASSERT(dc_.GetCharHeight() == char_height_);
         }
 
     // Split headers in single lines and fill up the entire columns*lines 2D



reply via email to

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