You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flex.apache.org by "Alex Harui (JIRA)" <ji...@apache.org> on 2014/02/07 22:33:19 UTC
[jira] [Commented] (FLEX-34020) Null object reference when
truncating RichText
[ https://issues.apache.org/jira/browse/FLEX-34020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13895074#comment-13895074 ]
Alex Harui commented on FLEX-34020:
-----------------------------------
Yeah, but I don't think that's the right answer. pass0Lines shouldn't be reset to length of 0. The changes below seemed to fix it. I have to run regression tests on it but let me know if it works for you.
--- a/textLayout/src/flashx/textLayout/factory/TextLineFactoryBase.as
+++ b/textLayout/src/flashx/textLayout/factory/TextLineFactoryBase.as
@@ -84,9 +84,9 @@ package flashx.textLayout.factory
static tlf_internal var _factoryComposer:SimpleCompose;
/** @private */
- static protected var _truncationLineIndex:int; // used during truncation
+ protected var _truncationLineIndex:int; // used during truncation
/** @private */
- static protected var _pass0Lines:Array; // used during truncation
+ protected var _pass0Lines:Array; // used during truncation
/** @private return the next factory composer that will be used */
static tlf_internal function peekFactoryCompose():SimpleCompose
> Null object reference when truncating RichText
> ----------------------------------------------
>
> Key: FLEX-34020
> URL: https://issues.apache.org/jira/browse/FLEX-34020
> Project: Apache Flex
> Issue Type: Bug
> Components: Spark: RichText
> Affects Versions: Apache Flex 4.9.0, Apache Flex 4.11.0
> Environment: Windows 7 and OS X.
> Reporter: Curtis Aube
> Assignee: Alex Harui
> Attachments: FLEX-34020.patch
>
>
> Sometimes the RichText component gets a null object reference when truncating text.
> Here is an example:
> {code:ActionScript}
> <?xml version="1.0" encoding="utf-8"?>
> <s:Application creationComplete="creationComplete()" minHeight="600" minWidth="955" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"
> xmlns:s="library://ns.adobe.com/flex/spark">
> <fx:Script>
> <![CDATA[
> import flashx.textLayout.conversion.TextConverter;
> import flashx.textLayout.elements.TextFlow;
> private function creationComplete():void
> {
> var htmlText:String = "<ul><li>This is a test of a sentence that is really long. So long that it causes a null object reference for some reason.</li></ul>";
> htmlText += "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed volutpat neque tellus, vitae pellentesque lectus posuere eget. Donec eget congue nisi, vel consectetur massa. Morbi suscipit justo neque, at varius arcu imperdiet sit amet. Phasellus volutpat nulla mauris, ac suscipit arcu condimentum vitae. Sed lobortis ligula enim, eu egestas diam congue quis. Nullam pellentesque condimentum mi, eu tincidunt eros imperdiet elementum. In blandit risus ac lorem tincidunt, quis sagittis felis euismod. Vestibulum justo nibh, imperdiet pharetra iaculis vel, fermentum in dolor. Fusce ut urna pharetra, commodo felis in, rhoncus metus. Pellentesque facilisis, tortor at feugiat dignissim, dui lectus tempor justo, ut condimentum massa mi quis risus. Pellentesque sodales, massa ut sodales fringilla, augue dolor cursus eros, ac pretium est nisl a eros. Etiam nec erat dapibus, scelerisque nibh et, consectetur risus. Nullam vitae convallis leo. Aliquam sed lorem facilisis, fringilla quam ut, semper urna. ";
> var tf:TextFlow = TextConverter.importToFlow(htmlText, TextConverter.TEXT_FIELD_HTML_FORMAT);
> rt.textFlow = tf;
> }
> ]]>
> </fx:Script>
> <s:RichText id="rt" width="600" maxDisplayedLines="10"/>
> </s:Application>
> {code}
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)