You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flex.apache.org by "Benjamin Chalupka (JIRA)" <ji...@apache.org> on 2015/06/16 15:15:01 UTC

[jira] [Commented] (FLEX-34891) TLF: pasted text doesn't get the format of the original text

    [ https://issues.apache.org/jira/browse/FLEX-34891?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14588015#comment-14588015 ] 

Benjamin Chalupka commented on FLEX-34891:
------------------------------------------

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
					   xmlns:s="library://ns.adobe.com/flex/spark"
					   xmlns:mx="library://ns.adobe.com/flex/mx">
	<fx:Script>
		<![CDATA[
			import flash.text.engine.FontWeight;
			import flashx.textLayout.formats.TextLayoutFormat;

			private var bold:Boolean;

			private function boldButton_clickHandler(event:MouseEvent):void {
				bold = !bold;
				var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
				if (bold)
					textLayoutFormat.fontWeight = FontWeight.BOLD;
				else
					textLayoutFormat.fontWeight = FontWeight.NORMAL;
				format = textLayoutFormat;
			}

			/**
			 * The format of the whole text or the current selection.
			 */
			private function set format(value:TextLayoutFormat):void {
				if (!value)
					return;
				richEditableText.setFormatOfRange(value);
			}
		]]>
	</fx:Script>
	<s:layout>
		<s:VerticalLayout/>
	</s:layout>
	<s:Button id="boldButton"
			  label="Bold"
			  click="boldButton_clickHandler(event)"/>
	<s:RichEditableText id="richEditableText"
						width="100%"
						fontFamily="Arial"
						fontSize="20"/>
</s:WindowedApplication>


> TLF: pasted text doesn't get the format of the original text
> ------------------------------------------------------------
>
>                 Key: FLEX-34891
>                 URL: https://issues.apache.org/jira/browse/FLEX-34891
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: RichEditableText
>    Affects Versions: Apache Flex 4.14.1
>         Environment: Windows 8.1
>            Reporter: Benjamin Chalupka
>              Labels: format, richeditabletext, tlf
>
> If the format of a RichEditableText was changed the first and the last line of the inserted text get the correct format. The other lines get the format before the format change.



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