fix tabular multicolumn handling

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9298 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2004-11-24 16:48:21 +00:00
parent 59413be9a0
commit 2621ad0763
2 changed files with 9 additions and 15 deletions

View File

@ -1,3 +1,7 @@
2004-11-24 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* insettabular.C (tabularFeatures): fix multicolumn handling
2004-11-23 Lars Gullik Bjonnes <larsbj@gullik.net> 2004-11-23 Lars Gullik Bjonnes <larsbj@gullik.net>
* render_base.h (operator=): use common semantics * render_base.h (operator=): use common semantics

View File

@ -1328,10 +1328,9 @@ void InsetTabular::tabularFeatures(LCursor & cur,
_("You cannot set multicolumn vertically.")); _("You cannot set multicolumn vertically."));
return; return;
} }
#if 0 if (!cur.selection()) {
// just multicol for one Single Cell // just multicol for one single cell
if (!hasSelection()) { // check whether we are completely in a multicol
// check whether we are completly in a multicol
if (tabular.isMultiColumn(cur.idx())) if (tabular.isMultiColumn(cur.idx()))
tabular.unsetMultiColumn(cur.idx()); tabular.unsetMultiColumn(cur.idx());
else else
@ -1340,21 +1339,12 @@ void InsetTabular::tabularFeatures(LCursor & cur,
} }
// we have a selection so this means we just add all this // we have a selection so this means we just add all this
// cells to form a multicolumn cell // cells to form a multicolumn cell
int s_start; CursorSlice::idx_type const s_start = cur.selBegin().idx();
int s_end; CursorSlice::idx_type const s_end = cur.selEnd().idx();
if (sel_cell_start > sel_cell_end) {
s_start = sel_cell_end;
s_end = sel_cell_start;
} else {
s_start = sel_cell_start;
s_end = sel_cell_end;
}
tabular.setMultiColumn(bv.buffer(), s_start, s_end - s_start + 1); tabular.setMultiColumn(bv.buffer(), s_start, s_end - s_start + 1);
cur.idx() = s_start; cur.idx() = s_start;
cur.par() = 0; cur.par() = 0;
cur.pos() = 0; cur.pos() = 0;
#endif
cur.selection() = false; cur.selection() = false;
break; break;
} }