You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2017/06/17 05:08:13 UTC

[2/8] git commit: [flex-asjs] [refs/heads/tlf] - replaceText should handle null

replaceText should handle null


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

Branch: refs/heads/tlf
Commit: 3b8845416de9c10b52066b53eace3a30f7f1bee2
Parents: 2680873
Author: Alex Harui <ah...@apache.org>
Authored: Fri Jun 16 20:59:31 2017 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Jun 16 22:08:44 2017 -0700

----------------------------------------------------------------------
 .../main/flex/org/apache/flex/text/engine/TextElement.as | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3b884541/frameworks/projects/Text/src/main/flex/org/apache/flex/text/engine/TextElement.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Text/src/main/flex/org/apache/flex/text/engine/TextElement.as b/frameworks/projects/Text/src/main/flex/org/apache/flex/text/engine/TextElement.as
index a77b40b..6d4158c 100644
--- a/frameworks/projects/Text/src/main/flex/org/apache/flex/text/engine/TextElement.as
+++ b/frameworks/projects/Text/src/main/flex/org/apache/flex/text/engine/TextElement.as
@@ -61,9 +61,14 @@ package org.apache.flex.text.engine
 		}
 		public function replaceText(beginIndex:int, endIndex:int, newText:String):void
 		{
-			var b:String = _text.substring(0,beginIndex);
-			var e:String = _text.substring(endIndex);
-			_text = b + newText + e;
+            if (_text == null)
+                _text = newText;
+            else
+            {
+    			var b:String = _text.substring(0,beginIndex);
+    			var e:String = _text.substring(endIndex);
+    			_text = b + newText + e;
+            }
 			resetGlyphs();
 			resetText();
 		}