mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-27 19:40:10 +00:00
backport r39757:
* Fix merging of cells (multicolumn, multirow) when the first cell in the selection is already a multi-cell (bug #7792). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@39793 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
3c8acb9b1d
commit
336e0ea9f5
@ -5388,10 +5388,27 @@ void InsetTabular::tabularFeatures(Cursor & cur,
|
|||||||
}
|
}
|
||||||
|
|
||||||
case Tabular::MULTICOLUMN: {
|
case Tabular::MULTICOLUMN: {
|
||||||
if (tabular.isMultiColumn(cur.idx()))
|
if (!cur.selection()) {
|
||||||
tabularFeatures(cur, Tabular::UNSET_MULTICOLUMN);
|
if (tabular.isMultiColumn(cur.idx()))
|
||||||
else
|
tabularFeatures(cur, Tabular::UNSET_MULTICOLUMN);
|
||||||
|
else
|
||||||
|
tabularFeatures(cur, Tabular::SET_MULTICOLUMN);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
bool merge = false;
|
||||||
|
for (col_type c = sel_col_start; c <= sel_col_end; ++c) {
|
||||||
|
row_type const r = sel_row_start;
|
||||||
|
if (!tabular.isMultiColumn(tabular.cellIndex(r, c))
|
||||||
|
|| (r > sel_row_start && !tabular.isPartOfMultiColumn(r, c)))
|
||||||
|
merge = true;
|
||||||
|
}
|
||||||
|
// If the selection contains at least one singlecol cell
|
||||||
|
// or multiple multicol cells,
|
||||||
|
// we assume the user will merge is to a single multicol
|
||||||
|
if (merge)
|
||||||
tabularFeatures(cur, Tabular::SET_MULTICOLUMN);
|
tabularFeatures(cur, Tabular::SET_MULTICOLUMN);
|
||||||
|
else
|
||||||
|
tabularFeatures(cur, Tabular::UNSET_MULTICOLUMN);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5426,10 +5443,27 @@ void InsetTabular::tabularFeatures(Cursor & cur,
|
|||||||
}
|
}
|
||||||
|
|
||||||
case Tabular::MULTIROW: {
|
case Tabular::MULTIROW: {
|
||||||
if (tabular.isMultiRow(cur.idx()))
|
if (!cur.selection()) {
|
||||||
tabularFeatures(cur, Tabular::UNSET_MULTIROW);
|
if (tabular.isMultiRow(cur.idx()))
|
||||||
else
|
tabularFeatures(cur, Tabular::UNSET_MULTIROW);
|
||||||
|
else
|
||||||
|
tabularFeatures(cur, Tabular::SET_MULTIROW);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
bool merge = false;
|
||||||
|
for (row_type r = sel_row_start; r <= sel_row_end; ++r) {
|
||||||
|
col_type const c = sel_col_start;
|
||||||
|
if (!tabular.isMultiRow(tabular.cellIndex(r, c))
|
||||||
|
|| (r > sel_row_start && !tabular.isPartOfMultiRow(r, c)))
|
||||||
|
merge = true;
|
||||||
|
}
|
||||||
|
// If the selection contains at least one singlerow cell
|
||||||
|
// or multiple multirow cells,
|
||||||
|
// we assume the user will merge is to a single multirow
|
||||||
|
if (merge)
|
||||||
tabularFeatures(cur, Tabular::SET_MULTIROW);
|
tabularFeatures(cur, Tabular::SET_MULTIROW);
|
||||||
|
else
|
||||||
|
tabularFeatures(cur, Tabular::UNSET_MULTIROW);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,6 +110,9 @@ What's new
|
|||||||
|
|
||||||
- Fix bottom border allocation when setting a multirow (bug 7791).
|
- Fix bottom border allocation when setting a multirow (bug 7791).
|
||||||
|
|
||||||
|
- Fix merging of cells (multicolumn, multirow) when the first cell in the
|
||||||
|
selection is already a multi-cell (bug 7792).
|
||||||
|
|
||||||
- Disable interword and protected space lfuns in math, since these spaces
|
- Disable interword and protected space lfuns in math, since these spaces
|
||||||
are not yet supported.
|
are not yet supported.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user