Repository: flex-tlf Updated Branches: refs/heads/develop 57643c227 -> 12bcabb18
Fixed issues that were causing tests to fail/error Project: http://git-wip-us.apache.org/repos/asf/flex-tlf/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-tlf/commit/12bcabb1 Tree: http://git-wip-us.apache.org/repos/asf/flex-tlf/tree/12bcabb1 Diff: http://git-wip-us.apache.org/repos/asf/flex-tlf/diff/12bcabb1 Branch: refs/heads/develop Commit: 12bcabb188217dcd0e485c60c71e6ee885cf7633 Parents: 57643c2 Author: Harbs <[email protected]> Authored: Mon Dec 29 11:57:39 2014 +0200 Committer: Harbs <[email protected]> Committed: Mon Dec 29 11:57:39 2014 +0200 ---------------------------------------------------------------------- textLayout/src/flashx/textLayout/elements/ParagraphElement.as | 6 +++++- textLayout/src/flashx/textLayout/elements/SpanElement.as | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/12bcabb1/textLayout/src/flashx/textLayout/elements/ParagraphElement.as ---------------------------------------------------------------------- diff --git a/textLayout/src/flashx/textLayout/elements/ParagraphElement.as b/textLayout/src/flashx/textLayout/elements/ParagraphElement.as index b6121bd..e7e3e7c 100644 --- a/textLayout/src/flashx/textLayout/elements/ParagraphElement.as +++ b/textLayout/src/flashx/textLayout/elements/ParagraphElement.as @@ -535,6 +535,10 @@ package flashx.textLayout.elements CONFIG::debug { Debugging.traceFTECall(gc,null,"new Vector.<ContentElement>") } gc.push(block); CONFIG::debug { Debugging.traceFTECall(null,gc,"push",block); } + // If elements in the middle (i.e. ones in the process of being added) were missed, the idx can be too high. + // The missed ones will be inserted later. + if(idx > group.elementCount) + idx = group.elementCount; group.replaceElements(idx,idx,gc); CONFIG::debug { Debugging.traceFTECall(null,group,"replaceElements",idx,idx,gc); } } @@ -581,7 +585,7 @@ package flashx.textLayout.elements if(_terminatorSpan) { var termIdx:int = getChildIndex(_terminatorSpan); - if(termIdx !=0 && _terminatorSpan.textLength == 1) + if(termIdx > 0 && _terminatorSpan.textLength == 1) { super.replaceChildren(termIdx, termIdx+1); _terminatorSpan = null; http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/12bcabb1/textLayout/src/flashx/textLayout/elements/SpanElement.as ---------------------------------------------------------------------- diff --git a/textLayout/src/flashx/textLayout/elements/SpanElement.as b/textLayout/src/flashx/textLayout/elements/SpanElement.as index 9e37058..3bae423 100644 --- a/textLayout/src/flashx/textLayout/elements/SpanElement.as +++ b/textLayout/src/flashx/textLayout/elements/SpanElement.as @@ -76,7 +76,7 @@ package flashx.textLayout.elements /** @private */ override tlf_internal function createContentElement():void { - if (_blockElement) + if (_blockElement && _blockElement.textBlock) return; computedFormat; // BEFORE creating the element
