[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 5b3cc97 3/4: Rearranged switch in natural enu
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 5b3cc97 3/4: Rearranged switch in natural enumerator order |
Date: |
Wed, 23 May 2018 08:37:14 -0400 (EDT) |
branch: master
commit 5b3cc9773940422f5b0bba72b5b9e1284dbb07f7
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Rearranged switch in natural enumerator order
Also documented the reason for an apparent anomaly.
---
wx_table_generator.cpp | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
index 14aecb1..6f31513 100644
--- a/wx_table_generator.cpp
+++ b/wx_table_generator.cpp
@@ -658,9 +658,14 @@ void wx_table_generator::do_output_single_row
switch(ci.alignment())
{
- case oe_right:
+ case oe_left:
{
- x_text += ci.col_width() - dc_.GetTextExtent(s).x;
+ // PDF !! 'x_text += 0;' here would parallel the other
+ // cases. The implicit assumption here is that alignment
+ // is oe_left iff elasticity is oe_elastic; col_width()
+ // has been augmented by twice the margin for oe_inelastic
+ // columns only, and this adjustment compensates for that.
+ x_text += column_margin();
}
break;
case oe_center:
@@ -668,9 +673,9 @@ void wx_table_generator::do_output_single_row
x_text += (ci.col_width() - dc_.GetTextExtent(s).x) / 2;
}
break;
- case oe_left:
+ case oe_right:
{
- x_text += column_margin();
+ x_text += ci.col_width() - dc_.GetTextExtent(s).x;
}
break;
}