+ case LyXTabular::SET_SPECIAL_COLUMN:
+ case LyXTabular::SET_SPECIAL_MULTI:
+ tabular->SetAlignSpecial(actcell,value,feature);
+ updateLocal(bv, FULL, true);
+ break;
+ case LyXTabular::APPEND_ROW:
+ // append the row into the tabular
+ unlockInsetInInset(bv, the_locking_inset);
+ tabular->AppendRow(actcell);
+ updateLocal(bv, INIT, true);
+ break;
+ case LyXTabular::APPEND_COLUMN:
+ // append the column into the tabular
+ unlockInsetInInset(bv, the_locking_inset);
+ tabular->AppendColumn(actcell);
+ actcell = tabular->GetCellNumber(row, column);
+ updateLocal(bv, INIT, true);
+ break;
+ case LyXTabular::DELETE_ROW:
+ unlockInsetInInset(bv, the_locking_inset);
+ for(int i = sel_row_start; i <= sel_row_end; ++i) {
+ tabular->DeleteRow(sel_row_start);
+ }
+ if (sel_row_start >= tabular->rows())
+ --sel_row_start;
+ actcell = tabular->GetCellNumber(sel_row_start, column);
+ clearSelection();
+ updateLocal(bv, INIT, true);
+ break;
+ case LyXTabular::DELETE_COLUMN:
+ unlockInsetInInset(bv, the_locking_inset);
+ for(int i = sel_col_start; i <= sel_col_end; ++i) {
+ tabular->DeleteColumn(sel_col_start);
+ }
+ if (sel_col_start >= tabular->columns())
+ --sel_col_start;
+ actcell = tabular->GetCellNumber(row, sel_col_start);
+ clearSelection();
+ updateLocal(bv, INIT, true);
+ break;
+ case LyXTabular::M_TOGGLE_LINE_TOP:
+ flag = false;
+ case LyXTabular::TOGGLE_LINE_TOP:
+ {
+ bool lineSet = !tabular->TopLine(actcell, flag);
+ for (int i = sel_row_start; i <= sel_row_end; ++i)
+ for (int j = sel_col_start; j <= sel_col_end; ++j)
+ tabular->SetTopLine(
+ tabular->GetCellNumber(i, j),
+ lineSet, flag);
+ updateLocal(bv, INIT, true);
+ break;
+ }
+
+ case LyXTabular::M_TOGGLE_LINE_BOTTOM:
+ flag = false;
+ case LyXTabular::TOGGLE_LINE_BOTTOM:
+ {
+ bool lineSet = !tabular->BottomLine(actcell, flag);
+ for (int i = sel_row_start; i <= sel_row_end; ++i)
+ for (int j = sel_col_start; j <= sel_col_end; ++j)
+ tabular->SetBottomLine(
+ tabular->GetCellNumber(i, j),
+ lineSet,
+ flag);
+ updateLocal(bv, INIT, true);
+ break;
+ }
+
+ case LyXTabular::M_TOGGLE_LINE_LEFT:
+ flag = false;
+ case LyXTabular::TOGGLE_LINE_LEFT:
+ {
+ bool lineSet = !tabular->LeftLine(actcell, flag);
+ for (int i = sel_row_start; i <= sel_row_end; ++i)
+ for (int j = sel_col_start; j <= sel_col_end; ++j)
+ tabular->SetLeftLine(
+ tabular->GetCellNumber(i,j),
+ lineSet,
+ flag);
+ updateLocal(bv, INIT, true);
+ break;
+ }
+
+ case LyXTabular::M_TOGGLE_LINE_RIGHT:
+ flag = false;
+ case LyXTabular::TOGGLE_LINE_RIGHT:
+ {
+ bool lineSet = !tabular->RightLine(actcell, flag);
+ for (int i = sel_row_start; i <= sel_row_end; ++i)
+ for (int j = sel_col_start; j <= sel_col_end; ++j)
+ tabular->SetRightLine(
+ tabular->GetCellNumber(i,j),
+ lineSet,
+ flag);
+ updateLocal(bv, INIT, true);
+ break;
+ }
+
+ case LyXTabular::M_ALIGN_LEFT:
+ case LyXTabular::M_ALIGN_RIGHT:
+ case LyXTabular::M_ALIGN_CENTER:
+ flag = false;
+ case LyXTabular::ALIGN_LEFT:
+ case LyXTabular::ALIGN_RIGHT:
+ case LyXTabular::ALIGN_CENTER:
+ for (int i = sel_row_start; i <= sel_row_end; ++i)
+ for (int j = sel_col_start; j <= sel_col_end; ++j)
+ tabular->SetAlignment(
+ tabular->GetCellNumber(i, j),
+ setAlign,
+ flag);
+ updateLocal(bv, INIT, true);
+ break;
+ case LyXTabular::M_VALIGN_TOP:
+ case LyXTabular::M_VALIGN_BOTTOM:
+ case LyXTabular::M_VALIGN_CENTER:
+ flag = false;
+ case LyXTabular::VALIGN_TOP:
+ case LyXTabular::VALIGN_BOTTOM:
+ case LyXTabular::VALIGN_CENTER:
+ for (int i = sel_row_start; i <= sel_row_end; ++i)
+ for (int j = sel_col_start; j <= sel_col_end; ++j)
+ tabular->SetVAlignment(
+ tabular->GetCellNumber(i, j),
+ setVAlign, flag);
+ updateLocal(bv, INIT, true);
+ break;
+ case LyXTabular::MULTICOLUMN:
+ {
+ if (sel_row_start != sel_row_end) {
+ Alert::alert(_("Impossible Operation!"),
+ _("Multicolumns can only be horizontally."),
+ _("Sorry."));
+ return;
+ }
+ // just multicol for one Single Cell
+ if (!hasSelection()) {
+ // check wether we are completly in a multicol
+ if (tabular->IsMultiColumn(actcell)) {
+ tabular->UnsetMultiColumn(actcell);
+ updateLocal(bv, INIT, true);
+ } else {
+ tabular->SetMultiColumn(actcell, 1);
+ updateLocal(bv, CELL, true);
+ }
+ return;
+ }
+ // we have a selection so this means we just add all this
+ // cells to form a multicolumn cell
+ int s_start;
+ int s_end;
+
+ 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(s_start, s_end - s_start + 1);
+ actcell = s_start;
+ sel_cell_end = sel_cell_start;
+ updateLocal(bv, INIT, true);
+ break;
+ }
+ case LyXTabular::SET_ALL_LINES:
+ setLines = true;
+ case LyXTabular::UNSET_ALL_LINES:
+ for (int i = sel_row_start; i <= sel_row_end; ++i)
+ for (int j = sel_col_start; j <= sel_col_end; ++j)
+ tabular->SetAllLines(
+ tabular->GetCellNumber(i,j), setLines);
+ updateLocal(bv, INIT, true);
+ break;
+ case LyXTabular::SET_LONGTABULAR:
+ tabular->SetLongTabular(true);
+ updateLocal(bv, INIT, true); // because this toggles displayed
+ break;
+ case LyXTabular::UNSET_LONGTABULAR:
+ tabular->SetLongTabular(false);
+ updateLocal(bv, INIT, true); // because this toggles displayed
+ break;
+ case LyXTabular::SET_ROTATE_TABULAR:
+ tabular->SetRotateTabular(true);
+ break;
+ case LyXTabular::UNSET_ROTATE_TABULAR:
+ tabular->SetRotateTabular(false);
+ break;
+ case LyXTabular::SET_ROTATE_CELL:
+ for (int i = sel_row_start; i <= sel_row_end; ++i)
+ for (int j = sel_col_start; j<=sel_col_end; ++j)
+ tabular->SetRotateCell(
+ tabular->GetCellNumber(i, j),
+ true);
+ break;
+ case LyXTabular::UNSET_ROTATE_CELL:
+ for (int i = sel_row_start; i <= sel_row_end; ++i)
+ for (int j = sel_col_start; j <= sel_col_end; ++j)
+ tabular->SetRotateCell(
+ tabular->GetCellNumber(i, j), false);
+ break;
+ case LyXTabular::SET_USEBOX:
+ {
+ LyXTabular::BoxType val = LyXTabular::BoxType(strToInt(value));
+ if (val == tabular->GetUsebox(actcell))
+ val = LyXTabular::BOX_NONE;
+ for (int i = sel_row_start; i <= sel_row_end; ++i)
+ for (int j = sel_col_start; j <= sel_col_end; ++j)
+ tabular->SetUsebox(
+ tabular->GetCellNumber(i, j), val);
+ break;
+ }
+ case LyXTabular::UNSET_LTFIRSTHEAD:
+ ltt.row = 0;
+ case LyXTabular::SET_LTFIRSTHEAD:
+ tabular->SetLTHead(ltt, true);
+ break;
+ case LyXTabular::UNSET_LTHEAD:
+ ltt.row = 0;
+ case LyXTabular::SET_LTHEAD:
+ tabular->SetLTHead(ltt, false);
+ break;
+ case LyXTabular::UNSET_LTFOOT:
+ ltt.row = 0;
+ case LyXTabular::SET_LTFOOT:
+ tabular->SetLTFoot(ltt, false);
+ break;
+ case LyXTabular::UNSET_LTLASTFOOT:
+ ltt.row = 0;
+ case LyXTabular::SET_LTLASTFOOT:
+ tabular->SetLTFoot(ltt, true);
+ break;
+ case LyXTabular::SET_LTNEWPAGE:
+ {
+ bool what = !tabular->GetLTNewPage(actcell);
+ tabular->SetLTNewPage(actcell, what);
+ break;
+ }
+ // dummy stuff just to avoid warnings
+ case LyXTabular::LAST_ACTION:
+ break;
+ }