Return-Path: X-Original-To: apmail-flex-issues-archive@minotaur.apache.org Delivered-To: apmail-flex-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 16E011174A for ; Wed, 16 Apr 2014 03:21:21 +0000 (UTC) Received: (qmail 40201 invoked by uid 500); 16 Apr 2014 03:21:20 -0000 Delivered-To: apmail-flex-issues-archive@flex.apache.org Received: (qmail 40163 invoked by uid 500); 16 Apr 2014 03:21:17 -0000 Mailing-List: contact issues-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list issues@flex.apache.org Received: (qmail 40149 invoked by uid 99); 16 Apr 2014 03:21:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Apr 2014 03:21:15 +0000 Date: Wed, 16 Apr 2014 03:21:15 +0000 (UTC) From: "Justin Mclean (JIRA)" To: issues@flex.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (FLEX-34013) RTE at TextClipboard#importToScrap() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FLEX-34013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13970370#comment-13970370 ] Justin Mclean edited comment on FLEX-34013 at 4/16/14 3:20 AM: --------------------------------------------------------------- Thanks for the code to reproduce the issue. The issues is related to this code: {code} // If copied/cut from displayAsPassword field the pastedText // is '*' characters but this is correct. var pastedText:String = staticPlainTextExporter.export( po.textScrap.textFlow, ConversionType.STRING_TYPE) as String; // If there are no newlines there is nothing // more to do. if (pastedText.search(ALL_NEWLINES_REGEXP) != -1) { pastedText = pastedText.replace(ALL_NEWLINES_REGEXP, ""); po.textScrap = TextClipboard.importToScrap(pastedText, po.textScrap.isPlainText() ? TextConverter.PLAIN_TEXT_FORMAT : TextConverter.TEXT_LAYOUT_FORMAT); } {code} i.e. calling importToScap a second time when pasting text that contains a new line In the second import it calls importToFlow which calls importFromString and then importFromXML: {code} protected function importFromXML(xmlSource:XML):TextFlow // Parse an XFL hierarchy into a TextFlow, using the geometry supplied by a TextFrame // to host child containers (e.g. tables). This is the main entry point into this class. { return parseContent(xmlSource[0]); } {code} In the second case xmlSource does't have any children and xmlSource[0] does't exist so importFromXML returns null causing the RTE. I'm not 100% what the best solution to solve this issue is however. was (Author: jmclean): Thanks for the code to reproduce the issue. The issues is related to this code: // If copied/cut from displayAsPassword field the pastedText // is '*' characters but this is correct. var pastedText:String = staticPlainTextExporter.export( po.textScrap.textFlow, ConversionType.STRING_TYPE) as String; // If there are no newlines there is nothing // more to do. if (pastedText.search(ALL_NEWLINES_REGEXP) != -1) { pastedText = pastedText.replace(ALL_NEWLINES_REGEXP, ""); po.textScrap = TextClipboard.importToScrap(pastedText, po.textScrap.isPlainText() ? TextConverter.PLAIN_TEXT_FORMAT : TextConverter.TEXT_LAYOUT_FORMAT); } i.e. calling importToScap a second time when pasting text that contains a new line In the second import it calls importToFlow which calls importFromString and then importFromXML: protected function importFromXML(xmlSource:XML):TextFlow // Parse an XFL hierarchy into a TextFlow, using the geometry supplied by a TextFrame // to host child containers (e.g. tables). This is the main entry point into this class. { return parseContent(xmlSource[0]); } In the second case xmlSource does't have any children and xmlSource[0] does't exist so importFromXML returns null causing the RTE. I'm not 100% what the best solution to solve this issue is however. > RTE at TextClipboard#importToScrap() > ------------------------------------ > > Key: FLEX-34013 > URL: https://issues.apache.org/jira/browse/FLEX-34013 > Project: Apache Flex > Issue Type: Bug > Components: Spark: RichEditableText > Affects Versions: Apache Flex 4.11.0 > Environment: Windows 7 > Reporter: Shigeru Nakagaki > Labels: easytest > Attachments: TextScrap.fxp > > > This problem should be related with FLEX-33988. > However, I guess this is not same problem exactly. > I can not reproduce this RTE. But it's happened. > thanks > TypeError: Error #1009 > at flashx.textLayout.edit::TextClipboard$/http://ns.adobe.com/textLayout/internal/2008::importToScrap() > at spark.components::RichEditableText/textContainerManager_flowOperationBeginHandler() > at flash.events::EventDispatcher/dispatchEvent() > at flashx.textLayout.container::TextContainerManager/dispatchEvent() > at flash.events::EventDispatcher/dispatchEvent() > at flashx.textLayout.elements::TextFlow/dispatchEvent() > at flashx.textLayout.edit::EditManager/doInternal() > at flashx.textLayout.edit::EditManager/doOperation() > at flashx.textLayout.edit::EditManager/pasteTextScrap() > at flashx.textLayout.edit::EditManager/editHandler() > at flashx.textLayout.container::ContainerController/editHandler() > at flashx.textLayout.container::TextContainerManager/editHandler() > at flash.desktop::NativeApplication/_onKeyDownBubble() -- This message was sent by Atlassian JIRA (v6.2#6252)