You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ha...@apache.org on 2017/04/26 20:46:05 UTC

git commit: [flex-asjs] [refs/heads/tlf] - Fixed formatting assignment bugs

Repository: flex-asjs
Updated Branches:
  refs/heads/tlf 66febb899 -> 13d949fdb


Fixed formatting assignment bugs


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

Branch: refs/heads/tlf
Commit: 13d949fdb0c5afb3be87521945e1fafe35ab7e2b
Parents: 66febb8
Author: Harbs <ha...@in-tools.com>
Authored: Wed Apr 26 23:46:01 2017 +0300
Committer: Harbs <ha...@in-tools.com>
Committed: Wed Apr 26 23:46:01 2017 +0300

----------------------------------------------------------------------
 .../textLayout/compose/VerticalJustifier.as     | 27 ++++++++++----------
 .../flex/textLayout/formats/ListMarkerFormat.as |  4 +--
 .../property/FormatPropertyHandler.as           |  2 +-
 .../flex/textLayout/property/PropertyFactory.as | 10 +++++++-
 .../textLayout/property/TabStopsProperty.as     | 10 +++++---
 5 files changed, 32 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/13d949fd/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/compose/VerticalJustifier.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/compose/VerticalJustifier.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/compose/VerticalJustifier.as
index 0adee48..ffd901d 100644
--- a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/compose/VerticalJustifier.as
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/compose/VerticalJustifier.as
@@ -41,7 +41,8 @@ package org.apache.flex.textLayout.compose
 		 * */
 		static public function applyVerticalAlignmentToColumn(controller:IContainerController, verticalAlignAttr:String, lines:Array, startIndex:int, numLines:int,beginFloatIndex:int,endFloatIndex:int):Number
 		{
-			var helper:IVerticalAdjustmentHelper;
+			// var helper:IVerticalAdjustmentHelper;
+			var helper:Object;
 			if (controller.rootElement.computedFormat.blockProgression == BlockProgression.RL)
 				helper = new RL_VJHelper(controller);
 			else
@@ -88,21 +89,21 @@ import org.apache.flex.textLayout.container.IContainerController;
 import org.apache.flex.textLayout.elements.IInlineGraphicElement;
 import org.apache.flex.textLayout.formats.Float;
 
-interface IVerticalAdjustmentHelper
-{
-	function getBottom(line:IVerticalJustificationLine, controller:IContainerController, beginFloat:int, endFloat:int):Number;
+// interface IVerticalAdjustmentHelper
+// {
+// 	function getBottom(line:IVerticalJustificationLine, controller:IContainerController, beginFloat:int, endFloat:int):Number;
 	
-	function computeMiddleAdjustment(bottom:Number):Number;
-	function applyAdjustment(line:IVerticalJustificationLine):void;
-	function applyAdjustmentToFloat(floatInfo:FloatCompositionData):void;
+// 	function computeMiddleAdjustment(bottom:Number):Number;
+// 	function applyAdjustment(line:IVerticalJustificationLine):void;
+// 	function applyAdjustmentToFloat(floatInfo:FloatCompositionData):void;
 	
-	function computeBottomAdjustment(bottom:Number):Number;
+// 	function computeBottomAdjustment(bottom:Number):Number;
 	
-	function computeJustifyAdjustment(lineArray:Array, firstLine:int, numLines:int):Number;
-	function applyJustifyAdjustment(lineArray:Array, firstLine:int, numLines:int):void;
-}
+// 	function computeJustifyAdjustment(lineArray:Array, firstLine:int, numLines:int):Number;
+// 	function applyJustifyAdjustment(lineArray:Array, firstLine:int, numLines:int):void;
+// }
 
-class TB_VJHelper implements IVerticalAdjustmentHelper
+class TB_VJHelper/* implements IVerticalAdjustmentHelper*/
 {
 	
 
@@ -239,7 +240,7 @@ class TB_VJHelper implements IVerticalAdjustmentHelper
 	}
 }
 
-class RL_VJHelper implements IVerticalAdjustmentHelper
+class RL_VJHelper/* implements IVerticalAdjustmentHelper*/
 {
 	
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/13d949fd/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/ListMarkerFormat.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/ListMarkerFormat.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/ListMarkerFormat.as
index 5b389be..76d6290 100644
--- a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/ListMarkerFormat.as
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/ListMarkerFormat.as
@@ -127,8 +127,8 @@ package org.apache.flex.textLayout.formats
 		}
 		
 		// at this point we know that both TextLayoutFormat and ListMarkerFormat are initialized so can setup the Property objects
-		PropertyFactory.sharedTextLayoutFormatHandler.converter = TextLayoutFormat.createTextLayoutFormat;
-		PropertyFactory.sharedListMarkerFormatHandler.converter = ListMarkerFormat.createListMarkerFormat;
+		// PropertyFactory.sharedTextLayoutFormatHandler.converter = TextLayoutFormat.createTextLayoutFormat;
+		// PropertyFactory.sharedListMarkerFormatHandler.converter = ListMarkerFormat.createListMarkerFormat;
 
 		
 		/** Create a ListMarkerFormat that holds all the properties possible for a list marker.  

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/13d949fd/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/property/FormatPropertyHandler.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/property/FormatPropertyHandler.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/property/FormatPropertyHandler.as
index 3d4eb06..c443858 100644
--- a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/property/FormatPropertyHandler.as
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/property/FormatPropertyHandler.as
@@ -39,7 +39,7 @@ package org.apache.flex.textLayout.property
 		{ return newVal is String ? undefined : newVal; }
 				
 		public override function setHelper(newVal:*):*
-		{ return _converter(newVal); }
+		{ return converter(newVal); }
 	}
 }
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/13d949fd/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/property/PropertyFactory.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/property/PropertyFactory.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/property/PropertyFactory.as
index 17f9263..8cd8943 100644
--- a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/property/PropertyFactory.as
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/property/PropertyFactory.as
@@ -21,6 +21,8 @@ package org.apache.flex.textLayout.property {
 	import org.apache.flex.textLayout.property.EnumPropertyHandler;
 	import org.apache.flex.textLayout.property.UndefinedPropertyHandler;
 	import org.apache.flex.textLayout.property.UintPropertyHandler;
+	import org.apache.flex.textLayout.formats.TextLayoutFormat;
+	import org.apache.flex.textLayout.formats.ListMarkerFormat;
 	public class PropertyFactory {
 		// shared propertyHandler instances
 		/** @private */
@@ -68,7 +70,10 @@ package org.apache.flex.textLayout.property {
 		private static var _sharedTextLayoutFormatHandler:FormatPropertyHandler;
 		public static function get sharedTextLayoutFormatHandler():FormatPropertyHandler{
 			if(_sharedTextLayoutFormatHandler == null)
-			 	_sharedTextLayoutFormatHandler = new FormatPropertyHandler();
+			{
+				_sharedTextLayoutFormatHandler = new FormatPropertyHandler();
+				_sharedTextLayoutFormatHandler.converter = TextLayoutFormat.createTextLayoutFormat;
+			}
 			
 			return _sharedTextLayoutFormatHandler;
 		}
@@ -76,7 +81,10 @@ package org.apache.flex.textLayout.property {
 		private static var _sharedListMarkerFormatHandler:FormatPropertyHandler;
 		public static function get sharedListMarkerFormatHandler():FormatPropertyHandler{
 			if(_sharedListMarkerFormatHandler == null)
+			{
 				_sharedListMarkerFormatHandler = new FormatPropertyHandler();
+				_sharedListMarkerFormatHandler.converter = ListMarkerFormat.createListMarkerFormat;
+			}
 			
 			return _sharedListMarkerFormatHandler;
 		}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/13d949fd/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/property/TabStopsProperty.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/property/TabStopsProperty.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/property/TabStopsProperty.as
index 9eb4223..6ffde0b 100644
--- a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/property/TabStopsProperty.as
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/property/TabStopsProperty.as
@@ -39,9 +39,10 @@ package org.apache.flex.textLayout.property {
 				return newVal;
 				
 			// Accepts either an array or a string representation
-			var tabStops:Array = newVal as Array;
-			if (tabStops)
+			var tabStops:Array;
+			if (newVal is Array)
 			{
+				tabStops = newVal as Array;
 				if (!checkArrayTypes(tabStops))
 				{
 					PropertyUtil.errorHandler(this,newVal);
@@ -58,7 +59,7 @@ package org.apache.flex.textLayout.property {
 				}
 					
 				// Parse the string representation and create an equivalent array
-				tabStops = new Array();
+				tabStops = [];
 				
 				// Replace escape sequences (\ followed by a space or \) with placeholder strings
 				// that can't naturally occur in the passed-in string 
@@ -116,7 +117,8 @@ package org.apache.flex.textLayout.property {
 							tabStop.decimalAlignmentToken = tabStop.decimalAlignmentToken.replace(_spacePlaceholderRegex, " ");
 						}
 					}
-					else if (result[3] != "")
+					//This was originally a check for an empty string but it appears to be undefined in Javascript
+					else if (result[3])
 					{
 						PropertyUtil.errorHandler(this,newVal);
 						return currVal; // if alignment is not decimal, the alignment token is not allowed