I just looked into what is needed to fix this.

There’s two ways it could be handled:
1) All the text takes on the formatting of the first insertion point.
2) If there’s multiple paragraphs selected, the paragraphs pasted take on the 
formatting of the existing paragraphs (i.e. incoming para 1 takes on existing 
para 1, para 2 takes on #2, etc.) if there’s more incoming paragraphs than 
existing ones, the last para take on the formatting of the last para.

I think option #2 is somewhat more preferable, but seems harder to implement. I 
think either one is an acceptable solution.

Here’s my question:

It loks to me like replacing line 254 in TextFlowEdit.as:
                                        if (applyFormat && firstParagraph)
with:
                                        if (applyFormat)
gets the effect of #1, but I’m not sure why the firstParagraph condition is 
there. I made the change and all tests still seem to pass, so at first blush 
this seems like a good easy way to fix this bug. But I don’t want to remove the 
condition without understanding it.

Is there any way to see when that condition was added and maybe figure out why?

On Jun 3, 2015, at 7:25 AM, Alex Harui <aha...@adobe.com> wrote:

> This is a scenario about pasting plain text, is that correct?  I’d think
> of it this way: what if you typed in the same character sequence?  What
> would/should happen as you hit return?
> 
> -Alex
> 
> On 6/2/15, 7:28 PM, "Harbs" <harbs.li...@gmail.com> wrote:
> 
>> I just filed a bug related to pasting multiple lines of text into a
>> TextFlow. This bug has apparently been around for a long time. I tested
>> using Flex 4.5, and it had the same problem there as it does today.
>> 
>> I would like to work on the bug, but I have some questions on expected
>> behavior.
>> 
>> First, it would be really great if someone could take my code that
>> illustrates the problem and turn it into a proper Unit Test so it’s
>> covered by the tests once it’s fixed. Piotr, are you up to that task?
>> 
>> Now, about behavior: What should behavior be when text is pasted.
>> Presumably, the text should tai on the formatting of the text it’s being
>> pasted into. What if the text has multiple spans or paragraphs of
>> formatting? Should it pick up the formatting on a paragraph-by-paragraph
>> basis? What if the number of paragraphs do not match up?
>> 
>> Harbs
> 

Reply via email to