Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
Apache Flex 4.9.0, Apache Flex 4.11.0
-
None
-
Windows 7 and OS X.
Description
Sometimes the RichText component gets a null object reference when truncating text.
Here is an example:
<?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>