lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 274f13e 04/13: Assert that the clipping width


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 274f13e 04/13: Assert that the clipping width is nonnegative
Date: Tue, 8 May 2018 19:51:05 -0400 (EDT)

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

    Assert that the clipping width is nonnegative
    
    See the "wxDCClipper" discussion here:
      https://lists.nongnu.org/archive/html/lmi/2018-04/msg00135.html
---
 wx_table_generator.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
index 4c24db4..87dca47 100644
--- a/wx_table_generator.cpp
+++ b/wx_table_generator.cpp
@@ -678,6 +678,14 @@ void wx_table_generator::do_output_values
 
             if(ci.needs_clipping())
                 {
+                // It is assumed that the width of the "Participant" column
+                // on a group quote was initially zero, and then was expanded
+                // by some positive amount, and then incremented by one times
+                // the margin (not two times the margin as for other columns,
+                // because this column has only a left-hand unlateral margin).
+                // Make sure that any failure in this chain of assumptions
+                // doesn't result in (undefined) negative clipping.
+                LMI_ASSERT(0 <= ci.col_width() - column_margin());
                 wxDCClipper clip
                     (dc_
                     ,wxRect



reply via email to

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