Re: [PATCH] 3782 Crash with selection of table cells

2007-06-07 Thread Jean-Marc Lasgouttes
Bo == Bo Peng [EMAIL PROTECTED] writes: Bo Finally, a patch that fixes a critical bug (as opposed to fixing Bo WONTFIX). :-) Description: Bo Create a 2 by 1 table with several characters in the lower cell, Bo select both cells and S-Right when the cursor is in the upper Bo cell. This crashes

Re: [PATCH] 3782 Crash with selection of table cells

2007-06-07 Thread Alfredo Braunstein
Jean-Marc Lasgouttes wrote: Bo Finally, a patch that fixes a critical bug (as opposed to fixing Bo WONTFIX). :-) Description: Bo Create a 2 by 1 table with several characters in the lower cell, Bo select both cells and S-Right when the cursor is in the upper Bo cell. This crashes lyx. I

Re: [PATCH] 3782 Crash with selection of table cells

2007-06-07 Thread Bo Peng
I do not think the analysis is correct. The real problem is that saveSelection is not prepared (like most of our cut-and-paste mechanism) to handle multi-cell selections. How come my analysis is incorrect? We are talking about the same thing. I said: saveSelection can not handle this case so I

Re: [PATCH] 3782 Crash with selection of table cells

2007-06-07 Thread Jean-Marc Lasgouttes
Bo == Bo Peng [EMAIL PROTECTED] writes: Bo How come my analysis is incorrect? We are talking about the same Bo thing. Bo I said: saveSelection can not handle this case so I do not call Bo it. You said: let me disable this case in saveSelection. Bo I actually said: saveSelection should not be

Re: [PATCH] 3782 Crash with selection of table cells

2007-06-07 Thread Bo Peng
Try the following: create a 2x1 table with 2 characters in cell 1 and 4 in cell 4. Put cursor at the end of cell 2 and do Shift-Up, Shift-Left. I see. You get a crash, but no LFUN_FINISHED action is invoked. It is really multi-cell selection that is broken. But my patch was correct in that

Re: [PATCH] 3782 Crash with selection of table cells

2007-06-07 Thread Jean-Marc Lasgouttes
Bo == Bo Peng [EMAIL PROTECTED] writes: Bo But my patch was correct in that saveSelection should not be Bo called before LFUN_FINISHED is processed in that particular case. Bo The patch fixes the problem and save the correct selected text Bo (things in the lower cell). saveSelection does not

Re: [PATCH] 3782 Crash with selection of table cells

2007-06-07 Thread Bo Peng
saveSelection does not hurt even in the LFUN_FINISHED case. At worst it is useless. Logically speaking, we should saveSelection after cur has moved to its place. In that case, cur is undispatched so saveSelection should not be called. I am not sure the patch is done at the right place. The

Re: [PATCH] 3782 Crash with selection of table cells

2007-06-07 Thread Alfredo Braunstein
Bo Peng wrote: saveSelection does not hurt even in the LFUN_FINISHED case. At worst it is useless. Logically speaking, we should saveSelection after cur has moved to its place. In that case, cur is undispatched so saveSelection should not be called. Maybe the best would be calling

Re: [PATCH] 3782 Crash with selection of table cells

2007-06-07 Thread Bo Peng
Logically speaking, we should saveSelection after cur has moved to its place. In that case, cur is undispatched so saveSelection should not be called. Maybe the best would be calling saveSelection at the end of Cursor::dispatch (maybe adding the check if the cursor has moved), and nowhere

Re: [PATCH] 3782 Crash with selection of table cells

2007-06-07 Thread Alfredo Braunstein
Bo Peng wrote: Logically speaking, we should saveSelection after cur has moved to its place. In that case, cur is undispatched so saveSelection should not be called. Maybe the best would be calling saveSelection at the end of Cursor::dispatch (maybe adding the check if the cursor has

Re: [PATCH] 3782 Crash with selection of table cells

2007-06-07 Thread Jean-Marc Lasgouttes
Alfredo == Alfredo Braunstein [EMAIL PROTECTED] writes: That makes sense but as I have said (or implied), to avoid introduction of new bugs, it is unwise to overhaul clipboards now. JMarc's two-liner stops crashes, my two-liners saves selection correctly for that particular case. I think

Re: [PATCH] 3782 Crash with selection of table cells

2007-06-07 Thread Bo Peng
Alfredo Seems fair enough ;-) Go for it, Will do. but Alfredo's suggestion is the way to go later. I hope Alfredo will go further enough to merge text and table clipboards. :-) Bo

Re: [PATCH] 3782 Crash with selection of table cells

2007-06-07 Thread Jean-Marc Lasgouttes
> "Bo" == Bo Peng <[EMAIL PROTECTED]> writes: Bo> Finally, a patch that fixes a critical bug (as opposed to fixing Bo> WONTFIX). :-) Description: Bo> Create a 2 by 1 table with several characters in the lower cell, Bo> select both cells and S-Right when the cursor is in the upper Bo> cell.

Re: [PATCH] 3782 Crash with selection of table cells

2007-06-07 Thread Alfredo Braunstein
Jean-Marc Lasgouttes wrote: > Bo> Finally, a patch that fixes a critical bug (as opposed to fixing > Bo> WONTFIX). :-) Description: > > Bo> Create a 2 by 1 table with several characters in the lower cell, > Bo> select both cells and S-Right when the cursor is in the upper > Bo> cell. This

Re: [PATCH] 3782 Crash with selection of table cells

2007-06-07 Thread Bo Peng
I do not think the analysis is correct. The real problem is that saveSelection is not prepared (like most of our cut-and-paste mechanism) to handle multi-cell selections. How come my analysis is incorrect? We are talking about the same thing. I said: saveSelection can not handle this case so I

Re: [PATCH] 3782 Crash with selection of table cells

2007-06-07 Thread Jean-Marc Lasgouttes
> "Bo" == Bo Peng <[EMAIL PROTECTED]> writes: Bo> How come my analysis is incorrect? We are talking about the same Bo> thing. Bo> I said: saveSelection can not handle this case so I do not call Bo> it. You said: let me disable this case in saveSelection. Bo> I actually said: saveSelection

Re: [PATCH] 3782 Crash with selection of table cells

2007-06-07 Thread Bo Peng
Try the following: create a 2x1 table with 2 characters in cell 1 and 4 in cell 4. Put cursor at the end of cell 2 and do Shift-Up, Shift-Left. I see. You get a crash, but no LFUN_FINISHED action is invoked. It is really multi-cell selection that is broken. But my patch was correct in that

Re: [PATCH] 3782 Crash with selection of table cells

2007-06-07 Thread Jean-Marc Lasgouttes
> "Bo" == Bo Peng <[EMAIL PROTECTED]> writes: Bo> But my patch was correct in that saveSelection should not be Bo> called before LFUN_FINISHED is processed in that particular case. Bo> The patch fixes the problem and save the correct selected text Bo> (things in the lower cell).

Re: [PATCH] 3782 Crash with selection of table cells

2007-06-07 Thread Bo Peng
saveSelection does not hurt even in the LFUN_FINISHED case. At worst it is useless. Logically speaking, we should saveSelection after cur has moved to its place. In that case, cur is undispatched so saveSelection should not be called. I am not sure the patch is done at the right place. The

Re: [PATCH] 3782 Crash with selection of table cells

2007-06-07 Thread Alfredo Braunstein
Bo Peng wrote: >> >> saveSelection does not hurt even in the LFUN_FINISHED case. At worst >> it is useless. > > Logically speaking, we should saveSelection after cur has moved to its > place. In that case, cur is undispatched so saveSelection should not > be called. Maybe the best would be

Re: [PATCH] 3782 Crash with selection of table cells

2007-06-07 Thread Bo Peng
> Logically speaking, we should saveSelection after cur has moved to its > place. In that case, cur is undispatched so saveSelection should not > be called. Maybe the best would be calling saveSelection at the end of Cursor::dispatch (maybe adding the check if the cursor has moved), and nowhere

Re: [PATCH] 3782 Crash with selection of table cells

2007-06-07 Thread Alfredo Braunstein
Bo Peng wrote: >> > Logically speaking, we should saveSelection after cur has moved to its >> > place. In that case, cur is undispatched so saveSelection should not >> > be called. >> >> Maybe the best would be calling saveSelection at the end of >> Cursor::dispatch (maybe adding the check if the

Re: [PATCH] 3782 Crash with selection of table cells

2007-06-07 Thread Jean-Marc Lasgouttes
> "Alfredo" == Alfredo Braunstein <[EMAIL PROTECTED]> writes: >> That makes sense but as I have said (or implied), to avoid >> introduction of new bugs, it is unwise to overhaul clipboards now. >> JMarc's two-liner stops crashes, my two-liners saves selection >> correctly for that particular

Re: [PATCH] 3782 Crash with selection of table cells

2007-06-07 Thread Bo Peng
Alfredo> Seems fair enough ;-) Go for it, Will do. but Alfredo's suggestion is the way to go later. I hope Alfredo will go further enough to merge text and table clipboards. :-) Bo

[PATCH] 3782 Crash with selection of table cells

2007-06-06 Thread Bo Peng
Finally, a patch that fixes a critical bug (as opposed to fixing WONTFIX). :-) Description: Create a 2 by 1 table with several characters in the lower cell, select both cells and S-Right when the cursor is in the upper cell. This crashes lyx. Problem: Text3.cpp: LFUN_CHAR_FORWARD_SELECT:

[PATCH] 3782 Crash with selection of table cells

2007-06-06 Thread Bo Peng
Finally, a patch that fixes a critical bug (as opposed to fixing WONTFIX). :-) Description: Create a 2 by 1 table with several characters in the lower cell, select both cells and S-Right when the cursor is in the upper cell. This crashes lyx. Problem: Text3.cpp: LFUN_CHAR_FORWARD_SELECT: