You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pi...@apache.org on 2014/11/03 21:51:17 UTC

[35/44] git commit: [flex-tlf] [refs/heads/tables] - FLEX-26478 Responding to dev review by adding curly braces around if clauses. Also optimised imports and renamed comment parameters in StandardFlowComposer and ContainerController.

FLEX-26478
Responding to dev review by adding curly braces around if clauses.
Also optimised imports and renamed comment parameters in StandardFlowComposer and ContainerController.


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

Branch: refs/heads/tables
Commit: bebdb18790e32a25e2c4427758b2ac637c59bc51
Parents: d1c8361
Author: Mihai Chira <mi...@apache.org>
Authored: Thu Oct 23 12:27:32 2014 +0100
Committer: Mihai Chira <mi...@apache.org>
Committed: Thu Oct 23 12:27:32 2014 +0100

----------------------------------------------------------------------
 .../textLayout/compose/StandardFlowComposer.as  |  44 +++---
 .../textLayout/container/ContainerController.as | 138 ++++++++++---------
 2 files changed, 91 insertions(+), 91 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/bebdb187/textLayout/src/flashx/textLayout/compose/StandardFlowComposer.as
----------------------------------------------------------------------
diff --git a/textLayout/src/flashx/textLayout/compose/StandardFlowComposer.as b/textLayout/src/flashx/textLayout/compose/StandardFlowComposer.as
index 3393d32..e1cb140 100644
--- a/textLayout/src/flashx/textLayout/compose/StandardFlowComposer.as
+++ b/textLayout/src/flashx/textLayout/compose/StandardFlowComposer.as
@@ -17,25 +17,23 @@
 //
 ////////////////////////////////////////////////////////////////////////////////
 package flashx.textLayout.compose
-{	
-	import flash.display.Sprite;
-	import flash.system.Capabilities;
-	import flash.text.engine.TextLine;
-	
-	import flashx.textLayout.accessibility.TextAccImpl;
-	import flashx.textLayout.container.ContainerController;
-	import flashx.textLayout.container.ScrollPolicy;
-	import flashx.textLayout.debug.assert;
-	import flashx.textLayout.edit.ISelectionManager;
-	import flashx.textLayout.elements.BackgroundManager;
-	import flashx.textLayout.elements.ContainerFormattedElement;
-	import flashx.textLayout.elements.ParagraphElement;
-	import flashx.textLayout.elements.TextFlow;
-	import flashx.textLayout.events.CompositionCompleteEvent;
-	import flashx.textLayout.formats.BlockProgression;
-	import flashx.textLayout.tlf_internal;
+{
+    import flash.display.Sprite;
+    import flash.system.Capabilities;
+
+    import flashx.textLayout.accessibility.TextAccImpl;
+    import flashx.textLayout.container.ContainerController;
+    import flashx.textLayout.container.ScrollPolicy;
+    import flashx.textLayout.debug.assert;
+    import flashx.textLayout.edit.ISelectionManager;
+    import flashx.textLayout.elements.BackgroundManager;
+    import flashx.textLayout.elements.ContainerFormattedElement;
+    import flashx.textLayout.elements.TextFlow;
+    import flashx.textLayout.events.CompositionCompleteEvent;
+    import flashx.textLayout.formats.BlockProgression;
+    import flashx.textLayout.tlf_internal;
 
-	use namespace tlf_internal;
+    use namespace tlf_internal;
 	
 	/** 
 	* The StandardFlowComposer class provides a standard composer and container manager. 
@@ -89,7 +87,7 @@ package flashx.textLayout.compose
 		public function StandardFlowComposer()
 		{
 			super();
-			_controllerList = new Array();
+			_controllerList = [];
 			_composing = false;
 		}
 
@@ -212,7 +210,7 @@ package flashx.textLayout.compose
 				// attach accessibility to the containers
 				// Why only the first container?  There are workflows that this will fail
 				// for example: a pagination workflow that has a composed chain of containers but only displays one at a time.
-				if (textFlow.configuration.enableAccessibility && flash.system.Capabilities.hasAccessibility)
+				if (textFlow.configuration.enableAccessibility && Capabilities.hasAccessibility)
 				{
 					var firstContainer:Sprite = getControllerAt(0).container;
 					if (firstContainer)
@@ -265,7 +263,7 @@ package flashx.textLayout.compose
 			}
 			else
 			{
-				controller.setRootElement(_rootElement)
+				controller.setRootElement(_rootElement);
 				var curContainer:Sprite = controller.container;
 				if (curContainer)
 					curContainer.focusRect = false;
@@ -538,7 +536,7 @@ package flashx.textLayout.compose
 		 * 
 		 * <p>If the contents of any container is changed, the method returns <code>true</code>.</p>
 		 * 
-		 * @param controllerIndex index of the last container to update (by default updates all containers)
+		 * @param index index of the last container to update (by default updates all containers)
 		 * @return <code>true</code>, if anything changed.
 		 *
 		 * @playerversion Flash 10
@@ -578,7 +576,7 @@ package flashx.textLayout.compose
 		 * containing the specified text flow position.</p>
 		 * 
 		 * @param absolutePosition Specifies the position in the text flow of the container to receive focus.
-		 * @param preferPrevious If true and the position is before the first character in a container, sets focus to the end of 
+		 * @param leanLeft If true and the position is before the first character in a container, sets focus to the end of
 		 *  the previous container.
 		 * 
 		 * @see flash.display.Stage#focus

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/bebdb187/textLayout/src/flashx/textLayout/container/ContainerController.as
----------------------------------------------------------------------
diff --git a/textLayout/src/flashx/textLayout/container/ContainerController.as b/textLayout/src/flashx/textLayout/container/ContainerController.as
index de77fa7..f992734 100644
--- a/textLayout/src/flashx/textLayout/container/ContainerController.as
+++ b/textLayout/src/flashx/textLayout/container/ContainerController.as
@@ -18,71 +18,67 @@
 ////////////////////////////////////////////////////////////////////////////////
 package flashx.textLayout.container 
 {
-	import flash.display.BlendMode;
-	import flash.display.DisplayObject;
-	import flash.display.DisplayObjectContainer;
-	import flash.display.InteractiveObject;
-	import flash.display.Shape;
-	import flash.display.Sprite;
-	import flash.events.ContextMenuEvent;
-	import flash.events.Event;
-	import flash.events.FocusEvent;
+    import flash.display.BlendMode;
+    import flash.display.DisplayObject;
+    import flash.display.DisplayObjectContainer;
+    import flash.display.Shape;
+    import flash.display.Sprite;
+    import flash.events.ContextMenuEvent;
+    import flash.events.Event;
+    import flash.events.FocusEvent;
     import flash.events.IEventDispatcher;
-	import flash.events.IMEEvent;
-	import flash.events.KeyboardEvent;
-	import flash.events.MouseEvent;
-	import flash.events.TextEvent;
-	import flash.events.TimerEvent;
-	import flash.geom.Matrix;
-	import flash.geom.Point;
-	import flash.geom.Rectangle;
-	import flash.text.engine.TextBlock;
-	import flash.text.engine.TextLine;
-	import flash.text.engine.TextLineValidity;
-	import flash.ui.ContextMenu;
-	import flash.ui.ContextMenuClipboardItems;
-	import flash.utils.Dictionary;
-	import flash.utils.Timer;
-	
-	import flashx.textLayout.compose.FloatCompositionData;
-	import flashx.textLayout.compose.FlowComposerBase;
-	import flashx.textLayout.compose.FlowDamageType;
-	import flashx.textLayout.compose.IFlowComposer;
-	import flashx.textLayout.compose.TextFlowLine;
-	import flashx.textLayout.compose.TextLineRecycler;
-	import flashx.textLayout.debug.Debugging;
-	import flashx.textLayout.debug.assert;
-	import flashx.textLayout.edit.EditingMode;
-	import flashx.textLayout.edit.IInteractionEventHandler;
-	import flashx.textLayout.edit.ISelectionManager;
-	import flashx.textLayout.edit.SelectionFormat;
-	import flashx.textLayout.elements.BackgroundManager;
-	import flashx.textLayout.elements.Configuration;
-	import flashx.textLayout.elements.ContainerFormattedElement;
-	import flashx.textLayout.elements.FlowElement;
-	import flashx.textLayout.elements.FlowLeafElement;
-	import flashx.textLayout.elements.FlowValueHolder;
-	import flashx.textLayout.elements.InlineGraphicElement;
-	import flashx.textLayout.elements.LinkElement;
-	import flashx.textLayout.elements.ParagraphElement;
-	import flashx.textLayout.elements.TextFlow;
-	import flashx.textLayout.events.FlowElementMouseEvent;
-	import flashx.textLayout.events.FlowElementMouseEventManager;
-	import flashx.textLayout.events.ModelChange;
-	import flashx.textLayout.events.ScrollEvent;
-	import flashx.textLayout.events.ScrollEventDirection;
-	import flashx.textLayout.events.TextLayoutEvent;
-	import flashx.textLayout.events.UpdateCompleteEvent;
-	import flashx.textLayout.formats.BlockProgression;
-	import flashx.textLayout.formats.Float;
-	import flashx.textLayout.formats.FormatValue;
-	import flashx.textLayout.formats.ITextLayoutFormat;
-	import flashx.textLayout.formats.TextLayoutFormat;
-	import flashx.textLayout.property.Property;
-	import flashx.textLayout.tlf_internal;
-	import flashx.textLayout.utils.Twips;
-	
-	use namespace tlf_internal;
+    import flash.events.IMEEvent;
+    import flash.events.KeyboardEvent;
+    import flash.events.MouseEvent;
+    import flash.events.TextEvent;
+    import flash.events.TimerEvent;
+    import flash.geom.Matrix;
+    import flash.geom.Point;
+    import flash.geom.Rectangle;
+    import flash.text.engine.TextBlock;
+    import flash.text.engine.TextLine;
+    import flash.text.engine.TextLineValidity;
+    import flash.ui.ContextMenu;
+    import flash.ui.ContextMenuClipboardItems;
+    import flash.utils.Dictionary;
+    import flash.utils.Timer;
+
+    import flashx.textLayout.compose.FloatCompositionData;
+    import flashx.textLayout.compose.FlowDamageType;
+    import flashx.textLayout.compose.IFlowComposer;
+    import flashx.textLayout.compose.TextFlowLine;
+    import flashx.textLayout.compose.TextLineRecycler;
+    import flashx.textLayout.debug.Debugging;
+    import flashx.textLayout.debug.assert;
+    import flashx.textLayout.edit.EditingMode;
+    import flashx.textLayout.edit.IInteractionEventHandler;
+    import flashx.textLayout.edit.ISelectionManager;
+    import flashx.textLayout.edit.SelectionFormat;
+    import flashx.textLayout.elements.BackgroundManager;
+    import flashx.textLayout.elements.Configuration;
+    import flashx.textLayout.elements.ContainerFormattedElement;
+    import flashx.textLayout.elements.FlowElement;
+    import flashx.textLayout.elements.FlowLeafElement;
+    import flashx.textLayout.elements.FlowValueHolder;
+    import flashx.textLayout.elements.InlineGraphicElement;
+    import flashx.textLayout.elements.ParagraphElement;
+    import flashx.textLayout.elements.TCYElement;
+    import flashx.textLayout.elements.TextFlow;
+    import flashx.textLayout.events.FlowElementMouseEventManager;
+    import flashx.textLayout.events.ModelChange;
+    import flashx.textLayout.events.ScrollEvent;
+    import flashx.textLayout.events.ScrollEventDirection;
+    import flashx.textLayout.events.TextLayoutEvent;
+    import flashx.textLayout.events.UpdateCompleteEvent;
+    import flashx.textLayout.formats.BlockProgression;
+    import flashx.textLayout.formats.Float;
+    import flashx.textLayout.formats.FormatValue;
+    import flashx.textLayout.formats.ITextLayoutFormat;
+    import flashx.textLayout.formats.TextLayoutFormat;
+    import flashx.textLayout.tlf_internal;
+    import flashx.textLayout.utils.Twips;
+
+    use namespace tlf_internal;
 	
 	/** 
 	 * The ContainerController class defines the relationship between a TextFlow object and a container.
@@ -1425,7 +1421,7 @@ package flashx.textLayout.container
 				if (blockProgression == BlockProgression.RL)
 				{
 					var leafElement:FlowLeafElement = _rootElement.getTextFlow().findLeaf(start);
-					isTCY =  leafElement.getParentByType(flashx.textLayout.elements.TCYElement) != null;
+					isTCY =  leafElement.getParentByType(TCYElement) != null;
 				}
 				
 				var minAtomIndex:int = textLine.atomCount;
@@ -1786,10 +1782,14 @@ package flashx.textLayout.container
                 _scrollTimer.removeEventListener(TimerEvent.TIMER, scrollTimerHandler);
 
                 if(!containerRoot)
+                {
                     containerRoot = getContainerRoot();
+                }
 
                 if(containerRoot)
+                {
                     containerRoot.removeEventListener(MouseEvent.MOUSE_UP, scrollTimerHandler);
+                }
 
                 _scrollTimer = null;
             }
@@ -4745,8 +4745,9 @@ package flashx.textLayout.container
 		
 		CONFIG::debug
 		{
-			import flash.system.Capabilities;
-			// OLD style calculation - lets make sure its the same.  
+            import flash.system.Capabilities;
+
+            // OLD style calculation - lets make sure its the same.
 			static private var tempLineHolder:Sprite = new Sprite();
 			
 			/** @private */
@@ -4913,8 +4914,9 @@ package flashx.textLayout.container
 	}
 	
 }
-import flash.events.MouseEvent;
+
 import flash.display.InteractiveObject;
+import flash.events.MouseEvent;
 
 class PsuedoMouseEvent extends MouseEvent
 {