You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flex.apache.org by "Christofer Dutz (JIRA)" <ji...@apache.org> on 2014/07/11 15:37:05 UTC

[jira] [Commented] (FLEX-34407) a bug of TextClipboard#importToScrap()

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

Christofer Dutz commented on FLEX-34407:
----------------------------------------

Had to look twice, but you are right ... have to admit that I really hate for, if, else etc. without curly braces. Makes code so much easier to misinterpret.

> a bug of TextClipboard#importToScrap()
> --------------------------------------
>
>                 Key: FLEX-34407
>                 URL: https://issues.apache.org/jira/browse/FLEX-34407
>             Project: Apache Flex
>          Issue Type: Bug
>    Affects Versions: Apache Flex 4.11.0
>         Environment: Windows 7 64bit Japanese, AIR 14, Apache Flex SDK 4.11.0
>            Reporter: Shigeru Nakagaki
>
> We got an exception at TextClipboard#importToScrap() but I can not reproduce.
>  TypeError: Error #1009
>  	at flashx.textLayout.edit::TextClipboard$/http://ns.adobe.com/textLayout/internal/2008::importToScrap()
>  	at flashx.textLayout.edit::TextClipboard$/http://ns.adobe.com/textLayout/internal/2008::importScrap()
>  	at flashx.textLayout.edit::TextClipboard$/getContents()
>  	at flashx.textLayout.edit::EditManager/editHandler()
>  	at flashx.textLayout.container::ContainerController/editHandler()
>  	at flashx.textLayout.container::TextContainerManager/editHandler()
>  	at flash.desktop::NativeApplication/_onKeyDownBubble()
> So I looked into the code and I guess I found a wrong logic.
> Here is the code of TextClipboard#importToScrap().
> /**---------+---------+---------+---------+---------+---------+---------+*/
> var textFlow:TextFlow = importer.importToFlow(textOnClipboard);
> if (textFlow)
> 	textScrap = new TextScrap(textFlow);
> /** Hint to the scrap about whether text is plain or formatted. If not set, scrap will inspect text for attributes. */
> if (format == TextConverter.PLAIN_TEXT_FORMAT)
> 	textScrap.setPlainText(true);
> else if (format == TextConverter.TEXT_LAYOUT_FORMAT)
> 	textScrap.setPlainText(false);
> // Backwards compatibility: check for older scrap format
> if (!textScrap && format == TextConverter.TEXT_LAYOUT_FORMAT)
> 	textScrap = importOldTextLayoutFormatToScrap(textOnClipboard);
> /**---------+---------+---------+---------+---------+---------+---------+*/
> The block of "Backwards compatibility: check for older scrap format" should be above the block of "if (format == TextConverter.PLAIN_TEXT_FORMAT)", right?
> thanks



--
This message was sent by Atlassian JIRA
(v6.2#6252)