flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alessandro Palombaro (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLEX-34744) TextFlowElement parent nulled when addChild method used via parent reference
Date Tue, 10 Feb 2015 00:12:35 GMT

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

Alessandro Palombaro commented on FLEX-34744:

Thanks for looking into it. I did some more testing between the altered behavior between 4.14.0
and 4.12.1 (Sorry but don't have 4.13 readily available on this machine) and 4.14.0 removes/merges
the original terminator regardless of formatting. 

It not only replaces the terminator with its own but it neglects to carry over any properties
set on the previous terminator such as userStyles, styles, id (which is what causes our application
to break as we used these empty spans to search the flow)

Is there any reason why the old behavior can't be maintained? In 4.12.1 adding a new span
to the parent seems to just shift the terminator reference to the new span without 'merging'
the existing span.

It might not make sense... but TLF previously had this "non-sense" behavior which existing
applications have been built around. I can easily find ways to modify our existing applications
to function with the updated behavior but I also imagine I'm not the only one to have their
application break from this change. If it equates to a large effort on your behalf (and potentially
results in tables no longer working) then I'm happy to just accept the change and leave this
ticket here for reference in-case other people come across the change.

> TextFlowElement parent nulled when addChild method used via parent reference
> ----------------------------------------------------------------------------
>                 Key: FLEX-34744
>                 URL: https://issues.apache.org/jira/browse/FLEX-34744
>             Project: Apache Flex
>          Issue Type: Bug
>    Affects Versions: Apache Flex 4.14.0
>            Reporter: Alessandro Palombaro
>            Assignee: Harbs
> Example application below. This worked fine in version 4.13.0
> {code:xml}
> <?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"
>                applicationComplete="_this_applicationCompleteHandler(event)" frameRate="60"
>                backgroundAlpha="0">
> 	<fx:Script>
> 		<![CDATA[
> 		import flashx.textLayout.elements.FlowElement;
> 		import flashx.textLayout.elements.SpanElement;
> 		import flashx.textLayout.elements.TextFlow;
> 		import mx.events.FlexEvent;
> 		import spark.utils.TextFlowUtil;
> 		protected function _this_applicationCompleteHandler(event:FlexEvent):void
> 		{
> 			var flow:TextFlow = TextFlowUtil.importFromXML(xml);
> 			var span:SpanElement = new SpanElement();
> 			var target:FlowElement = flow.getElementByID("SpanElementId") as SpanElement;
> 			// target.parent is instance of ParagraphElement
> 			trace("EngineTesting._this_applicationCompleteHandler", target.parent);
> 			target.parent.addChild(span);
> 			// target.parent has been set to null when it should still reference the ParagraphElement
> 			trace("EngineTesting._this_applicationCompleteHandler", target.parent);
> 			richText.textFlow = flow;
> 		}
> 		]]>
> 	</fx:Script>
> 	<fx:Declarations>
> 		<fx:XML id="xml">
> 			<div>
> 				<p><span id="SpanElementId" uid="5501" width="250" height="180"/></p>
> 				<p>Hello World.</p>
> 			</div>
> 		</fx:XML>
> 	</fx:Declarations>
> 	<s:RichText width="100%" id="richText"/>
> </s:Application>
> {code}

This message was sent by Atlassian JIRA

View raw message