Bamen Ngaba Jeanne created FLEX-34929:
-----------------------------------------

             Summary: Error #1009 when copy/paste a text with style effect in a 
RichEditableText/RichTextEditor
                 Key: FLEX-34929
                 URL: https://issues.apache.org/jira/browse/FLEX-34929
             Project: Apache Flex
          Issue Type: Bug
          Components: mx: Rich Text Editor, Spark: RichEditableText
         Environment: Windows 7 , chrome/firefox/ie11, Adobe® Flash® Builder™® 
4.7, Apache Flex 4.14.1,  
            Reporter: Bamen Ngaba Jeanne


When you copy/paste a text with style effect (bold, italic, ...) at the end of 
a RichEditableText / RichTextEditor, the paste text is cropped and you have an 
Error #1009.


Test code :

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"; 
                           xmlns:s="library://ns.adobe.com/flex/spark" 
xmlns:EmbedWS="EmbedWS.*" xmlns:local="*">
        
        <fx:Declarations>
                <!--local:WSLoader id="ws" xmlns:local="*"></local:WSLoader-->
        </fx:Declarations>
        <fx:Script>
                <![CDATA[
                        import flash.text.engine.FontWeight;
                        
                        import flashx.textLayout.conversion.ConversionType;
                        import flashx.textLayout.conversion.TextConverter;
                        import flashx.textLayout.elements.ParagraphElement;
                        import flashx.textLayout.elements.SpanElement;
                        import flashx.textLayout.elements.TextFlow;
                        
                        public function setTextFlow ():TextFlow {
                                var textFlow:TextFlow = new TextFlow();
                                var p:ParagraphElement = new ParagraphElement();
                                var span1:SpanElement = new SpanElement();
                                var span2:SpanElement = new SpanElement();
                                var span3:SpanElement = new SpanElement();
                                span1.text = "Hello, bla bla bla ";
                                span2.text = "bold content";
                                span3.text = " blabla bla.";
                                
                                span2.fontWeight = FontWeight.BOLD;
                                
                                p.addChild(span1);
                                p.addChild(span2);
                                p.addChild(span3);
                                
                                textFlow.addChild(p);
                                
                                return textFlow;
                        }
                        
                        public function display_tlf ():String{
                                var tlf = TextConverter.export( rte.textFlow, 
TextConverter.TEXT_LAYOUT_FORMAT, ConversionType.STRING_TYPE).toString(); 
                                return tlf;
                        }
                ]]>
        </fx:Script>
        
        <s:applicationComplete>
                
        </s:applicationComplete>
        <s:VGroup left="10" right="10" top="10" bottom="10">
                <s:RichEditableText id="rte" width="100%" height="25%" 
textFlow="{setTextFlow()}"></s:RichEditableText>
                
                <s:HGroup>
                        <s:Button label="Show tlf Text" click="tlfText.text = 
display_tlf();"/>
                </s:HGroup>
                
                <s:TextArea id="tlfText" width="100%" height="25%"/>
                
                <s:HGroup>
                        <s:Button label="Show Plain Text" click="rteText.text = 
rte.text;"/>
                </s:HGroup>
                
                <s:TextArea id="rteText" width="100%" height="25%"/>
        </s:VGroup>
        
</s:Application>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to