Repository: flex-tlf
Updated Branches:
  refs/heads/develop 2ae535510 -> 96a959d1b


FLEX-34807


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

Branch: refs/heads/develop
Commit: 96a959d1b943630e68a826a1cf1fc804c73e8b95
Parents: 2ae5355
Author: Harbs <[email protected]>
Authored: Sat Sep 19 22:52:35 2015 +0300
Committer: Harbs <[email protected]>
Committed: Sat Sep 19 22:52:35 2015 +0300

----------------------------------------------------------------------
 textLayout/src/flashx/textLayout/edit/TextFlowEdit.as | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/96a959d1/textLayout/src/flashx/textLayout/edit/TextFlowEdit.as
----------------------------------------------------------------------
diff --git a/textLayout/src/flashx/textLayout/edit/TextFlowEdit.as 
b/textLayout/src/flashx/textLayout/edit/TextFlowEdit.as
index 235cd08..0fc41fb 100644
--- a/textLayout/src/flashx/textLayout/edit/TextFlowEdit.as
+++ b/textLayout/src/flashx/textLayout/edit/TextFlowEdit.as
@@ -241,7 +241,7 @@ package flashx.textLayout.edit
                                var scrapElement:FlowElement = scrapLeaf;       
        // highest level complete element in the scrap
 
                                // On the first paragraph, it always merges in 
to the destination paragraph if the destination paragraph has content
-                               var destinationParagraph:ParagraphElement = 
destinationLeaf.getParagraph();
+                               var destinationParagraph:ParagraphElement = 
destinationLeaf ? destinationLeaf.getParagraph() : destinationParagraph;
                                if (firstParagraph && 
(destinationParagraph.textLength > 1 || applyFormat))
                                {
                                        var scrapParagraph:ParagraphElement = 
scrapLeaf.getParagraph();
@@ -253,7 +253,7 @@ package flashx.textLayout.edit
                                {
                                        if (applyFormat && firstParagraph)
                                        {
-                                               destinationElement = 
findLowestPossibleParent(destinationLeaf.parent, scrapElement);
+                                               destinationElement = 
destinationLeaf ? findLowestPossibleParent(destinationLeaf.parent, 
scrapElement) : findLowestPossibleParent(destinationElement, scrapElement);
                                                var currentIndex:int = 
destinationElement.findChildIndexAtPosition(insertPosition - 
destinationElement.getAbsoluteStart());
                                                
applyFormatToElement(destinationElement, currentIndex, scrapElement);
                                        }
@@ -265,7 +265,7 @@ package flashx.textLayout.edit
 
                                // Find the lowest level parent in the TextFlow 
that can accept the scrapElement as a child. 
                                // If necessary, copy higher up the 
scrapElement hierarchy to find a match.
-                               var destinationElement:FlowGroupElement = 
findLowestPossibleParent(destinationLeaf.parent, scrapElement);
+                               var destinationElement:FlowGroupElement = 
destinationLeaf ? findLowestPossibleParent(destinationLeaf.parent, 
scrapElement) : findLowestPossibleParent(destinationElement, scrapElement);
                                while (!destinationElement)
                                {
                                        // Nothing in the TextFlow element 
hierarchy can accept the incoming scrap element.

Reply via email to