lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master c89f319 2/4: Replace if...else{if...else} wit


From: Greg Chicares
Subject: [lmi-commits] [lmi] master c89f319 2/4: Replace if...else{if...else} with a switch
Date: Wed, 23 May 2018 08:37:14 -0400 (EDT)

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

    Replace if...else{if...else} with a switch
---
 wx_table_generator.cpp | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
index 09acff4..14aecb1 100644
--- a/wx_table_generator.cpp
+++ b/wx_table_generator.cpp
@@ -656,24 +656,23 @@ void wx_table_generator::do_output_single_row
             {
             int x_text = pos_x;
 
-            if(align_right_)
+            switch(ci.alignment())
                 {
-LMI_ASSERT(oe_right == ci.alignment()); // To be removed in the next commit.
-                x_text += ci.col_width() - dc_.GetTextExtent(s).x;
-                }
-            else
-                {
-                if(ci.is_centered())
+                case oe_right:
+                    {
+                    x_text += ci.col_width() - dc_.GetTextExtent(s).x;
+                    }
+                    break;
+                case oe_center:
                     {
-LMI_ASSERT(oe_center == ci.alignment()); // To be removed in the next commit.
-                    // Center the text for the columns configured to do it.
                     x_text += (ci.col_width() - dc_.GetTextExtent(s).x) / 2;
                     }
-                else
+                    break;
+                case oe_left:
                     {
-LMI_ASSERT(oe_left == ci.alignment()); // To be removed in the next commit.
                     x_text += column_margin();
                     }
+                    break;
                 }
 
             if(ci.needs_clipping())



reply via email to

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