Hi lyx-devel,

   I often find myself rearranging equations as my document evolves - it 
sometimes becomes necessary to split an eqnarray environment into two so that 
the equations balance out or some other text can be inserted in between. 
Similarly, with tables (mostly to save the copy-paste effort). I thought it 
would be nice to have a split-table action available from a popup menu.

   Based on my knowledge of lyx code here is what I believe the task list is. 
Could someone please help me evaluate the amount of effort required to 
implement this? Additional details/corrections would help.

0. Does this seem useful?

1. Create a menu item in stdcontext.inc so that it shows up in the popup (is 
this all?)

2. Create new option for the "inset-modify tabular" command : split-above-row, 
split-below-row (sibling to delete-column, copy-row etc.) or create a new 
LFUN_TABULAR_SPLIT / LFUN_EQNARRAY_SPLIT in LyXAction.cpp

3. Create a getStatus() code-path that sets the FuncStatus properly for this 
command

4. Create a doDispatch() code-path that executes this with the following 
steps:

    4a. Quick exit if request for split above first row or split below row 
line or split either way with only 1 row

   4b. Disable/enable UI updates around this code (probably already being done 
in existing code around the top-level dispatch routine)

   4c. Create new InsetTabular for tables (InsetMathArray for eqnarray?) and 
copy relevant rows. If *this has headings row, create same for the new table.

   4d. Delete these rows from *this

   4e. Insert new inset after current table inset in Paragraph (by calling 
Cursor::insert() on 'cur'?). How will this handle nested tables?


Looking at the code, it doesn't seem like InsetTabular and InsetMathNest share 
a common class for Tabular data so different pieces of code will have to be 
written for each.

Thanks,
Manoj

Reply via email to