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/28 01:20:56 UTC
[16/25] git commit: [flex-tlf] [refs/heads/develop] - Some code
cleanup
Some code cleanup
Project: http://git-wip-us.apache.org/repos/asf/flex-tlf/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-tlf/commit/8db7a4a2
Tree: http://git-wip-us.apache.org/repos/asf/flex-tlf/tree/8db7a4a2
Diff: http://git-wip-us.apache.org/repos/asf/flex-tlf/diff/8db7a4a2
Branch: refs/heads/develop
Commit: 8db7a4a2e707364c57c26bbb8d4c4286be634aa3
Parents: 99d8b6c
Author: Harbs <ha...@in-tools.com>
Authored: Mon Nov 17 14:00:13 2014 +0200
Committer: Harbs <ha...@in-tools.com>
Committed: Mon Nov 17 14:00:13 2014 +0200
----------------------------------------------------------------------
textLayout/src/flashx/textLayout/compose/BaseCompose.as | 12 +++---------
.../src/flashx/textLayout/compose/ComposeState.as | 8 ++++----
textLayout/src/flashx/textLayout/compose/Parcel.as | 2 --
3 files changed, 7 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/8db7a4a2/textLayout/src/flashx/textLayout/compose/BaseCompose.as
----------------------------------------------------------------------
diff --git a/textLayout/src/flashx/textLayout/compose/BaseCompose.as b/textLayout/src/flashx/textLayout/compose/BaseCompose.as
index 7a0557d..b051036 100644
--- a/textLayout/src/flashx/textLayout/compose/BaseCompose.as
+++ b/textLayout/src/flashx/textLayout/compose/BaseCompose.as
@@ -775,9 +775,6 @@ package flashx.textLayout.compose
}
var nextParcel:Parcel = parcelList.getParcelAt(parcelList.currentParcelIndex + 1);
- if ( parcelList.currentParcel.isTableParcel
- && ((nextParcel && nextParcel.isTableParcel) || parcelList.currentParcelIndex == parcelList.numParcels()-1))
- _correctTextLength = true;
advanceToNextParcel();
_correctTextLength = false;
@@ -1124,8 +1121,6 @@ package flashx.textLayout.compose
// do table here?
//_curElementStart == _curParaStart
// var startCompose:int = _curElementStart + _curElementOffset - _curParaStart;
- var c1:Object = _curParaElement.findChildIndexAtPosition(_curElementOffset);
- var c2:Object = _curParaElement.findChildIndexAtPosition(_curElementStart);
var curChild:FlowElement = _curParaElement.getChildAt(_curParaElement.findChildIndexAtPosition(_curElementStart - _curParaStart));
if(curChild is TableElement)
{
@@ -2041,7 +2036,7 @@ package flashx.textLayout.compose
for (;;)
{
advanceToNextParcel();
- if (!_curLine || _parcelList.atEnd() || _parcelList.currentParcel.isTableParcel)
+ if (!_curLine || _parcelList.atEnd())
return false;
if (_parcelList.getLineSlug(_lineSlug,0, 1, _textIndent, _curParaFormat.direction == Direction.LTR))
{
@@ -2704,15 +2699,14 @@ package flashx.textLayout.compose
{
if (oldController == null && _startController)
clearControllers(_startController, newController);
- else if ( ! _curParcel.isTableParcel )
+ else
clearControllers(oldController, newController);
}
if (newController)
{
CONFIG::debug
{
- if ( ! newParcel.isTableParcel )
- assert(!oldController || newController.absoluteStart == oldController.absoluteStart + oldController.textLength, "newController not yet set up");
+ assert(!oldController || newController.absoluteStart == oldController.absoluteStart + oldController.textLength, "newController not yet set up");
}
if (oldController) // advance the start pos to the next controller if newController isn't the first controller
_startComposePosition = newController.absoluteStart;
http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/8db7a4a2/textLayout/src/flashx/textLayout/compose/ComposeState.as
----------------------------------------------------------------------
diff --git a/textLayout/src/flashx/textLayout/compose/ComposeState.as b/textLayout/src/flashx/textLayout/compose/ComposeState.as
index 98d16eb..e170bae 100644
--- a/textLayout/src/flashx/textLayout/compose/ComposeState.as
+++ b/textLayout/src/flashx/textLayout/compose/ComposeState.as
@@ -335,7 +335,8 @@ package flashx.textLayout.compose
protected override function composeNextLine():TextLine
{
// mjzhang: this code adds for recompose a table row, we need to recorrect _curLineIndex parameter based on _curElementStart and _curElementOffset.
- _curLineIndex = _flowComposer.findLineIndexAtPosition(_curElementStart + _curElementOffset);
+ //Harbs: I don't see a need for this now that I changed the table logic.
+ //_curLineIndex = _flowComposer.findLineIndexAtPosition(_curElementStart + _curElementOffset);
CONFIG::debug { assert(_curLineIndex == _flowComposer.findLineIndexAtPosition(_curElementStart + _curElementOffset),"bad _curLineIndex"); }
@@ -345,7 +346,6 @@ package flashx.textLayout.compose
// width in fitLineToParcel to make sure it fits at the (possibly changed) line height.
var startCompose:int = _curElementStart + _curElementOffset - _curParaStart;
var line:TextFlowLine = _curLineIndex < _flowComposer.numLines ? (_flowComposer as StandardFlowComposer).lines[_curLineIndex] : null;
-
var useExistingLine:Boolean = line && (!line.isDamaged() || line.validity == FlowDamageType.GEOMETRY);
// if the line ends with a hyphen, don't use existing line because the player seems to mis-handle
// starting the next line.
@@ -422,7 +422,7 @@ package flashx.textLayout.compose
if (fitLineToParcel(textLine, !useExistingLine, numberLine))
break; // we have a good line
_curLine = null; // keep looking
- if (_parcelList.atEnd() || _parcelList.currentParcel.isTableParcel)
+ if (_parcelList.atEnd())
{
popInsideListItemMargins(numberLine);
return null;
@@ -451,7 +451,7 @@ package flashx.textLayout.compose
var textLine:TextLine = super.createTextLine(targetWidth, allowEmergencyBreaks);
if (textLine)
- textLine.doubleClickEnabled = true; // allow line to be the target oif a double click event
+ textLine.doubleClickEnabled = true; // allow line to be the target of a double click event
else
_curLine = null;
http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/8db7a4a2/textLayout/src/flashx/textLayout/compose/Parcel.as
----------------------------------------------------------------------
diff --git a/textLayout/src/flashx/textLayout/compose/Parcel.as b/textLayout/src/flashx/textLayout/compose/Parcel.as
index 200dae6..9079d97 100644
--- a/textLayout/src/flashx/textLayout/compose/Parcel.as
+++ b/textLayout/src/flashx/textLayout/compose/Parcel.as
@@ -43,7 +43,6 @@ package flashx.textLayout.compose
public var width:Number;
public var height:Number;
public var logicalWidth:Number;
- public var isTableParcel:Boolean;
private var _controller:ContainerController;
private var _columnIndex:int;
@@ -73,7 +72,6 @@ package flashx.textLayout.compose
this.height = height;
this.logicalWidth = verticalText ? height : width;
this._verticalText = verticalText;
- this.isTableParcel = false;
_controller = controller;
_columnIndex = columnIndex;