Repository: flex-tlf
Updated Branches:
  refs/heads/develop d3c95c512 -> 57643c227


Fixed handling of paragraph terminators


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

Branch: refs/heads/develop
Commit: 57643c227742a27f76df8fb9ca3924234fe818f3
Parents: d3c95c5
Author: Harbs <[email protected]>
Authored: Thu Dec 25 11:12:41 2014 +0200
Committer: Harbs <[email protected]>
Committed: Thu Dec 25 11:12:41 2014 +0200

----------------------------------------------------------------------
 .../src/flashx/textLayout/elements/ParagraphElement.as      | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/57643c22/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 2e8cd33..b6121bd 100644
--- a/textLayout/src/flashx/textLayout/elements/ParagraphElement.as
+++ b/textLayout/src/flashx/textLayout/elements/ParagraphElement.as
@@ -624,6 +624,13 @@ package flashx.textLayout.elements
                /** @private */
                tlf_internal function ensureTerminatorAfterReplace():void
                {
+                       //lose reference to terminator if it was removed or not 
a direct child.
+                       if(_terminatorSpan && _terminatorSpan.parent != this)
+                       {
+                               _terminatorSpan.removeParaTerminator();
+                               _terminatorSpan = null;
+                       }
+                       
                        var newLastLeaf:FlowLeafElement = getLastLeaf();
                        if (_terminatorSpan != newLastLeaf)
                        {
@@ -661,7 +668,7 @@ package flashx.textLayout.elements
                        if(_terminatorSpan && _terminatorSpan.textLength == 1)
                        {
                                var prev:FlowLeafElement = 
_terminatorSpan.getPreviousLeaf(this);
-                               if(prev && prev is SpanElement)
+                               if(prev && prev.parent == this && prev is 
SpanElement)
                                {
                                        _terminatorSpan.removeParaTerminator();
                                        termIdx = 
getChildIndex(_terminatorSpan);

Reply via email to