Repository: flex-asjs
Updated Branches:
  refs/heads/develop 48f1fd801 -> d9724b829


simplify switch statement


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/d9724b82
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/d9724b82
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/d9724b82

Branch: refs/heads/develop
Commit: d9724b829ec36291b777617a1e37571bbfae5524
Parents: 48f1fd8
Author: Justin Mclean <jmcl...@apache.org>
Authored: Thu Jul 6 17:17:38 2017 +1000
Committer: Justin Mclean <jmcl...@apache.org>
Committed: Thu Jul 6 17:17:38 2017 +1000

----------------------------------------------------------------------
 .../flex/textLayout/elements/TableElement.as      | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d9724b82/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/elements/TableElement.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/elements/TableElement.as
 
b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/elements/TableElement.as
index d759bbe..d9a1fa8 100644
--- 
a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/elements/TableElement.as
+++ 
b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/elements/TableElement.as
@@ -1133,19 +1133,11 @@ package org.apache.flex.textLayout.elements {
                                addColumn();
                        }
                        
-                       var w:Number;
-                       switch(typeof(computedFormat.tableWidth)){
-                               case "number":
-                                       w = suggestedWidth;
-                                       break;
-                               case "string":
-                                       
if(computedFormat.tableWidth.indexOf("%") > 0){
-                                               w = suggestedWidth / 
(parseFloat(computedFormat.tableWidth)/100);
-                                               break;
-                                       }
-                               default:
-                                       w = suggestedWidth;
-                                       break;
+                       var w:Number = suggestedWidth;
+                       if (typeof(computedFormat.tableWidth) == "string"){
+                               if(computedFormat.tableWidth.indexOf("%") > 0){
+                                       w = suggestedWidth / 
(parseFloat(computedFormat.tableWidth)/100);
+                               }
                        }
                        if(isNaN(w))
                                w = 600;

Reply via email to