You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Mihai Chira <mi...@gmail.com> on 2015/09/09 18:37:20 UTC

Fwd: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Hey guys (addressed to Piotr and Harbs),

if you have time to take a look at this, it would really help. I have
a feeling you'd have much better ideas on how to go forward with the
fix.

Many thanks!


---------- Forwarded message ----------
From: Mihai Chira (JIRA) <ji...@apache.org>
Date: 9 September 2015 at 18:35
Subject: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager -
TextFlowEdit -insertTextScrap
To: issues@flex.apache.org



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

Mihai Chira edited comment on FLEX-34807 at 9/9/15 4:35 PM:
------------------------------------------------------------

*Investigation update*: this bug was (highly likely) introduced by
commit [33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35|https://fisheye6.atlassian.com/changelog/flex-tlf?cs=33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35]
on the 5th Oct 2014. If I comment out the last if clause of
{{ParagraphElement.ensureTerminatorAfterReplace()}}, which was added
by that commit (and subsequently edited into its current form), the
bug disappears. That's because the algorithm in
{{TextFlowEdit.insertTextScrap()}} requires at least one
FlowLeafElement before which to add the pasted contents, and before
this bug was introduced, that used to be
{{ParagraphElement.terminatorSpan}}. But since the commit the
terminatorSpan has been merged into the previous span.
This seems to imply that there is an expectation in
{{TextFlowEdit.insertTextScrap()}} that {{destinationLeaf}} should
never be null (despite the null check in the line {code}insertPosition
= destinationLeaf ? destinationLeaf.getAbsoluteStart() :
textFlow.textLength - 1;{code}.
I imagine that just commenting out the code is not a viable solution,
as it will break other functionality. So we'll need either [~harbs] or
[~pete21] to throw in some thoughts, if they have the time. Much
appreciated.


was (Author: evolverine):
*Investigation update*: this bug was (highly likely) introduced by
commit [33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35|https://fisheye6.atlassian.com/changelog/flex-tlf?cs=33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35]
on the 5th Oct 2014 by [~harbs]. If I comment out the last if clause
of {{ParagraphElement.ensureTerminatorAfterReplace()}}, which was
added by that commit (and subsequently edited into its current form),
the bug disappears. That's because the algorithm in
{{TextFlowEdit.insertTextScrap()}} requires at least one
FlowLeafElement before which to add the pasted contents, and before
this bug was introduced, that used to be
{{ParagraphElement.terminatorSpan}}. But since the commit the
terminatorSpan has been merged into the previous span.
This seems to imply that there is an expectation in
{{TextFlowEdit.insertTextScrap()}} that {{destinationLeaf}} should
never be null (despite the null check in the line {code}insertPosition
= destinationLeaf ? destinationLeaf.getAbsoluteStart() :
textFlow.textLength - 1;{code}.
I imagine that just commenting out the code is not a viable solution,
as it will break other functionality. So we'll need either [~harbs] or
[~pete21] to throw in some thoughts, if they have the time. Much
appreciated.

> TLF - EditManager - TextFlowEdit -insertTextScrap
> -------------------------------------------------
>
>                 Key: FLEX-34807
>                 URL: https://issues.apache.org/jira/browse/FLEX-34807
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: RichEditableText
>    Affects Versions: Apache Flex 4.12.0, Apache Flex 4.13.0, Apache Flex 4.14.0
>            Reporter: Robbyn Gerhardt
>            Assignee: Mihai Chira
>              Labels: editmanager, richeditabletext, tlf
>         Attachments: Bildschirmfoto 2015-03-19 um 15.28.19.png, Bildschirmfoto 2015-03-20 um 09.06.47.png, TextEditorTest.air, TextEditorTest.fxp
>
>
> 1. Copy Formatted text from RichEditableText Editor, see Image
> 2. Insert Formatted text from the clipboard with Ctrl + V in the editor. Then comes the error.
> TypeError: Error #1009: Cannot access a property or method of a null object reference.
>       at flashx.textLayout.edit::TextFlowEdit$/insertTextScrap()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/TextFlowEdit.as:244]
>       at flashx.textLayout.operations::PasteOperation/doOperation()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/operations/PasteOperation.as:102]
>       at flashx.textLayout.edit::EditManager/doInternal()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:767]
>       at flashx.textLayout.edit::EditManager/doOperation()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:647]
>       at flashx.textLayout.edit::EditManager/pasteTextScrap()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:1806]
>       at flashx.textLayout.edit::EditManager/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:270]
>       at flashx.textLayout.container::ContainerController/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/container/ContainerController.as:2739]
>       at flashx.textLayout.container::TextContainerManager/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/container/TextContainerManager.as:1876]
>       at flash.display::NativeMenuItem/select()
>       at flash.display::NativeMenuItem/performKeyEquivalent()
>       at flash.display::NativeMenu/_menuItemPerformKeyEquivalent()
>       at flash.display::NativeMenu/performKeyEquivalent()
>       at flash.display::NativeMenuItem/_menuPerformKeyEquivalent()
>       at flash.display::NativeMenuItem/performKeyEquivalent()
>       at flash.display::NativeMenu/_menuItemPerformKeyEquivalent()
>       at flash.display::NativeMenu/performKeyEquivalent()
>       at flash.desktop::NativeApplication/_menuPerformKeyEquivalent()
>       at flash.desktop::NativeApplication/_onKeyDownCapture()



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Re: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by Mihai Chira <mi...@gmail.com>.
Thanks for the detailed steps. If I ever need to debug tlf unit tests
again and the browser won't work it's great to have an alternative.

On 23 September 2015 at 06:42, piotrz <pi...@gmail.com> wrote:
> Mihai,
>
> This is the projects [1] which you have to import to intellij in order to
> have compilation through IDE.
>
> automation_apps general config [2]
> automation_apps dependencies [3]
> You will have to add also CONFIG::minimaltests property in Compiler options.
>
> automation_core general config [4]
> automation_core dependencies [5]
>
> automation_tests general config [6]
> automation_tests dependencies [7]
>
> testApps general config [8]
> testApps dependencies [9]
>
> textLayout_editBar general config [10]
> textLayout_editBar dependencies [11]
>
> textLayout_ui general config [12]
> textLayout_ui dependencies [13]
>
> Note one thing that you will be testing SDK which you have in the
> dependencies, so you have to make sure that you are using Nightly Build with
> your fixes.
>
> [1] http://images.devs-on.net/Image/WY8gRN0bnO0ssCfE-Obszar.png
> [2] http://images.devs-on.net/Image/EkrYrClZMgSrPO0b-Obszar.png
> [3] http://images.devs-on.net/Image/sPFlSZskhgOoqC08-Obszar.png
> [4] http://images.devs-on.net/Image/4PuPkwaKmREmwzVa-Obszar.png
> [5] http://images.devs-on.net/Image/FKT1s2Kw6c6qoJbw-Obszar.png
> [6] http://images.devs-on.net/Image/hC2dn0hzukV1Pdhf-Obszar.png
> [7] http://images.devs-on.net/Image/1huQkY4DRsbysgt2-Obszar.png
> [8] http://images.devs-on.net/Image/emzDxEeW2qIijLLm-Obszar.png
> [9] http://images.devs-on.net/Image/ji0zuoYJZsqnltFY-Obszar.png
> [10] http://postimg.org/image/b73v4dzhf/
> [11] http://postimg.org/image/ik91s05up/
> [12] http://postimg.org/image/itl057i21/
> [13] http://postimg.org/image/vdnn84kbd/
>
> Piotr
>
>
>
>
>
> -----
> Apache Flex PMC
> piotrzarzycki21@gmail.com
> --
> View this message in context: http://apache-flex-development.2333347.n4.nabble.com/Fwd-jira-Comment-Edited-FLEX-34807-TLF-EditManager-TextFlowEdit-insertTextScrap-tp49072p49313.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by piotrz <pi...@gmail.com>.
Mihai,

This is the projects [1] which you have to import to intellij in order to
have compilation through IDE.

automation_apps general config [2]
automation_apps dependencies [3]
You will have to add also CONFIG::minimaltests property in Compiler options.

automation_core general config [4]
automation_core dependencies [5]

automation_tests general config [6]
automation_tests dependencies [7]

testApps general config [8]
testApps dependencies [9]

textLayout_editBar general config [10]
textLayout_editBar dependencies [11]

textLayout_ui general config [12]
textLayout_ui dependencies [13]

Note one thing that you will be testing SDK which you have in the
dependencies, so you have to make sure that you are using Nightly Build with
your fixes.

[1] http://images.devs-on.net/Image/WY8gRN0bnO0ssCfE-Obszar.png
[2] http://images.devs-on.net/Image/EkrYrClZMgSrPO0b-Obszar.png
[3] http://images.devs-on.net/Image/sPFlSZskhgOoqC08-Obszar.png
[4] http://images.devs-on.net/Image/4PuPkwaKmREmwzVa-Obszar.png
[5] http://images.devs-on.net/Image/FKT1s2Kw6c6qoJbw-Obszar.png
[6] http://images.devs-on.net/Image/hC2dn0hzukV1Pdhf-Obszar.png
[7] http://images.devs-on.net/Image/1huQkY4DRsbysgt2-Obszar.png
[8] http://images.devs-on.net/Image/emzDxEeW2qIijLLm-Obszar.png
[9] http://images.devs-on.net/Image/ji0zuoYJZsqnltFY-Obszar.png
[10] http://postimg.org/image/b73v4dzhf/
[11] http://postimg.org/image/ik91s05up/
[12] http://postimg.org/image/itl057i21/
[13] http://postimg.org/image/vdnn84kbd/

Piotr





-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/Fwd-jira-Comment-Edited-FLEX-34807-TLF-EditManager-TextFlowEdit-insertTextScrap-tp49072p49313.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by Mihai Chira <mi...@gmail.com>.
I realise that I'm making the assumption that my latest tlf sources
are used (which include your fix), although I'm not sure if that's
true. (I think it is, because the fatal in the bug itself seems to not
be thrown.)

On 22 September 2015 at 12:55, Mihai Chira <mi...@gmail.com> wrote:
> I somehow managed to get two test functions running correctly (for
> some reason, the third one fails with a fatal - see below [1]). It
> would really help if you took a look at the test (just committed) to
> see if I started in the right direction. For now I'm just checking the
> plain text result, not formatting (will follow).
>
> It seems that there is a regression even at this stage: if my test
> code is correct, then when pasting "...<i>Hello<b> world</b>!</i>...",
> a new line is inserted at the end of the pasted code, as such:
>
> EXPECTED: "There...Hello world!... are many such..."
> ACTUAL: "There...Hello world!...
>  are many such..."
>
> [1] at UnitTest.ExtendedClasses::VellumTestCase/setUpFlowForTest()[C:\Users\evolverine\workspace\tlf\automation_core\src\UnitTest\ExtendedClasses\VellumTestCase.as:639]
> at UnitTest.ExtendedClasses::VellumTestCase/importContent()[C:\Users\evolverine\workspace\tlf\automation_core\src\UnitTest\ExtendedClasses\VellumTestCase.as:634]
> at UnitTest.ExtendedClasses::VellumTestCase/loadTestFile()[C:\Users\evolverine\workspace\tlf\automation_core\src\UnitTest\ExtendedClasses\VellumTestCase.as:700]
> at UnitTest.ExtendedClasses::VellumTestCase/setUpTest()[C:\Users\evolverine\workspace\tlf\automation_core\src\UnitTest\ExtendedClasses\VellumTestCase.as:221]
> at UnitTest.Tests::FLEX_34807_Test/setUpTest()[C:\Users\evolverine\workspace\tlf\automation_tests\src\UnitTest\Tests\FLEX_34807_Test.as:70]
> at Function/http://adobe.com/AS3/2006/builtin::apply()
> at flex.lang.reflect::Method/apply()[/Users/justinmclean/Documents/flex-flexunit/FlexUnit4/src/flex/lang/reflect/Method.as:233]
> at org.flexunit.runners.model::FrameworkMethod/invokeExplosively()[/Users/justinmclean/Documents/flex-flexunit/FlexUnit4/src/org/flexunit/runners/model/FrameworkMethod.as:190]
> at org.flexunit.internals.runners.statements::InvokeMethod/evaluate()[/Users/justinmclean/Documents/flex-flexunit/FlexUnit4/src/org/flexunit/internals/runners/statements/InvokeMethod.as:61]
> at org.flexunit.internals.runners.statements::SequencerWithDecoration/executeStep()[/Users/justinmclean/Documents/flex-flexunit/FlexUnit4/src/org/flexunit/internals/runners/statements/SequencerWithDecoration.as:89]
> at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete()[/Users/justinmclean/Documents/flex-flexunit/FlexUnit4/src/org/flexunit/internals/runners/statements/StatementSequencer.as:130]
> at org.flexunit.internals.runners.statements::StatementSequencer/evaluate()[/Users/justinmclean/Documents/flex-flexunit/FlexUnit4/src/org/flexunit/internals/runners/statements/StatementSequencer.as:98]
> at org.flexunit.internals.runners.statements::RunBeforesInline/evaluate()[/Users/justinmclean/Documents/flex-flexunit/FlexUnit4/src/org/flexunit/internals/runners/statements/RunBeforesInline.as:86]
> at org.flexunit.internals.runners.statements::RunAftersInline/evaluate()[/Users/justinmclean/Documents/flex-flexunit/FlexUnit4/src/org/flexunit/internals/runners/statements/RunAftersInline.as:93]
> at org.flexunit.internals.runners.statements::StackAndFrameManagement/handleTimerComplete()[/Users/justinmclean/Documents/flex-flexunit/FlexUnit4/src/org/flexunit/internals/runners/statements/StackAndFrameManagement.as:127]
> at flash.events::EventDispatcher/dispatchEventFunction()
> at flash.events::EventDispatcher/dispatchEvent()
> at flash.utils::Timer/tick()
>
> On 22 September 2015 at 12:31, Mihai Chira <mi...@gmail.com> wrote:
>> It's not that. The whole of Firefox shuts down (without warning, as if
>> I had closed it), not just the plugin. Same after changing the setting
>> you suggested. (I have the latest version of Firefox and of the Flash
>> content debugger.)
>> Do you know how I can use the projector debugger instead?
>>
>> On 22 September 2015 at 12:06, Harbs <ha...@gmail.com> wrote:
>>> You probably have the timeout set in Firefox and need to disable it. Check this:
>>> https://support.mozilla.org/en-US/questions/705051
>>>
>>> On Sep 22, 2015, at 12:44 PM, Mihai Chira <mi...@gmail.com> wrote:
>>>
>>>> That's great to know, Piotr. Yes, I was debugging using ant, and with
>>>> Alex's suggestion (thanks!) I could get the test to run in Firefox, to
>>>> which I could connect with a remote debugging session. The problem is,
>>>> most times the browser simply shuts down in the middle of debugging,
>>>> which isn't a way forward.
>>>> Could you please tell me how to get the content debugger to run the test?
>>>>
>>>> On 21 September 2015 at 21:35, piotrz <pi...@gmail.com> wrote:
>>>>> Mihai,
>>>>>
>>>>> As I understand you are running these test using ant ? Another option is
>>>>> running tests in Flash content debugger in Intellij. The question is how did
>>>>> you try run your tests ?
>>>>>
>>>>> Piotr
>>>>>
>>>>>
>>>>>
>>>>> -----
>>>>> Apache Flex PMC
>>>>> piotrzarzycki21@gmail.com
>>>>> --
>>>>> View this message in context: http://apache-flex-development.2333347.n4.nabble.com/Fwd-jira-Comment-Edited-FLEX-34807-TLF-EditManager-TextFlowEdit-insertTextScrap-tp49072p49281.html
>>>>> Sent from the Apache Flex Development mailing list archive at Nabble.com.
>>>

Re: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by Mihai Chira <mi...@gmail.com>.
I somehow managed to get two test functions running correctly (for
some reason, the third one fails with a fatal - see below [1]). It
would really help if you took a look at the test (just committed) to
see if I started in the right direction. For now I'm just checking the
plain text result, not formatting (will follow).

It seems that there is a regression even at this stage: if my test
code is correct, then when pasting "...<i>Hello<b> world</b>!</i>...",
a new line is inserted at the end of the pasted code, as such:

EXPECTED: "There...Hello world!... are many such..."
ACTUAL: "There...Hello world!...
 are many such..."

[1] at UnitTest.ExtendedClasses::VellumTestCase/setUpFlowForTest()[C:\Users\evolverine\workspace\tlf\automation_core\src\UnitTest\ExtendedClasses\VellumTestCase.as:639]
at UnitTest.ExtendedClasses::VellumTestCase/importContent()[C:\Users\evolverine\workspace\tlf\automation_core\src\UnitTest\ExtendedClasses\VellumTestCase.as:634]
at UnitTest.ExtendedClasses::VellumTestCase/loadTestFile()[C:\Users\evolverine\workspace\tlf\automation_core\src\UnitTest\ExtendedClasses\VellumTestCase.as:700]
at UnitTest.ExtendedClasses::VellumTestCase/setUpTest()[C:\Users\evolverine\workspace\tlf\automation_core\src\UnitTest\ExtendedClasses\VellumTestCase.as:221]
at UnitTest.Tests::FLEX_34807_Test/setUpTest()[C:\Users\evolverine\workspace\tlf\automation_tests\src\UnitTest\Tests\FLEX_34807_Test.as:70]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at flex.lang.reflect::Method/apply()[/Users/justinmclean/Documents/flex-flexunit/FlexUnit4/src/flex/lang/reflect/Method.as:233]
at org.flexunit.runners.model::FrameworkMethod/invokeExplosively()[/Users/justinmclean/Documents/flex-flexunit/FlexUnit4/src/org/flexunit/runners/model/FrameworkMethod.as:190]
at org.flexunit.internals.runners.statements::InvokeMethod/evaluate()[/Users/justinmclean/Documents/flex-flexunit/FlexUnit4/src/org/flexunit/internals/runners/statements/InvokeMethod.as:61]
at org.flexunit.internals.runners.statements::SequencerWithDecoration/executeStep()[/Users/justinmclean/Documents/flex-flexunit/FlexUnit4/src/org/flexunit/internals/runners/statements/SequencerWithDecoration.as:89]
at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete()[/Users/justinmclean/Documents/flex-flexunit/FlexUnit4/src/org/flexunit/internals/runners/statements/StatementSequencer.as:130]
at org.flexunit.internals.runners.statements::StatementSequencer/evaluate()[/Users/justinmclean/Documents/flex-flexunit/FlexUnit4/src/org/flexunit/internals/runners/statements/StatementSequencer.as:98]
at org.flexunit.internals.runners.statements::RunBeforesInline/evaluate()[/Users/justinmclean/Documents/flex-flexunit/FlexUnit4/src/org/flexunit/internals/runners/statements/RunBeforesInline.as:86]
at org.flexunit.internals.runners.statements::RunAftersInline/evaluate()[/Users/justinmclean/Documents/flex-flexunit/FlexUnit4/src/org/flexunit/internals/runners/statements/RunAftersInline.as:93]
at org.flexunit.internals.runners.statements::StackAndFrameManagement/handleTimerComplete()[/Users/justinmclean/Documents/flex-flexunit/FlexUnit4/src/org/flexunit/internals/runners/statements/StackAndFrameManagement.as:127]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.utils::Timer/tick()

On 22 September 2015 at 12:31, Mihai Chira <mi...@gmail.com> wrote:
> It's not that. The whole of Firefox shuts down (without warning, as if
> I had closed it), not just the plugin. Same after changing the setting
> you suggested. (I have the latest version of Firefox and of the Flash
> content debugger.)
> Do you know how I can use the projector debugger instead?
>
> On 22 September 2015 at 12:06, Harbs <ha...@gmail.com> wrote:
>> You probably have the timeout set in Firefox and need to disable it. Check this:
>> https://support.mozilla.org/en-US/questions/705051
>>
>> On Sep 22, 2015, at 12:44 PM, Mihai Chira <mi...@gmail.com> wrote:
>>
>>> That's great to know, Piotr. Yes, I was debugging using ant, and with
>>> Alex's suggestion (thanks!) I could get the test to run in Firefox, to
>>> which I could connect with a remote debugging session. The problem is,
>>> most times the browser simply shuts down in the middle of debugging,
>>> which isn't a way forward.
>>> Could you please tell me how to get the content debugger to run the test?
>>>
>>> On 21 September 2015 at 21:35, piotrz <pi...@gmail.com> wrote:
>>>> Mihai,
>>>>
>>>> As I understand you are running these test using ant ? Another option is
>>>> running tests in Flash content debugger in Intellij. The question is how did
>>>> you try run your tests ?
>>>>
>>>> Piotr
>>>>
>>>>
>>>>
>>>> -----
>>>> Apache Flex PMC
>>>> piotrzarzycki21@gmail.com
>>>> --
>>>> View this message in context: http://apache-flex-development.2333347.n4.nabble.com/Fwd-jira-Comment-Edited-FLEX-34807-TLF-EditManager-TextFlowEdit-insertTextScrap-tp49072p49281.html
>>>> Sent from the Apache Flex Development mailing list archive at Nabble.com.
>>

Re: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by Mihai Chira <mi...@gmail.com>.
It's not that. The whole of Firefox shuts down (without warning, as if
I had closed it), not just the plugin. Same after changing the setting
you suggested. (I have the latest version of Firefox and of the Flash
content debugger.)
Do you know how I can use the projector debugger instead?

On 22 September 2015 at 12:06, Harbs <ha...@gmail.com> wrote:
> You probably have the timeout set in Firefox and need to disable it. Check this:
> https://support.mozilla.org/en-US/questions/705051
>
> On Sep 22, 2015, at 12:44 PM, Mihai Chira <mi...@gmail.com> wrote:
>
>> That's great to know, Piotr. Yes, I was debugging using ant, and with
>> Alex's suggestion (thanks!) I could get the test to run in Firefox, to
>> which I could connect with a remote debugging session. The problem is,
>> most times the browser simply shuts down in the middle of debugging,
>> which isn't a way forward.
>> Could you please tell me how to get the content debugger to run the test?
>>
>> On 21 September 2015 at 21:35, piotrz <pi...@gmail.com> wrote:
>>> Mihai,
>>>
>>> As I understand you are running these test using ant ? Another option is
>>> running tests in Flash content debugger in Intellij. The question is how did
>>> you try run your tests ?
>>>
>>> Piotr
>>>
>>>
>>>
>>> -----
>>> Apache Flex PMC
>>> piotrzarzycki21@gmail.com
>>> --
>>> View this message in context: http://apache-flex-development.2333347.n4.nabble.com/Fwd-jira-Comment-Edited-FLEX-34807-TLF-EditManager-TextFlowEdit-insertTextScrap-tp49072p49281.html
>>> Sent from the Apache Flex Development mailing list archive at Nabble.com.
>

Re: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by Harbs <ha...@gmail.com>.
You probably have the timeout set in Firefox and need to disable it. Check this:
https://support.mozilla.org/en-US/questions/705051

On Sep 22, 2015, at 12:44 PM, Mihai Chira <mi...@gmail.com> wrote:

> That's great to know, Piotr. Yes, I was debugging using ant, and with
> Alex's suggestion (thanks!) I could get the test to run in Firefox, to
> which I could connect with a remote debugging session. The problem is,
> most times the browser simply shuts down in the middle of debugging,
> which isn't a way forward.
> Could you please tell me how to get the content debugger to run the test?
> 
> On 21 September 2015 at 21:35, piotrz <pi...@gmail.com> wrote:
>> Mihai,
>> 
>> As I understand you are running these test using ant ? Another option is
>> running tests in Flash content debugger in Intellij. The question is how did
>> you try run your tests ?
>> 
>> Piotr
>> 
>> 
>> 
>> -----
>> Apache Flex PMC
>> piotrzarzycki21@gmail.com
>> --
>> View this message in context: http://apache-flex-development.2333347.n4.nabble.com/Fwd-jira-Comment-Edited-FLEX-34807-TLF-EditManager-TextFlowEdit-insertTextScrap-tp49072p49281.html
>> Sent from the Apache Flex Development mailing list archive at Nabble.com.


Re: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by Mihai Chira <mi...@gmail.com>.
bump.
I will be away next week, so I can check your code when I return, from
the 20th. If you could take a look at it until then it would be great.
Thank you!

On 2 October 2015 at 14:53, Harbs <ha...@gmail.com> wrote:
> I will take a look next week.
>
> On Oct 2, 2015, at 3:49 PM, Mihai Chira <mi...@gmail.com> wrote:
>
>>> still the problem that the pasted text adds a new line (or a new
>>> paragraph, resulting in a new line when exported to plain text).
>>
>> Harbs, the fatal error is gone, which is great. Would you have time
>> these days to take a look at this regression? (Or whether it is a
>> regression in the first place, i.e. the unit test is correct?)
>> Thanks.
>

Re: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by Mihai Chira <mi...@gmail.com>.
Nice, thank you.

On 2 October 2015 at 13:53, Harbs <ha...@gmail.com> wrote:
> I will take a look next week.
>
> On Oct 2, 2015, at 3:49 PM, Mihai Chira <mi...@gmail.com> wrote:
>
>>> still the problem that the pasted text adds a new line (or a new
>>> paragraph, resulting in a new line when exported to plain text).
>>
>> Harbs, the fatal error is gone, which is great. Would you have time
>> these days to take a look at this regression? (Or whether it is a
>> regression in the first place, i.e. the unit test is correct?)
>> Thanks.
>

Re: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by Harbs <ha...@gmail.com>.
I will take a look next week.

On Oct 2, 2015, at 3:49 PM, Mihai Chira <mi...@gmail.com> wrote:

>> still the problem that the pasted text adds a new line (or a new
>> paragraph, resulting in a new line when exported to plain text).
> 
> Harbs, the fatal error is gone, which is great. Would you have time
> these days to take a look at this regression? (Or whether it is a
> regression in the first place, i.e. the unit test is correct?)
> Thanks.


Re: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by Mihai Chira <mi...@gmail.com>.
> still the problem that the pasted text adds a new line (or a new
> paragraph, resulting in a new line when exported to plain text).

Harbs, the fatal error is gone, which is great. Would you have time
these days to take a look at this regression? (Or whether it is a
regression in the first place, i.e. the unit test is correct?)
Thanks.

Re: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by Mihai Chira <mi...@gmail.com>.
Hi Piotr,
no worries, I found the reason why Firefox was closing unexpectedly:
when ran from ant, the ant task tries to make sure the browser is
closed once it finishes analysing the results. So then I could just
refresh the VellumUnit page in Firefox (rather than run it from ant)
and debug without problems.

If both you and Harbs could take a look at the test, to see if you
would add or change anything, it would help a lot. To me it feels
relatively comprehensive.

Harbs, from what I can tell from the failing unit tests, there is
still the problem that the pasted text adds a new line (or a new
paragraph, resulting in a new line when exported to plain text). Do
you have time to check it out these days? Thanks!

On 22 September 2015 at 12:52, piotrz <pi...@gmail.com> wrote:
> Mihai,
>
> I will try to describe it for you later today. :) It's a matter of import
> some modules and dependencies, but it is a bit tricky.
> We had with Harbs one session on skype and he was able to do this in Flash
> Builder as I remember.
>
> Piotr
>
>
>
> -----
> Apache Flex PMC
> piotrzarzycki21@gmail.com
> --
> View this message in context: http://apache-flex-development.2333347.n4.nabble.com/Fwd-jira-Comment-Edited-FLEX-34807-TLF-EditManager-TextFlowEdit-insertTextScrap-tp49072p49294.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by piotrz <pi...@gmail.com>.
Mihai,

I will try to describe it for you later today. :) It's a matter of import
some modules and dependencies, but it is a bit tricky. 
We had with Harbs one session on skype and he was able to do this in Flash
Builder as I remember.

Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/Fwd-jira-Comment-Edited-FLEX-34807-TLF-EditManager-TextFlowEdit-insertTextScrap-tp49072p49294.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by Mihai Chira <mi...@gmail.com>.
That's great to know, Piotr. Yes, I was debugging using ant, and with
Alex's suggestion (thanks!) I could get the test to run in Firefox, to
which I could connect with a remote debugging session. The problem is,
most times the browser simply shuts down in the middle of debugging,
which isn't a way forward.
Could you please tell me how to get the content debugger to run the test?

On 21 September 2015 at 21:35, piotrz <pi...@gmail.com> wrote:
> Mihai,
>
> As I understand you are running these test using ant ? Another option is
> running tests in Flash content debugger in Intellij. The question is how did
> you try run your tests ?
>
> Piotr
>
>
>
> -----
> Apache Flex PMC
> piotrzarzycki21@gmail.com
> --
> View this message in context: http://apache-flex-development.2333347.n4.nabble.com/Fwd-jira-Comment-Edited-FLEX-34807-TLF-EditManager-TextFlowEdit-insertTextScrap-tp49072p49281.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by piotrz <pi...@gmail.com>.
Mihai,

As I understand you are running these test using ant ? Another option is
running tests in Flash content debugger in Intellij. The question is how did
you try run your tests ?

Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/Fwd-jira-Comment-Edited-FLEX-34807-TLF-EditManager-TextFlowEdit-insertTextScrap-tp49072p49281.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by Alex Harui <ah...@adobe.com>.
In the flex-asjs/frameworks/projects/Core/as/tests/build.xml, we use the
“command” attribute to choose a browser to run the tests.

-Alex

On 9/21/15, 8:58 AM, "Mihai Chira" <mi...@gmail.com> wrote:

>All right, I have a very simple test going, but when I run it I see it
>fails with a fatal. Which wouldn't be a problem if I had the debugger
>version of flash player, to see what the error is. But I cannot
>install it [1]. Is there a way to get the unit tests to open with
>firefox instead? (Note that IE is not my default browser, but the
>tests still open in it.)
>
>[1] https://forums.adobe.com/message/7922164#7922164
>
>On 21 September 2015 at 11:43, Mihai Chira <mi...@gmail.com> wrote:
>> Thanks Piotr. I was just looking at a few of the tests now, and the
>> ones I can find with PasteOperation are
>> UnitTest.Tests.OperationTest.limitPasteTest() and
>> deleteNextCharExceptionTest(), but they are both a bit confusing: the
>> functions are marked private, and the only other references to them
>> are in the functions themselves. How are they ever run, then?
>>
>> I noticed from these functions that what I should be searching for is
>> SelManager.pasteTextScrap(), which is present in many of the tests.
>> I'll start by reading some of those.
>>
>> On 20 September 2015 at 21:26, piotrz <pi...@gmail.com> wrote:
>>> Mihai,
>>>
>>> As for the unit tests ping me if you will have any problems with fire
>>>it up.
>>> Take look ta the existing one.
>>>
>>> Alex,
>>>
>>> What's with the jenkins machine - is it still down ?
>>>
>>> Thanks,
>>> Piotr
>>>
>>>
>>>
>>> -----
>>> Apache Flex PMC
>>> piotrzarzycki21@gmail.com
>>> --
>>> View this message in context:
>>>http://apache-flex-development.2333347.n4.nabble.com/Fwd-jira-Comment-Ed
>>>ited-FLEX-34807-TLF-EditManager-TextFlowEdit-insertTextScrap-tp49072p492
>>>53.html
>>> Sent from the Apache Flex Development mailing list archive at
>>>Nabble.com.


Re: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by Mihai Chira <mi...@gmail.com>.
All right, I have a very simple test going, but when I run it I see it
fails with a fatal. Which wouldn't be a problem if I had the debugger
version of flash player, to see what the error is. But I cannot
install it [1]. Is there a way to get the unit tests to open with
firefox instead? (Note that IE is not my default browser, but the
tests still open in it.)

[1] https://forums.adobe.com/message/7922164#7922164

On 21 September 2015 at 11:43, Mihai Chira <mi...@gmail.com> wrote:
> Thanks Piotr. I was just looking at a few of the tests now, and the
> ones I can find with PasteOperation are
> UnitTest.Tests.OperationTest.limitPasteTest() and
> deleteNextCharExceptionTest(), but they are both a bit confusing: the
> functions are marked private, and the only other references to them
> are in the functions themselves. How are they ever run, then?
>
> I noticed from these functions that what I should be searching for is
> SelManager.pasteTextScrap(), which is present in many of the tests.
> I'll start by reading some of those.
>
> On 20 September 2015 at 21:26, piotrz <pi...@gmail.com> wrote:
>> Mihai,
>>
>> As for the unit tests ping me if you will have any problems with fire it up.
>> Take look ta the existing one.
>>
>> Alex,
>>
>> What's with the jenkins machine - is it still down ?
>>
>> Thanks,
>> Piotr
>>
>>
>>
>> -----
>> Apache Flex PMC
>> piotrzarzycki21@gmail.com
>> --
>> View this message in context: http://apache-flex-development.2333347.n4.nabble.com/Fwd-jira-Comment-Edited-FLEX-34807-TLF-EditManager-TextFlowEdit-insertTextScrap-tp49072p49253.html
>> Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by Mihai Chira <mi...@gmail.com>.
Thanks Piotr. I was just looking at a few of the tests now, and the
ones I can find with PasteOperation are
UnitTest.Tests.OperationTest.limitPasteTest() and
deleteNextCharExceptionTest(), but they are both a bit confusing: the
functions are marked private, and the only other references to them
are in the functions themselves. How are they ever run, then?

I noticed from these functions that what I should be searching for is
SelManager.pasteTextScrap(), which is present in many of the tests.
I'll start by reading some of those.

On 20 September 2015 at 21:26, piotrz <pi...@gmail.com> wrote:
> Mihai,
>
> As for the unit tests ping me if you will have any problems with fire it up.
> Take look ta the existing one.
>
> Alex,
>
> What's with the jenkins machine - is it still down ?
>
> Thanks,
> Piotr
>
>
>
> -----
> Apache Flex PMC
> piotrzarzycki21@gmail.com
> --
> View this message in context: http://apache-flex-development.2333347.n4.nabble.com/Fwd-jira-Comment-Edited-FLEX-34807-TLF-EditManager-TextFlowEdit-insertTextScrap-tp49072p49253.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by piotrz <pi...@gmail.com>.
Mihai,

As for the unit tests ping me if you will have any problems with fire it up.
Take look ta the existing one.

Alex,

What's with the jenkins machine - is it still down ? 

Thanks,
Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/Fwd-jira-Comment-Edited-FLEX-34807-TLF-EditManager-TextFlowEdit-insertTextScrap-tp49072p49253.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by Mihai Chira <mi...@gmail.com>.
Yes, I can work on it tomorrow or Tuesday. I'll let you know if I need
any help. Thank you for working on this!

On 20 September 2015 at 09:52, Harbs <ha...@gmail.com> wrote:
> Please check my latest commit [2192608]
>
> I think it’s being handled correctly.
> I’m nulling the span if it’s supposed to insert into the same paragraph and it’s no longer assuming the span is not null.
>
> I needed to do some special handling to make sure the insertion point is correct.
>
> We’re going to need unit tests for this bug. Can you handle that?
>
> On Sep 20, 2015, at 10:35 AM, Mihai Chira <mi...@gmail.com> wrote:
>
>> Thanks for checking this. Indeed, the pasting algorithm was assuming it
>> could always find the terminator and work with that.
>>
>> I'm afraid that I'm not familiar enough with tlf to implement an
>> alternative algorithm which works without the terminator. But it is causing
>> grief for a lot of our users. Do you think you'll have time to find another
>> way to implement the algorithm?
>>
>> Thanks.
>> On 20 Sep 2015 08:37, "Harbs" <ha...@gmail.com> wrote:
>>
>>> The issue here is as follows:
>>>
>>> The old code was not merging a the paragraph terminator when content was
>>> added. This left an extra terminator which caused all kinds of problems
>>> with the table code (I do not remember the details.) It’s also questionable
>>> whether it’s a good idea to preserve formatting in the terminator.
>>> mergeToPreviousIfPossible normally does not merge spans if there’s
>>> different formatting, but empty paragraph terminators are an exception and
>>> it always merges them even if the formatting is different.
>>>
>>> I think the new behavior is more correct, but we’re going to have to
>>> handle pasting text as a special case because the code is assuming the text
>>> is not normalized which it now (sort-of) is..
>>>
>>> On Sep 9, 2015, at 7:37 PM, Mihai Chira <mi...@gmail.com> wrote:
>>>
>>>> Hey guys (addressed to Piotr and Harbs),
>>>>
>>>> if you have time to take a look at this, it would really help. I have
>>>> a feeling you'd have much better ideas on how to go forward with the
>>>> fix.
>>>>
>>>> Many thanks!
>>>>
>>>>
>>>> ---------- Forwarded message ----------
>>>> From: Mihai Chira (JIRA) <ji...@apache.org>
>>>> Date: 9 September 2015 at 18:35
>>>> Subject: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager -
>>>> TextFlowEdit -insertTextScrap
>>>> To: issues@flex.apache.org
>>>>
>>>>
>>>>
>>>>   [
>>> https://issues.apache.org/jira/browse/FLEX-34807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14737128#comment-14737128
>>>> ]
>>>>
>>>> Mihai Chira edited comment on FLEX-34807 at 9/9/15 4:35 PM:
>>>> ------------------------------------------------------------
>>>>
>>>> *Investigation update*: this bug was (highly likely) introduced by
>>>> commit [33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35|
>>> https://fisheye6.atlassian.com/changelog/flex-tlf?cs=33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35
>>> ]
>>>> on the 5th Oct 2014. If I comment out the last if clause of
>>>> {{ParagraphElement.ensureTerminatorAfterReplace()}}, which was added
>>>> by that commit (and subsequently edited into its current form), the
>>>> bug disappears. That's because the algorithm in
>>>> {{TextFlowEdit.insertTextScrap()}} requires at least one
>>>> FlowLeafElement before which to add the pasted contents, and before
>>>> this bug was introduced, that used to be
>>>> {{ParagraphElement.terminatorSpan}}. But since the commit the
>>>> terminatorSpan has been merged into the previous span.
>>>> This seems to imply that there is an expectation in
>>>> {{TextFlowEdit.insertTextScrap()}} that {{destinationLeaf}} should
>>>> never be null (despite the null check in the line {code}insertPosition
>>>> = destinationLeaf ? destinationLeaf.getAbsoluteStart() :
>>>> textFlow.textLength - 1;{code}.
>>>> I imagine that just commenting out the code is not a viable solution,
>>>> as it will break other functionality. So we'll need either [~harbs] or
>>>> [~pete21] to throw in some thoughts, if they have the time. Much
>>>> appreciated.
>>>>
>>>>
>>>> was (Author: evolverine):
>>>> *Investigation update*: this bug was (highly likely) introduced by
>>>> commit [33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35|
>>> https://fisheye6.atlassian.com/changelog/flex-tlf?cs=33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35
>>> ]
>>>> on the 5th Oct 2014 by [~harbs]. If I comment out the last if clause
>>>> of {{ParagraphElement.ensureTerminatorAfterReplace()}}, which was
>>>> added by that commit (and subsequently edited into its current form),
>>>> the bug disappears. That's because the algorithm in
>>>> {{TextFlowEdit.insertTextScrap()}} requires at least one
>>>> FlowLeafElement before which to add the pasted contents, and before
>>>> this bug was introduced, that used to be
>>>> {{ParagraphElement.terminatorSpan}}. But since the commit the
>>>> terminatorSpan has been merged into the previous span.
>>>> This seems to imply that there is an expectation in
>>>> {{TextFlowEdit.insertTextScrap()}} that {{destinationLeaf}} should
>>>> never be null (despite the null check in the line {code}insertPosition
>>>> = destinationLeaf ? destinationLeaf.getAbsoluteStart() :
>>>> textFlow.textLength - 1;{code}.
>>>> I imagine that just commenting out the code is not a viable solution,
>>>> as it will break other functionality. So we'll need either [~harbs] or
>>>> [~pete21] to throw in some thoughts, if they have the time. Much
>>>> appreciated.
>>>>
>>>>> TLF - EditManager - TextFlowEdit -insertTextScrap
>>>>> -------------------------------------------------
>>>>>
>>>>>               Key: FLEX-34807
>>>>>               URL: https://issues.apache.org/jira/browse/FLEX-34807
>>>>>           Project: Apache Flex
>>>>>        Issue Type: Bug
>>>>>        Components: Spark: RichEditableText
>>>>>  Affects Versions: Apache Flex 4.12.0, Apache Flex 4.13.0, Apache Flex
>>> 4.14.0
>>>>>          Reporter: Robbyn Gerhardt
>>>>>          Assignee: Mihai Chira
>>>>>            Labels: editmanager, richeditabletext, tlf
>>>>>       Attachments: Bildschirmfoto 2015-03-19 um 15.28.19.png,
>>> Bildschirmfoto 2015-03-20 um 09.06.47.png, TextEditorTest.air,
>>> TextEditorTest.fxp
>>>>>
>>>>>
>>>>> 1. Copy Formatted text from RichEditableText Editor, see Image
>>>>> 2. Insert Formatted text from the clipboard with Ctrl + V in the
>>> editor. Then comes the error.
>>>>> TypeError: Error #1009: Cannot access a property or method of a null
>>> object reference.
>>>>>     at
>>> flashx.textLayout.edit::TextFlowEdit$/insertTextScrap()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/TextFlowEdit.as:244]
>>>>>     at
>>> flashx.textLayout.operations::PasteOperation/doOperation()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/operations/PasteOperation.as:102]
>>>>>     at
>>> flashx.textLayout.edit::EditManager/doInternal()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:767]
>>>>>     at
>>> flashx.textLayout.edit::EditManager/doOperation()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:647]
>>>>>     at
>>> flashx.textLayout.edit::EditManager/pasteTextScrap()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:1806]
>>>>>     at
>>> flashx.textLayout.edit::EditManager/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:270]
>>>>>     at
>>> flashx.textLayout.container::ContainerController/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/container/ContainerController.as:2739]
>>>>>     at
>>> flashx.textLayout.container::TextContainerManager/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/container/TextContainerManager.as:1876]
>>>>>     at flash.display::NativeMenuItem/select()
>>>>>     at flash.display::NativeMenuItem/performKeyEquivalent()
>>>>>     at flash.display::NativeMenu/_menuItemPerformKeyEquivalent()
>>>>>     at flash.display::NativeMenu/performKeyEquivalent()
>>>>>     at flash.display::NativeMenuItem/_menuPerformKeyEquivalent()
>>>>>     at flash.display::NativeMenuItem/performKeyEquivalent()
>>>>>     at flash.display::NativeMenu/_menuItemPerformKeyEquivalent()
>>>>>     at flash.display::NativeMenu/performKeyEquivalent()
>>>>>     at flash.desktop::NativeApplication/_menuPerformKeyEquivalent()
>>>>>     at flash.desktop::NativeApplication/_onKeyDownCapture()
>>>>
>>>>
>>>>
>>>> --
>>>> This message was sent by Atlassian JIRA
>>>> (v6.3.4#6332)
>>>
>>>
>

Re: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by Harbs <ha...@gmail.com>.
Please check my latest commit [2192608]

I think it’s being handled correctly.
I’m nulling the span if it’s supposed to insert into the same paragraph and it’s no longer assuming the span is not null.

I needed to do some special handling to make sure the insertion point is correct.

We’re going to need unit tests for this bug. Can you handle that?

On Sep 20, 2015, at 10:35 AM, Mihai Chira <mi...@gmail.com> wrote:

> Thanks for checking this. Indeed, the pasting algorithm was assuming it
> could always find the terminator and work with that.
> 
> I'm afraid that I'm not familiar enough with tlf to implement an
> alternative algorithm which works without the terminator. But it is causing
> grief for a lot of our users. Do you think you'll have time to find another
> way to implement the algorithm?
> 
> Thanks.
> On 20 Sep 2015 08:37, "Harbs" <ha...@gmail.com> wrote:
> 
>> The issue here is as follows:
>> 
>> The old code was not merging a the paragraph terminator when content was
>> added. This left an extra terminator which caused all kinds of problems
>> with the table code (I do not remember the details.) It’s also questionable
>> whether it’s a good idea to preserve formatting in the terminator.
>> mergeToPreviousIfPossible normally does not merge spans if there’s
>> different formatting, but empty paragraph terminators are an exception and
>> it always merges them even if the formatting is different.
>> 
>> I think the new behavior is more correct, but we’re going to have to
>> handle pasting text as a special case because the code is assuming the text
>> is not normalized which it now (sort-of) is..
>> 
>> On Sep 9, 2015, at 7:37 PM, Mihai Chira <mi...@gmail.com> wrote:
>> 
>>> Hey guys (addressed to Piotr and Harbs),
>>> 
>>> if you have time to take a look at this, it would really help. I have
>>> a feeling you'd have much better ideas on how to go forward with the
>>> fix.
>>> 
>>> Many thanks!
>>> 
>>> 
>>> ---------- Forwarded message ----------
>>> From: Mihai Chira (JIRA) <ji...@apache.org>
>>> Date: 9 September 2015 at 18:35
>>> Subject: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager -
>>> TextFlowEdit -insertTextScrap
>>> To: issues@flex.apache.org
>>> 
>>> 
>>> 
>>>   [
>> https://issues.apache.org/jira/browse/FLEX-34807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14737128#comment-14737128
>>> ]
>>> 
>>> Mihai Chira edited comment on FLEX-34807 at 9/9/15 4:35 PM:
>>> ------------------------------------------------------------
>>> 
>>> *Investigation update*: this bug was (highly likely) introduced by
>>> commit [33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35|
>> https://fisheye6.atlassian.com/changelog/flex-tlf?cs=33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35
>> ]
>>> on the 5th Oct 2014. If I comment out the last if clause of
>>> {{ParagraphElement.ensureTerminatorAfterReplace()}}, which was added
>>> by that commit (and subsequently edited into its current form), the
>>> bug disappears. That's because the algorithm in
>>> {{TextFlowEdit.insertTextScrap()}} requires at least one
>>> FlowLeafElement before which to add the pasted contents, and before
>>> this bug was introduced, that used to be
>>> {{ParagraphElement.terminatorSpan}}. But since the commit the
>>> terminatorSpan has been merged into the previous span.
>>> This seems to imply that there is an expectation in
>>> {{TextFlowEdit.insertTextScrap()}} that {{destinationLeaf}} should
>>> never be null (despite the null check in the line {code}insertPosition
>>> = destinationLeaf ? destinationLeaf.getAbsoluteStart() :
>>> textFlow.textLength - 1;{code}.
>>> I imagine that just commenting out the code is not a viable solution,
>>> as it will break other functionality. So we'll need either [~harbs] or
>>> [~pete21] to throw in some thoughts, if they have the time. Much
>>> appreciated.
>>> 
>>> 
>>> was (Author: evolverine):
>>> *Investigation update*: this bug was (highly likely) introduced by
>>> commit [33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35|
>> https://fisheye6.atlassian.com/changelog/flex-tlf?cs=33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35
>> ]
>>> on the 5th Oct 2014 by [~harbs]. If I comment out the last if clause
>>> of {{ParagraphElement.ensureTerminatorAfterReplace()}}, which was
>>> added by that commit (and subsequently edited into its current form),
>>> the bug disappears. That's because the algorithm in
>>> {{TextFlowEdit.insertTextScrap()}} requires at least one
>>> FlowLeafElement before which to add the pasted contents, and before
>>> this bug was introduced, that used to be
>>> {{ParagraphElement.terminatorSpan}}. But since the commit the
>>> terminatorSpan has been merged into the previous span.
>>> This seems to imply that there is an expectation in
>>> {{TextFlowEdit.insertTextScrap()}} that {{destinationLeaf}} should
>>> never be null (despite the null check in the line {code}insertPosition
>>> = destinationLeaf ? destinationLeaf.getAbsoluteStart() :
>>> textFlow.textLength - 1;{code}.
>>> I imagine that just commenting out the code is not a viable solution,
>>> as it will break other functionality. So we'll need either [~harbs] or
>>> [~pete21] to throw in some thoughts, if they have the time. Much
>>> appreciated.
>>> 
>>>> TLF - EditManager - TextFlowEdit -insertTextScrap
>>>> -------------------------------------------------
>>>> 
>>>>               Key: FLEX-34807
>>>>               URL: https://issues.apache.org/jira/browse/FLEX-34807
>>>>           Project: Apache Flex
>>>>        Issue Type: Bug
>>>>        Components: Spark: RichEditableText
>>>>  Affects Versions: Apache Flex 4.12.0, Apache Flex 4.13.0, Apache Flex
>> 4.14.0
>>>>          Reporter: Robbyn Gerhardt
>>>>          Assignee: Mihai Chira
>>>>            Labels: editmanager, richeditabletext, tlf
>>>>       Attachments: Bildschirmfoto 2015-03-19 um 15.28.19.png,
>> Bildschirmfoto 2015-03-20 um 09.06.47.png, TextEditorTest.air,
>> TextEditorTest.fxp
>>>> 
>>>> 
>>>> 1. Copy Formatted text from RichEditableText Editor, see Image
>>>> 2. Insert Formatted text from the clipboard with Ctrl + V in the
>> editor. Then comes the error.
>>>> TypeError: Error #1009: Cannot access a property or method of a null
>> object reference.
>>>>     at
>> flashx.textLayout.edit::TextFlowEdit$/insertTextScrap()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/TextFlowEdit.as:244]
>>>>     at
>> flashx.textLayout.operations::PasteOperation/doOperation()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/operations/PasteOperation.as:102]
>>>>     at
>> flashx.textLayout.edit::EditManager/doInternal()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:767]
>>>>     at
>> flashx.textLayout.edit::EditManager/doOperation()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:647]
>>>>     at
>> flashx.textLayout.edit::EditManager/pasteTextScrap()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:1806]
>>>>     at
>> flashx.textLayout.edit::EditManager/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:270]
>>>>     at
>> flashx.textLayout.container::ContainerController/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/container/ContainerController.as:2739]
>>>>     at
>> flashx.textLayout.container::TextContainerManager/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/container/TextContainerManager.as:1876]
>>>>     at flash.display::NativeMenuItem/select()
>>>>     at flash.display::NativeMenuItem/performKeyEquivalent()
>>>>     at flash.display::NativeMenu/_menuItemPerformKeyEquivalent()
>>>>     at flash.display::NativeMenu/performKeyEquivalent()
>>>>     at flash.display::NativeMenuItem/_menuPerformKeyEquivalent()
>>>>     at flash.display::NativeMenuItem/performKeyEquivalent()
>>>>     at flash.display::NativeMenu/_menuItemPerformKeyEquivalent()
>>>>     at flash.display::NativeMenu/performKeyEquivalent()
>>>>     at flash.desktop::NativeApplication/_menuPerformKeyEquivalent()
>>>>     at flash.desktop::NativeApplication/_onKeyDownCapture()
>>> 
>>> 
>>> 
>>> --
>>> This message was sent by Atlassian JIRA
>>> (v6.3.4#6332)
>> 
>> 


Re: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by Mihai Chira <mi...@gmail.com>.
Thanks for checking this. Indeed, the pasting algorithm was assuming it
could always find the terminator and work with that.

I'm afraid that I'm not familiar enough with tlf to implement an
alternative algorithm which works without the terminator. But it is causing
grief for a lot of our users. Do you think you'll have time to find another
way to implement the algorithm?

Thanks.
On 20 Sep 2015 08:37, "Harbs" <ha...@gmail.com> wrote:

> The issue here is as follows:
>
> The old code was not merging a the paragraph terminator when content was
> added. This left an extra terminator which caused all kinds of problems
> with the table code (I do not remember the details.) It’s also questionable
> whether it’s a good idea to preserve formatting in the terminator.
> mergeToPreviousIfPossible normally does not merge spans if there’s
> different formatting, but empty paragraph terminators are an exception and
> it always merges them even if the formatting is different.
>
> I think the new behavior is more correct, but we’re going to have to
> handle pasting text as a special case because the code is assuming the text
> is not normalized which it now (sort-of) is..
>
> On Sep 9, 2015, at 7:37 PM, Mihai Chira <mi...@gmail.com> wrote:
>
> > Hey guys (addressed to Piotr and Harbs),
> >
> > if you have time to take a look at this, it would really help. I have
> > a feeling you'd have much better ideas on how to go forward with the
> > fix.
> >
> > Many thanks!
> >
> >
> > ---------- Forwarded message ----------
> > From: Mihai Chira (JIRA) <ji...@apache.org>
> > Date: 9 September 2015 at 18:35
> > Subject: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager -
> > TextFlowEdit -insertTextScrap
> > To: issues@flex.apache.org
> >
> >
> >
> >    [
> https://issues.apache.org/jira/browse/FLEX-34807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14737128#comment-14737128
> > ]
> >
> > Mihai Chira edited comment on FLEX-34807 at 9/9/15 4:35 PM:
> > ------------------------------------------------------------
> >
> > *Investigation update*: this bug was (highly likely) introduced by
> > commit [33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35|
> https://fisheye6.atlassian.com/changelog/flex-tlf?cs=33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35
> ]
> > on the 5th Oct 2014. If I comment out the last if clause of
> > {{ParagraphElement.ensureTerminatorAfterReplace()}}, which was added
> > by that commit (and subsequently edited into its current form), the
> > bug disappears. That's because the algorithm in
> > {{TextFlowEdit.insertTextScrap()}} requires at least one
> > FlowLeafElement before which to add the pasted contents, and before
> > this bug was introduced, that used to be
> > {{ParagraphElement.terminatorSpan}}. But since the commit the
> > terminatorSpan has been merged into the previous span.
> > This seems to imply that there is an expectation in
> > {{TextFlowEdit.insertTextScrap()}} that {{destinationLeaf}} should
> > never be null (despite the null check in the line {code}insertPosition
> > = destinationLeaf ? destinationLeaf.getAbsoluteStart() :
> > textFlow.textLength - 1;{code}.
> > I imagine that just commenting out the code is not a viable solution,
> > as it will break other functionality. So we'll need either [~harbs] or
> > [~pete21] to throw in some thoughts, if they have the time. Much
> > appreciated.
> >
> >
> > was (Author: evolverine):
> > *Investigation update*: this bug was (highly likely) introduced by
> > commit [33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35|
> https://fisheye6.atlassian.com/changelog/flex-tlf?cs=33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35
> ]
> > on the 5th Oct 2014 by [~harbs]. If I comment out the last if clause
> > of {{ParagraphElement.ensureTerminatorAfterReplace()}}, which was
> > added by that commit (and subsequently edited into its current form),
> > the bug disappears. That's because the algorithm in
> > {{TextFlowEdit.insertTextScrap()}} requires at least one
> > FlowLeafElement before which to add the pasted contents, and before
> > this bug was introduced, that used to be
> > {{ParagraphElement.terminatorSpan}}. But since the commit the
> > terminatorSpan has been merged into the previous span.
> > This seems to imply that there is an expectation in
> > {{TextFlowEdit.insertTextScrap()}} that {{destinationLeaf}} should
> > never be null (despite the null check in the line {code}insertPosition
> > = destinationLeaf ? destinationLeaf.getAbsoluteStart() :
> > textFlow.textLength - 1;{code}.
> > I imagine that just commenting out the code is not a viable solution,
> > as it will break other functionality. So we'll need either [~harbs] or
> > [~pete21] to throw in some thoughts, if they have the time. Much
> > appreciated.
> >
> >> TLF - EditManager - TextFlowEdit -insertTextScrap
> >> -------------------------------------------------
> >>
> >>                Key: FLEX-34807
> >>                URL: https://issues.apache.org/jira/browse/FLEX-34807
> >>            Project: Apache Flex
> >>         Issue Type: Bug
> >>         Components: Spark: RichEditableText
> >>   Affects Versions: Apache Flex 4.12.0, Apache Flex 4.13.0, Apache Flex
> 4.14.0
> >>           Reporter: Robbyn Gerhardt
> >>           Assignee: Mihai Chira
> >>             Labels: editmanager, richeditabletext, tlf
> >>        Attachments: Bildschirmfoto 2015-03-19 um 15.28.19.png,
> Bildschirmfoto 2015-03-20 um 09.06.47.png, TextEditorTest.air,
> TextEditorTest.fxp
> >>
> >>
> >> 1. Copy Formatted text from RichEditableText Editor, see Image
> >> 2. Insert Formatted text from the clipboard with Ctrl + V in the
> editor. Then comes the error.
> >> TypeError: Error #1009: Cannot access a property or method of a null
> object reference.
> >>      at
> flashx.textLayout.edit::TextFlowEdit$/insertTextScrap()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/TextFlowEdit.as:244]
> >>      at
> flashx.textLayout.operations::PasteOperation/doOperation()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/operations/PasteOperation.as:102]
> >>      at
> flashx.textLayout.edit::EditManager/doInternal()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:767]
> >>      at
> flashx.textLayout.edit::EditManager/doOperation()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:647]
> >>      at
> flashx.textLayout.edit::EditManager/pasteTextScrap()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:1806]
> >>      at
> flashx.textLayout.edit::EditManager/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:270]
> >>      at
> flashx.textLayout.container::ContainerController/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/container/ContainerController.as:2739]
> >>      at
> flashx.textLayout.container::TextContainerManager/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/container/TextContainerManager.as:1876]
> >>      at flash.display::NativeMenuItem/select()
> >>      at flash.display::NativeMenuItem/performKeyEquivalent()
> >>      at flash.display::NativeMenu/_menuItemPerformKeyEquivalent()
> >>      at flash.display::NativeMenu/performKeyEquivalent()
> >>      at flash.display::NativeMenuItem/_menuPerformKeyEquivalent()
> >>      at flash.display::NativeMenuItem/performKeyEquivalent()
> >>      at flash.display::NativeMenu/_menuItemPerformKeyEquivalent()
> >>      at flash.display::NativeMenu/performKeyEquivalent()
> >>      at flash.desktop::NativeApplication/_menuPerformKeyEquivalent()
> >>      at flash.desktop::NativeApplication/_onKeyDownCapture()
> >
> >
> >
> > --
> > This message was sent by Atlassian JIRA
> > (v6.3.4#6332)
>
>

Re: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by Harbs <ha...@gmail.com>.
The issue here is as follows:

The old code was not merging a the paragraph terminator when content was added. This left an extra terminator which caused all kinds of problems with the table code (I do not remember the details.) It’s also questionable whether it’s a good idea to preserve formatting in the terminator. mergeToPreviousIfPossible normally does not merge spans if there’s different formatting, but empty paragraph terminators are an exception and it always merges them even if the formatting is different.

I think the new behavior is more correct, but we’re going to have to handle pasting text as a special case because the code is assuming the text is not normalized which it now (sort-of) is..

On Sep 9, 2015, at 7:37 PM, Mihai Chira <mi...@gmail.com> wrote:

> Hey guys (addressed to Piotr and Harbs),
> 
> if you have time to take a look at this, it would really help. I have
> a feeling you'd have much better ideas on how to go forward with the
> fix.
> 
> Many thanks!
> 
> 
> ---------- Forwarded message ----------
> From: Mihai Chira (JIRA) <ji...@apache.org>
> Date: 9 September 2015 at 18:35
> Subject: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager -
> TextFlowEdit -insertTextScrap
> To: issues@flex.apache.org
> 
> 
> 
>    [ https://issues.apache.org/jira/browse/FLEX-34807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14737128#comment-14737128
> ]
> 
> Mihai Chira edited comment on FLEX-34807 at 9/9/15 4:35 PM:
> ------------------------------------------------------------
> 
> *Investigation update*: this bug was (highly likely) introduced by
> commit [33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35|https://fisheye6.atlassian.com/changelog/flex-tlf?cs=33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35]
> on the 5th Oct 2014. If I comment out the last if clause of
> {{ParagraphElement.ensureTerminatorAfterReplace()}}, which was added
> by that commit (and subsequently edited into its current form), the
> bug disappears. That's because the algorithm in
> {{TextFlowEdit.insertTextScrap()}} requires at least one
> FlowLeafElement before which to add the pasted contents, and before
> this bug was introduced, that used to be
> {{ParagraphElement.terminatorSpan}}. But since the commit the
> terminatorSpan has been merged into the previous span.
> This seems to imply that there is an expectation in
> {{TextFlowEdit.insertTextScrap()}} that {{destinationLeaf}} should
> never be null (despite the null check in the line {code}insertPosition
> = destinationLeaf ? destinationLeaf.getAbsoluteStart() :
> textFlow.textLength - 1;{code}.
> I imagine that just commenting out the code is not a viable solution,
> as it will break other functionality. So we'll need either [~harbs] or
> [~pete21] to throw in some thoughts, if they have the time. Much
> appreciated.
> 
> 
> was (Author: evolverine):
> *Investigation update*: this bug was (highly likely) introduced by
> commit [33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35|https://fisheye6.atlassian.com/changelog/flex-tlf?cs=33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35]
> on the 5th Oct 2014 by [~harbs]. If I comment out the last if clause
> of {{ParagraphElement.ensureTerminatorAfterReplace()}}, which was
> added by that commit (and subsequently edited into its current form),
> the bug disappears. That's because the algorithm in
> {{TextFlowEdit.insertTextScrap()}} requires at least one
> FlowLeafElement before which to add the pasted contents, and before
> this bug was introduced, that used to be
> {{ParagraphElement.terminatorSpan}}. But since the commit the
> terminatorSpan has been merged into the previous span.
> This seems to imply that there is an expectation in
> {{TextFlowEdit.insertTextScrap()}} that {{destinationLeaf}} should
> never be null (despite the null check in the line {code}insertPosition
> = destinationLeaf ? destinationLeaf.getAbsoluteStart() :
> textFlow.textLength - 1;{code}.
> I imagine that just commenting out the code is not a viable solution,
> as it will break other functionality. So we'll need either [~harbs] or
> [~pete21] to throw in some thoughts, if they have the time. Much
> appreciated.
> 
>> TLF - EditManager - TextFlowEdit -insertTextScrap
>> -------------------------------------------------
>> 
>>                Key: FLEX-34807
>>                URL: https://issues.apache.org/jira/browse/FLEX-34807
>>            Project: Apache Flex
>>         Issue Type: Bug
>>         Components: Spark: RichEditableText
>>   Affects Versions: Apache Flex 4.12.0, Apache Flex 4.13.0, Apache Flex 4.14.0
>>           Reporter: Robbyn Gerhardt
>>           Assignee: Mihai Chira
>>             Labels: editmanager, richeditabletext, tlf
>>        Attachments: Bildschirmfoto 2015-03-19 um 15.28.19.png, Bildschirmfoto 2015-03-20 um 09.06.47.png, TextEditorTest.air, TextEditorTest.fxp
>> 
>> 
>> 1. Copy Formatted text from RichEditableText Editor, see Image
>> 2. Insert Formatted text from the clipboard with Ctrl + V in the editor. Then comes the error.
>> TypeError: Error #1009: Cannot access a property or method of a null object reference.
>>      at flashx.textLayout.edit::TextFlowEdit$/insertTextScrap()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/TextFlowEdit.as:244]
>>      at flashx.textLayout.operations::PasteOperation/doOperation()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/operations/PasteOperation.as:102]
>>      at flashx.textLayout.edit::EditManager/doInternal()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:767]
>>      at flashx.textLayout.edit::EditManager/doOperation()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:647]
>>      at flashx.textLayout.edit::EditManager/pasteTextScrap()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:1806]
>>      at flashx.textLayout.edit::EditManager/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:270]
>>      at flashx.textLayout.container::ContainerController/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/container/ContainerController.as:2739]
>>      at flashx.textLayout.container::TextContainerManager/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/container/TextContainerManager.as:1876]
>>      at flash.display::NativeMenuItem/select()
>>      at flash.display::NativeMenuItem/performKeyEquivalent()
>>      at flash.display::NativeMenu/_menuItemPerformKeyEquivalent()
>>      at flash.display::NativeMenu/performKeyEquivalent()
>>      at flash.display::NativeMenuItem/_menuPerformKeyEquivalent()
>>      at flash.display::NativeMenuItem/performKeyEquivalent()
>>      at flash.display::NativeMenu/_menuItemPerformKeyEquivalent()
>>      at flash.display::NativeMenu/performKeyEquivalent()
>>      at flash.desktop::NativeApplication/_menuPerformKeyEquivalent()
>>      at flash.desktop::NativeApplication/_onKeyDownCapture()
> 
> 
> 
> --
> This message was sent by Atlassian JIRA
> (v6.3.4#6332)


Re: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by Harbs <ha...@gmail.com>.
Nope. That only works at the end of the last paragraph. When inserting at the end of an intermediate paragraph, the second span gets added to the beginning of the next paragraph.

On Sep 19, 2015, at 10:54 PM, Harbs <ha...@gmail.com> wrote:

> Hi Mihai,
> 
> I think I just fixed it in commit 96a959d1b943630e68a826a1cf1fc804c73e8b95.
> 
> Please confirm.
> 
> On Sep 19, 2015, at 10:19 PM, Harbs <ha...@gmail.com> wrote:
> 
>> Thanks for the reminder.
>> 
>> I will try to look at this tomorrow.
>> 
>> Harbs
>> 
>> On Sep 19, 2015, at 10:07 PM, Mihai Chira <mi...@gmail.com> wrote:
>> 
>>> bump
>>> On 9 Sep 2015 18:37, "Mihai Chira" <mi...@gmail.com> wrote:
>>> 
>>>> Hey guys (addressed to Piotr and Harbs),
>>>> 
>>>> if you have time to take a look at this, it would really help. I have
>>>> a feeling you'd have much better ideas on how to go forward with the
>>>> fix.
>>>> 
>>>> Many thanks!
>>>> 
>>>> 
>>>> ---------- Forwarded message ----------
>>>> From: Mihai Chira (JIRA) <ji...@apache.org>
>>>> Date: 9 September 2015 at 18:35
>>>> Subject: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager -
>>>> TextFlowEdit -insertTextScrap
>>>> To: issues@flex.apache.org
>>>> 
>>>> 
>>>> 
>>>>   [
>>>> https://issues.apache.org/jira/browse/FLEX-34807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14737128#comment-14737128
>>>> ]
>>>> 
>>>> Mihai Chira edited comment on FLEX-34807 at 9/9/15 4:35 PM:
>>>> ------------------------------------------------------------
>>>> 
>>>> *Investigation update*: this bug was (highly likely) introduced by
>>>> commit [33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35|
>>>> https://fisheye6.atlassian.com/changelog/flex-tlf?cs=33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35
>>>> ]
>>>> on the 5th Oct 2014. If I comment out the last if clause of
>>>> {{ParagraphElement.ensureTerminatorAfterReplace()}}, which was added
>>>> by that commit (and subsequently edited into its current form), the
>>>> bug disappears. That's because the algorithm in
>>>> {{TextFlowEdit.insertTextScrap()}} requires at least one
>>>> FlowLeafElement before which to add the pasted contents, and before
>>>> this bug was introduced, that used to be
>>>> {{ParagraphElement.terminatorSpan}}. But since the commit the
>>>> terminatorSpan has been merged into the previous span.
>>>> This seems to imply that there is an expectation in
>>>> {{TextFlowEdit.insertTextScrap()}} that {{destinationLeaf}} should
>>>> never be null (despite the null check in the line {code}insertPosition
>>>> = destinationLeaf ? destinationLeaf.getAbsoluteStart() :
>>>> textFlow.textLength - 1;{code}.
>>>> I imagine that just commenting out the code is not a viable solution,
>>>> as it will break other functionality. So we'll need either [~harbs] or
>>>> [~pete21] to throw in some thoughts, if they have the time. Much
>>>> appreciated.
>>>> 
>>>> 
>>>> was (Author: evolverine):
>>>> *Investigation update*: this bug was (highly likely) introduced by
>>>> commit [33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35|
>>>> https://fisheye6.atlassian.com/changelog/flex-tlf?cs=33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35
>>>> ]
>>>> on the 5th Oct 2014 by [~harbs]. If I comment out the last if clause
>>>> of {{ParagraphElement.ensureTerminatorAfterReplace()}}, which was
>>>> added by that commit (and subsequently edited into its current form),
>>>> the bug disappears. That's because the algorithm in
>>>> {{TextFlowEdit.insertTextScrap()}} requires at least one
>>>> FlowLeafElement before which to add the pasted contents, and before
>>>> this bug was introduced, that used to be
>>>> {{ParagraphElement.terminatorSpan}}. But since the commit the
>>>> terminatorSpan has been merged into the previous span.
>>>> This seems to imply that there is an expectation in
>>>> {{TextFlowEdit.insertTextScrap()}} that {{destinationLeaf}} should
>>>> never be null (despite the null check in the line {code}insertPosition
>>>> = destinationLeaf ? destinationLeaf.getAbsoluteStart() :
>>>> textFlow.textLength - 1;{code}.
>>>> I imagine that just commenting out the code is not a viable solution,
>>>> as it will break other functionality. So we'll need either [~harbs] or
>>>> [~pete21] to throw in some thoughts, if they have the time. Much
>>>> appreciated.
>>>> 
>>>>> TLF - EditManager - TextFlowEdit -insertTextScrap
>>>>> -------------------------------------------------
>>>>> 
>>>>>               Key: FLEX-34807
>>>>>               URL: https://issues.apache.org/jira/browse/FLEX-34807
>>>>>           Project: Apache Flex
>>>>>        Issue Type: Bug
>>>>>        Components: Spark: RichEditableText
>>>>>  Affects Versions: Apache Flex 4.12.0, Apache Flex 4.13.0, Apache Flex
>>>> 4.14.0
>>>>>          Reporter: Robbyn Gerhardt
>>>>>          Assignee: Mihai Chira
>>>>>            Labels: editmanager, richeditabletext, tlf
>>>>>       Attachments: Bildschirmfoto 2015-03-19 um 15.28.19.png,
>>>> Bildschirmfoto 2015-03-20 um 09.06.47.png, TextEditorTest.air,
>>>> TextEditorTest.fxp
>>>>> 
>>>>> 
>>>>> 1. Copy Formatted text from RichEditableText Editor, see Image
>>>>> 2. Insert Formatted text from the clipboard with Ctrl + V in the editor.
>>>> Then comes the error.
>>>>> TypeError: Error #1009: Cannot access a property or method of a null
>>>> object reference.
>>>>>     at
>>>> flashx.textLayout.edit::TextFlowEdit$/insertTextScrap()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/TextFlowEdit.as:244]
>>>>>     at
>>>> flashx.textLayout.operations::PasteOperation/doOperation()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/operations/PasteOperation.as:102]
>>>>>     at
>>>> flashx.textLayout.edit::EditManager/doInternal()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:767]
>>>>>     at
>>>> flashx.textLayout.edit::EditManager/doOperation()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:647]
>>>>>     at
>>>> flashx.textLayout.edit::EditManager/pasteTextScrap()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:1806]
>>>>>     at
>>>> flashx.textLayout.edit::EditManager/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:270]
>>>>>     at
>>>> flashx.textLayout.container::ContainerController/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/container/ContainerController.as:2739]
>>>>>     at
>>>> flashx.textLayout.container::TextContainerManager/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/container/TextContainerManager.as:1876]
>>>>>     at flash.display::NativeMenuItem/select()
>>>>>     at flash.display::NativeMenuItem/performKeyEquivalent()
>>>>>     at flash.display::NativeMenu/_menuItemPerformKeyEquivalent()
>>>>>     at flash.display::NativeMenu/performKeyEquivalent()
>>>>>     at flash.display::NativeMenuItem/_menuPerformKeyEquivalent()
>>>>>     at flash.display::NativeMenuItem/performKeyEquivalent()
>>>>>     at flash.display::NativeMenu/_menuItemPerformKeyEquivalent()
>>>>>     at flash.display::NativeMenu/performKeyEquivalent()
>>>>>     at flash.desktop::NativeApplication/_menuPerformKeyEquivalent()
>>>>>     at flash.desktop::NativeApplication/_onKeyDownCapture()
>>>> 
>>>> 
>>>> 
>>>> --
>>>> This message was sent by Atlassian JIRA
>>>> (v6.3.4#6332)
>>>> 
>> 
> 


Re: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by Harbs <ha...@gmail.com>.
Hi Mihai,

I think I just fixed it in commit 96a959d1b943630e68a826a1cf1fc804c73e8b95.

Please confirm.

On Sep 19, 2015, at 10:19 PM, Harbs <ha...@gmail.com> wrote:

> Thanks for the reminder.
> 
> I will try to look at this tomorrow.
> 
> Harbs
> 
> On Sep 19, 2015, at 10:07 PM, Mihai Chira <mi...@gmail.com> wrote:
> 
>> bump
>> On 9 Sep 2015 18:37, "Mihai Chira" <mi...@gmail.com> wrote:
>> 
>>> Hey guys (addressed to Piotr and Harbs),
>>> 
>>> if you have time to take a look at this, it would really help. I have
>>> a feeling you'd have much better ideas on how to go forward with the
>>> fix.
>>> 
>>> Many thanks!
>>> 
>>> 
>>> ---------- Forwarded message ----------
>>> From: Mihai Chira (JIRA) <ji...@apache.org>
>>> Date: 9 September 2015 at 18:35
>>> Subject: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager -
>>> TextFlowEdit -insertTextScrap
>>> To: issues@flex.apache.org
>>> 
>>> 
>>> 
>>>   [
>>> https://issues.apache.org/jira/browse/FLEX-34807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14737128#comment-14737128
>>> ]
>>> 
>>> Mihai Chira edited comment on FLEX-34807 at 9/9/15 4:35 PM:
>>> ------------------------------------------------------------
>>> 
>>> *Investigation update*: this bug was (highly likely) introduced by
>>> commit [33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35|
>>> https://fisheye6.atlassian.com/changelog/flex-tlf?cs=33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35
>>> ]
>>> on the 5th Oct 2014. If I comment out the last if clause of
>>> {{ParagraphElement.ensureTerminatorAfterReplace()}}, which was added
>>> by that commit (and subsequently edited into its current form), the
>>> bug disappears. That's because the algorithm in
>>> {{TextFlowEdit.insertTextScrap()}} requires at least one
>>> FlowLeafElement before which to add the pasted contents, and before
>>> this bug was introduced, that used to be
>>> {{ParagraphElement.terminatorSpan}}. But since the commit the
>>> terminatorSpan has been merged into the previous span.
>>> This seems to imply that there is an expectation in
>>> {{TextFlowEdit.insertTextScrap()}} that {{destinationLeaf}} should
>>> never be null (despite the null check in the line {code}insertPosition
>>> = destinationLeaf ? destinationLeaf.getAbsoluteStart() :
>>> textFlow.textLength - 1;{code}.
>>> I imagine that just commenting out the code is not a viable solution,
>>> as it will break other functionality. So we'll need either [~harbs] or
>>> [~pete21] to throw in some thoughts, if they have the time. Much
>>> appreciated.
>>> 
>>> 
>>> was (Author: evolverine):
>>> *Investigation update*: this bug was (highly likely) introduced by
>>> commit [33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35|
>>> https://fisheye6.atlassian.com/changelog/flex-tlf?cs=33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35
>>> ]
>>> on the 5th Oct 2014 by [~harbs]. If I comment out the last if clause
>>> of {{ParagraphElement.ensureTerminatorAfterReplace()}}, which was
>>> added by that commit (and subsequently edited into its current form),
>>> the bug disappears. That's because the algorithm in
>>> {{TextFlowEdit.insertTextScrap()}} requires at least one
>>> FlowLeafElement before which to add the pasted contents, and before
>>> this bug was introduced, that used to be
>>> {{ParagraphElement.terminatorSpan}}. But since the commit the
>>> terminatorSpan has been merged into the previous span.
>>> This seems to imply that there is an expectation in
>>> {{TextFlowEdit.insertTextScrap()}} that {{destinationLeaf}} should
>>> never be null (despite the null check in the line {code}insertPosition
>>> = destinationLeaf ? destinationLeaf.getAbsoluteStart() :
>>> textFlow.textLength - 1;{code}.
>>> I imagine that just commenting out the code is not a viable solution,
>>> as it will break other functionality. So we'll need either [~harbs] or
>>> [~pete21] to throw in some thoughts, if they have the time. Much
>>> appreciated.
>>> 
>>>> TLF - EditManager - TextFlowEdit -insertTextScrap
>>>> -------------------------------------------------
>>>> 
>>>>               Key: FLEX-34807
>>>>               URL: https://issues.apache.org/jira/browse/FLEX-34807
>>>>           Project: Apache Flex
>>>>        Issue Type: Bug
>>>>        Components: Spark: RichEditableText
>>>>  Affects Versions: Apache Flex 4.12.0, Apache Flex 4.13.0, Apache Flex
>>> 4.14.0
>>>>          Reporter: Robbyn Gerhardt
>>>>          Assignee: Mihai Chira
>>>>            Labels: editmanager, richeditabletext, tlf
>>>>       Attachments: Bildschirmfoto 2015-03-19 um 15.28.19.png,
>>> Bildschirmfoto 2015-03-20 um 09.06.47.png, TextEditorTest.air,
>>> TextEditorTest.fxp
>>>> 
>>>> 
>>>> 1. Copy Formatted text from RichEditableText Editor, see Image
>>>> 2. Insert Formatted text from the clipboard with Ctrl + V in the editor.
>>> Then comes the error.
>>>> TypeError: Error #1009: Cannot access a property or method of a null
>>> object reference.
>>>>     at
>>> flashx.textLayout.edit::TextFlowEdit$/insertTextScrap()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/TextFlowEdit.as:244]
>>>>     at
>>> flashx.textLayout.operations::PasteOperation/doOperation()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/operations/PasteOperation.as:102]
>>>>     at
>>> flashx.textLayout.edit::EditManager/doInternal()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:767]
>>>>     at
>>> flashx.textLayout.edit::EditManager/doOperation()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:647]
>>>>     at
>>> flashx.textLayout.edit::EditManager/pasteTextScrap()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:1806]
>>>>     at
>>> flashx.textLayout.edit::EditManager/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:270]
>>>>     at
>>> flashx.textLayout.container::ContainerController/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/container/ContainerController.as:2739]
>>>>     at
>>> flashx.textLayout.container::TextContainerManager/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/container/TextContainerManager.as:1876]
>>>>     at flash.display::NativeMenuItem/select()
>>>>     at flash.display::NativeMenuItem/performKeyEquivalent()
>>>>     at flash.display::NativeMenu/_menuItemPerformKeyEquivalent()
>>>>     at flash.display::NativeMenu/performKeyEquivalent()
>>>>     at flash.display::NativeMenuItem/_menuPerformKeyEquivalent()
>>>>     at flash.display::NativeMenuItem/performKeyEquivalent()
>>>>     at flash.display::NativeMenu/_menuItemPerformKeyEquivalent()
>>>>     at flash.display::NativeMenu/performKeyEquivalent()
>>>>     at flash.desktop::NativeApplication/_menuPerformKeyEquivalent()
>>>>     at flash.desktop::NativeApplication/_onKeyDownCapture()
>>> 
>>> 
>>> 
>>> --
>>> This message was sent by Atlassian JIRA
>>> (v6.3.4#6332)
>>> 
> 


Re: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by Harbs <ha...@gmail.com>.
Thanks for the reminder.

I will try to look at this tomorrow.

Harbs

On Sep 19, 2015, at 10:07 PM, Mihai Chira <mi...@gmail.com> wrote:

> bump
> On 9 Sep 2015 18:37, "Mihai Chira" <mi...@gmail.com> wrote:
> 
>> Hey guys (addressed to Piotr and Harbs),
>> 
>> if you have time to take a look at this, it would really help. I have
>> a feeling you'd have much better ideas on how to go forward with the
>> fix.
>> 
>> Many thanks!
>> 
>> 
>> ---------- Forwarded message ----------
>> From: Mihai Chira (JIRA) <ji...@apache.org>
>> Date: 9 September 2015 at 18:35
>> Subject: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager -
>> TextFlowEdit -insertTextScrap
>> To: issues@flex.apache.org
>> 
>> 
>> 
>>    [
>> https://issues.apache.org/jira/browse/FLEX-34807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14737128#comment-14737128
>> ]
>> 
>> Mihai Chira edited comment on FLEX-34807 at 9/9/15 4:35 PM:
>> ------------------------------------------------------------
>> 
>> *Investigation update*: this bug was (highly likely) introduced by
>> commit [33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35|
>> https://fisheye6.atlassian.com/changelog/flex-tlf?cs=33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35
>> ]
>> on the 5th Oct 2014. If I comment out the last if clause of
>> {{ParagraphElement.ensureTerminatorAfterReplace()}}, which was added
>> by that commit (and subsequently edited into its current form), the
>> bug disappears. That's because the algorithm in
>> {{TextFlowEdit.insertTextScrap()}} requires at least one
>> FlowLeafElement before which to add the pasted contents, and before
>> this bug was introduced, that used to be
>> {{ParagraphElement.terminatorSpan}}. But since the commit the
>> terminatorSpan has been merged into the previous span.
>> This seems to imply that there is an expectation in
>> {{TextFlowEdit.insertTextScrap()}} that {{destinationLeaf}} should
>> never be null (despite the null check in the line {code}insertPosition
>> = destinationLeaf ? destinationLeaf.getAbsoluteStart() :
>> textFlow.textLength - 1;{code}.
>> I imagine that just commenting out the code is not a viable solution,
>> as it will break other functionality. So we'll need either [~harbs] or
>> [~pete21] to throw in some thoughts, if they have the time. Much
>> appreciated.
>> 
>> 
>> was (Author: evolverine):
>> *Investigation update*: this bug was (highly likely) introduced by
>> commit [33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35|
>> https://fisheye6.atlassian.com/changelog/flex-tlf?cs=33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35
>> ]
>> on the 5th Oct 2014 by [~harbs]. If I comment out the last if clause
>> of {{ParagraphElement.ensureTerminatorAfterReplace()}}, which was
>> added by that commit (and subsequently edited into its current form),
>> the bug disappears. That's because the algorithm in
>> {{TextFlowEdit.insertTextScrap()}} requires at least one
>> FlowLeafElement before which to add the pasted contents, and before
>> this bug was introduced, that used to be
>> {{ParagraphElement.terminatorSpan}}. But since the commit the
>> terminatorSpan has been merged into the previous span.
>> This seems to imply that there is an expectation in
>> {{TextFlowEdit.insertTextScrap()}} that {{destinationLeaf}} should
>> never be null (despite the null check in the line {code}insertPosition
>> = destinationLeaf ? destinationLeaf.getAbsoluteStart() :
>> textFlow.textLength - 1;{code}.
>> I imagine that just commenting out the code is not a viable solution,
>> as it will break other functionality. So we'll need either [~harbs] or
>> [~pete21] to throw in some thoughts, if they have the time. Much
>> appreciated.
>> 
>>> TLF - EditManager - TextFlowEdit -insertTextScrap
>>> -------------------------------------------------
>>> 
>>>                Key: FLEX-34807
>>>                URL: https://issues.apache.org/jira/browse/FLEX-34807
>>>            Project: Apache Flex
>>>         Issue Type: Bug
>>>         Components: Spark: RichEditableText
>>>   Affects Versions: Apache Flex 4.12.0, Apache Flex 4.13.0, Apache Flex
>> 4.14.0
>>>           Reporter: Robbyn Gerhardt
>>>           Assignee: Mihai Chira
>>>             Labels: editmanager, richeditabletext, tlf
>>>        Attachments: Bildschirmfoto 2015-03-19 um 15.28.19.png,
>> Bildschirmfoto 2015-03-20 um 09.06.47.png, TextEditorTest.air,
>> TextEditorTest.fxp
>>> 
>>> 
>>> 1. Copy Formatted text from RichEditableText Editor, see Image
>>> 2. Insert Formatted text from the clipboard with Ctrl + V in the editor.
>> Then comes the error.
>>> TypeError: Error #1009: Cannot access a property or method of a null
>> object reference.
>>>      at
>> flashx.textLayout.edit::TextFlowEdit$/insertTextScrap()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/TextFlowEdit.as:244]
>>>      at
>> flashx.textLayout.operations::PasteOperation/doOperation()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/operations/PasteOperation.as:102]
>>>      at
>> flashx.textLayout.edit::EditManager/doInternal()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:767]
>>>      at
>> flashx.textLayout.edit::EditManager/doOperation()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:647]
>>>      at
>> flashx.textLayout.edit::EditManager/pasteTextScrap()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:1806]
>>>      at
>> flashx.textLayout.edit::EditManager/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:270]
>>>      at
>> flashx.textLayout.container::ContainerController/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/container/ContainerController.as:2739]
>>>      at
>> flashx.textLayout.container::TextContainerManager/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/container/TextContainerManager.as:1876]
>>>      at flash.display::NativeMenuItem/select()
>>>      at flash.display::NativeMenuItem/performKeyEquivalent()
>>>      at flash.display::NativeMenu/_menuItemPerformKeyEquivalent()
>>>      at flash.display::NativeMenu/performKeyEquivalent()
>>>      at flash.display::NativeMenuItem/_menuPerformKeyEquivalent()
>>>      at flash.display::NativeMenuItem/performKeyEquivalent()
>>>      at flash.display::NativeMenu/_menuItemPerformKeyEquivalent()
>>>      at flash.display::NativeMenu/performKeyEquivalent()
>>>      at flash.desktop::NativeApplication/_menuPerformKeyEquivalent()
>>>      at flash.desktop::NativeApplication/_onKeyDownCapture()
>> 
>> 
>> 
>> --
>> This message was sent by Atlassian JIRA
>> (v6.3.4#6332)
>> 


Re: Fwd: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager - TextFlowEdit -insertTextScrap

Posted by Mihai Chira <mi...@gmail.com>.
bump
On 9 Sep 2015 18:37, "Mihai Chira" <mi...@gmail.com> wrote:

> Hey guys (addressed to Piotr and Harbs),
>
> if you have time to take a look at this, it would really help. I have
> a feeling you'd have much better ideas on how to go forward with the
> fix.
>
> Many thanks!
>
>
> ---------- Forwarded message ----------
> From: Mihai Chira (JIRA) <ji...@apache.org>
> Date: 9 September 2015 at 18:35
> Subject: [jira] [Comment Edited] (FLEX-34807) TLF - EditManager -
> TextFlowEdit -insertTextScrap
> To: issues@flex.apache.org
>
>
>
>     [
> https://issues.apache.org/jira/browse/FLEX-34807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14737128#comment-14737128
> ]
>
> Mihai Chira edited comment on FLEX-34807 at 9/9/15 4:35 PM:
> ------------------------------------------------------------
>
> *Investigation update*: this bug was (highly likely) introduced by
> commit [33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35|
> https://fisheye6.atlassian.com/changelog/flex-tlf?cs=33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35
> ]
> on the 5th Oct 2014. If I comment out the last if clause of
> {{ParagraphElement.ensureTerminatorAfterReplace()}}, which was added
> by that commit (and subsequently edited into its current form), the
> bug disappears. That's because the algorithm in
> {{TextFlowEdit.insertTextScrap()}} requires at least one
> FlowLeafElement before which to add the pasted contents, and before
> this bug was introduced, that used to be
> {{ParagraphElement.terminatorSpan}}. But since the commit the
> terminatorSpan has been merged into the previous span.
> This seems to imply that there is an expectation in
> {{TextFlowEdit.insertTextScrap()}} that {{destinationLeaf}} should
> never be null (despite the null check in the line {code}insertPosition
> = destinationLeaf ? destinationLeaf.getAbsoluteStart() :
> textFlow.textLength - 1;{code}.
> I imagine that just commenting out the code is not a viable solution,
> as it will break other functionality. So we'll need either [~harbs] or
> [~pete21] to throw in some thoughts, if they have the time. Much
> appreciated.
>
>
> was (Author: evolverine):
> *Investigation update*: this bug was (highly likely) introduced by
> commit [33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35|
> https://fisheye6.atlassian.com/changelog/flex-tlf?cs=33df98ab9d2c69c84d4de6ab2ae969f9c5f93e35
> ]
> on the 5th Oct 2014 by [~harbs]. If I comment out the last if clause
> of {{ParagraphElement.ensureTerminatorAfterReplace()}}, which was
> added by that commit (and subsequently edited into its current form),
> the bug disappears. That's because the algorithm in
> {{TextFlowEdit.insertTextScrap()}} requires at least one
> FlowLeafElement before which to add the pasted contents, and before
> this bug was introduced, that used to be
> {{ParagraphElement.terminatorSpan}}. But since the commit the
> terminatorSpan has been merged into the previous span.
> This seems to imply that there is an expectation in
> {{TextFlowEdit.insertTextScrap()}} that {{destinationLeaf}} should
> never be null (despite the null check in the line {code}insertPosition
> = destinationLeaf ? destinationLeaf.getAbsoluteStart() :
> textFlow.textLength - 1;{code}.
> I imagine that just commenting out the code is not a viable solution,
> as it will break other functionality. So we'll need either [~harbs] or
> [~pete21] to throw in some thoughts, if they have the time. Much
> appreciated.
>
> > TLF - EditManager - TextFlowEdit -insertTextScrap
> > -------------------------------------------------
> >
> >                 Key: FLEX-34807
> >                 URL: https://issues.apache.org/jira/browse/FLEX-34807
> >             Project: Apache Flex
> >          Issue Type: Bug
> >          Components: Spark: RichEditableText
> >    Affects Versions: Apache Flex 4.12.0, Apache Flex 4.13.0, Apache Flex
> 4.14.0
> >            Reporter: Robbyn Gerhardt
> >            Assignee: Mihai Chira
> >              Labels: editmanager, richeditabletext, tlf
> >         Attachments: Bildschirmfoto 2015-03-19 um 15.28.19.png,
> Bildschirmfoto 2015-03-20 um 09.06.47.png, TextEditorTest.air,
> TextEditorTest.fxp
> >
> >
> > 1. Copy Formatted text from RichEditableText Editor, see Image
> > 2. Insert Formatted text from the clipboard with Ctrl + V in the editor.
> Then comes the error.
> > TypeError: Error #1009: Cannot access a property or method of a null
> object reference.
> >       at
> flashx.textLayout.edit::TextFlowEdit$/insertTextScrap()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/TextFlowEdit.as:244]
> >       at
> flashx.textLayout.operations::PasteOperation/doOperation()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/operations/PasteOperation.as:102]
> >       at
> flashx.textLayout.edit::EditManager/doInternal()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:767]
> >       at
> flashx.textLayout.edit::EditManager/doOperation()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:647]
> >       at
> flashx.textLayout.edit::EditManager/pasteTextScrap()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:1806]
> >       at
> flashx.textLayout.edit::EditManager/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/edit/EditManager.as:270]
> >       at
> flashx.textLayout.container::ContainerController/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/container/ContainerController.as:2739]
> >       at
> flashx.textLayout.container::TextContainerManager/editHandler()[/Users/erik/Documents/ApacheFlex/git/flex-tlf/textLayout/src/flashx/textLayout/container/TextContainerManager.as:1876]
> >       at flash.display::NativeMenuItem/select()
> >       at flash.display::NativeMenuItem/performKeyEquivalent()
> >       at flash.display::NativeMenu/_menuItemPerformKeyEquivalent()
> >       at flash.display::NativeMenu/performKeyEquivalent()
> >       at flash.display::NativeMenuItem/_menuPerformKeyEquivalent()
> >       at flash.display::NativeMenuItem/performKeyEquivalent()
> >       at flash.display::NativeMenu/_menuItemPerformKeyEquivalent()
> >       at flash.display::NativeMenu/performKeyEquivalent()
> >       at flash.desktop::NativeApplication/_menuPerformKeyEquivalent()
> >       at flash.desktop::NativeApplication/_onKeyDownCapture()
>
>
>
> --
> This message was sent by Atlassian JIRA
> (v6.3.4#6332)
>