You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Harbs <ha...@gmail.com> on 2015/10/04 11:36:53 UTC

Re: FLEX-34876

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 <ah...@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" <ha...@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
> 


Re: FLEX-34876

Posted by Alex Harui <ah...@adobe.com>.
Sorry, forgot to reply sooner. I did look and no I don't have access to the history.


Sent from my LG G3, an AT&T 4G LTE smartphone


------ Original message------

From: Harbs

Date: Mon, Oct 12, 2015 9:25 AM

To: dev@flex.apache.org;

Subject:Re: FLEX-34876


Alex,

Have you had a chance to look and see if you can find it?

On Oct 4, 2015, at 5:36 PM, Alex Harui <ah...@adobe.com> wrote:

>
>
> On 10/4/15, 7:03 AM, "Harbs" <ha...@gmail.com> wrote:
>>
>>>>
>>>> Is there any way to see when that condition was added and maybe figure
>>>> out why?
>>>
>>> Git blame should show you.
>>
>> I already looked at that. It came from the Adobe code base (i.e. it
>> blames you…) ;-). AFAIK, there’s no way to look further back than that
>> using Git. Google did not turn up anything related to the old code base,
>> and I do not know where to look.
>
> Oh yeah, forgot about that.  I might have an old copy on an old computer,
> but I won’t be in my office to look until Wednesday.
>
> -Alex
>


Re: FLEX-34876

Posted by Harbs <ha...@gmail.com>.
Alex,

Have you had a chance to look and see if you can find it?

On Oct 4, 2015, at 5:36 PM, Alex Harui <ah...@adobe.com> wrote:

> 
> 
> On 10/4/15, 7:03 AM, "Harbs" <ha...@gmail.com> wrote:
>> 
>>>> 
>>>> Is there any way to see when that condition was added and maybe figure
>>>> out why?
>>> 
>>> Git blame should show you.
>> 
>> I already looked at that. It came from the Adobe code base (i.e. it
>> blames you…) ;-). AFAIK, there’s no way to look further back than that
>> using Git. Google did not turn up anything related to the old code base,
>> and I do not know where to look.
> 
> Oh yeah, forgot about that.  I might have an old copy on an old computer,
> but I won’t be in my office to look until Wednesday.
> 
> -Alex
> 


Re: FLEX-34876

Posted by Alex Harui <ah...@adobe.com>.

On 10/4/15, 7:03 AM, "Harbs" <ha...@gmail.com> wrote:
>
>>> 
>>> Is there any way to see when that condition was added and maybe figure
>>> out why?
>> 
>> Git blame should show you.
>
>I already looked at that. It came from the Adobe code base (i.e. it
>blames you…) ;-). AFAIK, there’s no way to look further back than that
>using Git. Google did not turn up anything related to the old code base,
>and I do not know where to look.

Oh yeah, forgot about that.  I might have an old copy on an old computer,
but I won’t be in my office to look until Wednesday.

-Alex


Re: FLEX-34876

Posted by Harbs <ha...@gmail.com>.
> 
> I thought this was strictly about plain text insertion, in which case #1
> would be my expectations.
> 
> If there is formatting available, the formatting should be preserved, IMO.

Yes. This is for unformatted text. (applyFormat is false if the incoming text is formatted)

>> 
>> Is there any way to see when that condition was added and maybe figure
>> out why?
> 
> Git blame should show you.

I already looked at that. It came from the Adobe code base (i.e. it blames you…) ;-). AFAIK, there’s no way to look further back than that using Git. Google did not turn up anything related to the old code base, and I do not know where to look.

Re: FLEX-34876

Posted by Alex Harui <ah...@adobe.com>.

On 10/4/15, 2:36 AM, "Harbs" <ha...@gmail.com> wrote:

>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.

I thought this was strictly about plain text insertion, in which case #1
would be my expectations.

If there is formatting available, the formatting should be preserved, IMO.

>
>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?

Git blame should show you.

-Alex