1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 2000 The LyX Team.
8 *======================================================
19 #pragma implementation
22 #include "insettabular.h"
25 #include "commandtags.h"
26 #include "LaTeXFeatures.h"
29 #include "insets/insettext.h"
31 const int ADD_TO_HEIGHT = 2;
32 const int ADD_TO_TABULAR_WIDTH = 2;
40 InsetTabular::InsetTabular(Buffer * buf, int rows, int columns)
46 tabular = new LyXTabular(rows,columns,buf);
47 // for now make it always display as display() inset
49 tabular->SetLongTabular(true);
50 the_locking_inset = 0;
52 cursor_visible = false;
54 sel_pos_start = sel_pos_end = 0;
60 InsetTabular::InsetTabular(InsetTabular const & tab, Buffer * buf)
62 tabular = new LyXTabular(*(tab.tabular), buf);
63 the_locking_inset = 0;
65 cursor_visible = false;
67 sel_pos_start = sel_pos_end = 0;
73 InsetTabular::~InsetTabular()
79 Inset * InsetTabular::Clone() const
81 InsetTabular * t = new InsetTabular(*this, buffer);
86 void InsetTabular::Write(ostream & os) const
88 os << "\\begin_inset Tabular\n";
89 tabular->Write(os,false);
90 os << "\\end_inset\n";
94 void InsetTabular::Read(LyXLex & lex)
98 // bool old_format = (lex.GetString() == "\\LyXTabular");
99 tabular = new LyXTabular(lex, buffer);
104 int InsetTabular::ascent(Painter & pain, LyXFont const & font) const
107 calculate_width_of_cells(pain, font);
110 return tabular->AscentOfRow(0);
114 int InsetTabular::descent(Painter & pain, LyXFont const & font) const
117 calculate_width_of_cells(pain, font);
120 return tabular->HeightOfTabular() - tabular->AscentOfRow(0);
124 int InsetTabular::width(Painter & pain, LyXFont const & font) const
127 calculate_width_of_cells(pain, font);
130 return tabular->WidthOfTabular() + (2 * ADD_TO_TABULAR_WIDTH);
134 void InsetTabular::draw(Painter & pain, const LyXFont & font, int baseline,
140 UpdatableInset::draw(pain,font,baseline,x);
141 if (top_x != int(x)) {
144 setPos(pain, cursor.x - ox - 2, cursor.y);
146 top_baseline = baseline;
147 calculate_width_of_cells(pain, font);
148 for(i=0;i<tabular->rows();++i) {
150 for(j=0;j<tabular->columns();++j) {
151 DrawCellLines(pain, nx, baseline, i, cell);
152 nx += tabular->WidthOfColumn(cell);
155 baseline += tabular->DescentOfRow(i) + tabular->AscentOfRow(i+1)
156 + tabular->AdditionalHeight(cell+1);
161 char const * InsetTabular::EditMessage() const
163 return _("Opened Tabular Inset");
167 void InsetTabular::Edit(BufferView * bv, int x, int y, unsigned int button)
169 UpdatableInset::Edit(bv, x, y, button);
171 if (!bv->lockInset(this)) {
172 lyxerr[Debug::INSETS] << "InsetTabular::Cannot lock inset" << endl;
175 the_locking_inset = 0;
176 sel_pos_start = sel_pos_end = inset_pos = inset_x = inset_y = 0;
177 setPos(bv->painter(), x, y);
178 sel_pos_start = sel_pos_end = cursor.pos;
179 // bv->text->FinishUndo();
180 UpdateLocal(bv, true);
181 // bv->getOwner()->getPopups().updateFormTabular();
185 void InsetTabular::InsetUnlock(BufferView * bv)
187 if (the_locking_inset)
188 the_locking_inset->InsetUnlock(bv);
190 the_locking_inset = 0;
191 if (hasCharSelection()) {
192 sel_pos_start = sel_pos_end = cursor.pos;
193 UpdateLocal(bv, false);
195 sel_pos_start = sel_pos_end = cursor.pos;
196 no_selection = false;
200 bool InsetTabular::LockInsetInInset(UpdatableInset *)
206 bool InsetTabular::UnlockInsetInInset(BufferView * bv, UpdatableInset * inset,
209 if (!the_locking_inset)
211 if (the_locking_inset == inset) {
212 the_locking_inset->InsetUnlock(bv);
213 the_locking_inset = 0;
218 return the_locking_inset->UnlockInsetInInset(bv, inset, lr);
222 void InsetTabular::UpdateLocal(BufferView * bv, bool flag)
225 bv->updateInset(this, flag);
229 bool InsetTabular::UpdateInsetInInset(BufferView * bv, Inset * inset)
231 if (!the_locking_inset)
233 if (the_locking_inset != inset)
234 return the_locking_inset->UpdateInsetInInset(bv, inset);
240 void InsetTabular::InsetButtonRelease(BufferView * bv,
241 int x, int y, int button)
243 if (the_locking_inset) {
244 the_locking_inset->InsetButtonRelease(bv, x-inset_x,y-inset_y,button);
247 no_selection = false;
251 void InsetTabular::InsetButtonPress(BufferView * bv, int x, int y, int)
253 if (hasCharSelection()) {
254 sel_pos_start = sel_pos_end = 0;
255 UpdateLocal(bv, false);
257 no_selection = false;
258 if (the_locking_inset) {
259 // otherwise only unlock the_locking_inset
260 the_locking_inset->InsetUnlock(bv);
263 int oldcell = actcell;
265 setPos(bv->painter(),x,y);
266 the_locking_inset = 0;
267 sel_pos_start = sel_pos_end = cursor.pos;
268 sel_cell_start = sel_cell_end = actcell;
271 bview->getOwner()->getPopups().showFormTabular();
272 else if (oldcell != actcell)
273 bview->getOwner()->getPopups().updateFormTabular();
278 void InsetTabular::InsetMotionNotify(BufferView * bv, int x, int y, int button)
280 if (the_locking_inset) {
281 the_locking_inset->InsetMotionNotify(bv, x - inset_x,
282 y - inset_y, button);
286 // int oldcell = actcell,
287 int old = sel_pos_end;
289 setPos(bv->painter(), x, y);
290 sel_pos_end = cursor.pos;
291 sel_cell_end = actcell;
292 if (old != sel_pos_end)
293 UpdateLocal(bv, false);
295 if (oldcell != actcell)
296 bview->getOwner()->getPopups().updateFormTabular();
299 no_selection = false;
303 void InsetTabular::InsetKeyPress(XKeyEvent * xke)
305 if (the_locking_inset) {
306 the_locking_inset->InsetKeyPress(xke);
312 UpdatableInset::RESULT InsetTabular::LocalDispatch(BufferView * bv, int action,
315 UpdatableInset::RESULT
318 no_selection = false;
319 if (((result=UpdatableInset::LocalDispatch(bv, action, arg)) == DISPATCHED)
320 || (result == DISPATCHED_NOUPDATE)) {
327 if ((action < 0) && arg.empty())
330 if ((action != LFUN_DOWN) && (action != LFUN_UP) &&
331 (action != LFUN_DOWNSEL) && (action != LFUN_UPSEL))
333 if (the_locking_inset) {
334 result=the_locking_inset->LocalDispatch(bv, action, arg);
335 if (result == DISPATCHED_NOUPDATE)
337 else if (result == DISPATCHED) {
338 setWidthOfCell(cursor.pos,actcell,actrow);
339 the_locking_inset->ToggleInsetCursor(bv);
340 UpdateLocal(bv, false);
341 the_locking_inset->ToggleInsetCursor(bv);
343 } else if (result == FINISHED) {
344 if ((action == LFUN_RIGHT) || (action == -1)) {
345 cursor.pos = inset_pos + 1;
356 // Normal chars not handled here
359 // --- Cursor Movements ---------------------------------------------
362 sel_pos_end = cursor.pos;
363 UpdateLocal(bv, false);
366 result = moveRight(bv);
367 if (hasCharSelection()) {
368 sel_pos_start = sel_pos_end = cursor.pos;
369 UpdateLocal(bv, false);
371 sel_pos_start = sel_pos_end = cursor.pos;
375 sel_pos_end = cursor.pos;
376 UpdateLocal(bv, false);
380 if (hasCharSelection()) {
381 sel_pos_start = sel_pos_end = cursor.pos;
382 UpdateLocal(bv, false);
384 sel_pos_start = sel_pos_end = cursor.pos;
388 sel_pos_end = cursor.pos;
389 UpdateLocal(bv, false);
393 if (hasCharSelection()) {
394 sel_pos_start = sel_pos_end = cursor.pos;
395 UpdateLocal(bv, false);
397 sel_pos_start = sel_pos_end = cursor.pos;
401 sel_pos_end = cursor.pos;
402 UpdateLocal(bv, false);
406 if (hasCharSelection()) {
407 sel_pos_start = sel_pos_end = cursor.pos;
408 UpdateLocal(bv, false);
410 sel_pos_start = sel_pos_end = cursor.pos;
421 if (hasCharSelection()) {
422 sel_pos_start = sel_pos_end = cursor.pos;
423 UpdateLocal(bv, false);
425 sel_pos_start = sel_pos_end = cursor.pos;
429 result = UNDISPATCHED;
432 if (result!=FINISHED) {
433 if (!the_locking_inset) {
435 if (oldcell != actcell)
436 bview->getOwner()->getPopups().updateFormTabular();
441 bv->unlockInset(this);
446 int InsetTabular::Latex(ostream & os, bool, bool) const
448 return tabular->Latex(os);
452 int InsetTabular::Ascii(ostream &) const
457 int InsetTabular::Linuxdoc(ostream &) const
463 int InsetTabular::DocBook(ostream &) const
469 void InsetTabular::Validate(LaTeXFeatures & features) const
471 if (tabular->IsLongTabular())
472 features.longtable = true;
476 void InsetTabular::calculate_width_of_cells(Painter & pain,
477 LyXFont const & font) const
483 for(int i = 0; i < tabular->rows(); ++i) {
484 maxAsc = maxDesc = 0;
485 for(int j= 0; j < tabular->columns(); ++j) {
486 if (tabular->IsPartOfMultiColumn(i,j))
489 inset = tabular->GetCellInset(cell);
490 maxAsc = max(maxAsc, inset->ascent(pain, font));
491 maxDesc = max(maxDesc, inset->descent(pain, font));
492 tabular->SetWidthOfCell(cell,
493 inset->width(pain, font));
495 tabular->SetAscentOfRow(i, maxAsc + ADD_TO_HEIGHT);
496 tabular->SetDescentOfRow(i, maxDesc + ADD_TO_HEIGHT);
501 void InsetTabular::DrawCellLines(Painter & pain, int x, int baseline,
502 int row, int cell) const
504 // Juergen, have you thought about drawing the on-off lines in a
505 // different color (gray of some kind), especially since those
506 // lines will not be there on the hardcopy anyway. (Lgb)
507 int x2 = x + tabular->WidthOfColumn(cell);
508 bool on_off = !tabular->TopLine(cell);
510 if (!tabular->TopAlreadyDrawed(cell))
511 pain.line(x, baseline - tabular->AscentOfRow(row),
512 x2, baseline - tabular->AscentOfRow(row),
513 on_off ? LColor::tabularonoffline:LColor::tabularline,
514 on_off ? Painter::line_onoffdash:Painter::line_solid);
515 on_off = !tabular->BottomLine(cell);
516 pain.line(x,baseline + tabular->DescentOfRow(row),
517 x2, baseline + tabular->DescentOfRow(row),
518 on_off ? LColor::tabularonoffline:LColor::tabularline,
519 on_off ? Painter::line_onoffdash:Painter::line_solid);
520 on_off = !tabular->LeftLine(cell);
521 pain.line(x, baseline - tabular->AscentOfRow(row),
522 x, baseline + tabular->DescentOfRow(row),
523 on_off ? LColor::tabularonoffline:LColor::tabularline,
524 on_off ? Painter::line_onoffdash:Painter::line_solid);
525 on_off = !tabular->RightLine(cell);
526 pain.line(x2 - tabular->AdditionalWidth(cell),
527 baseline - tabular->AscentOfRow(row),
528 x2 - tabular->AdditionalWidth(cell),
529 baseline + tabular->DescentOfRow(row),
530 on_off ? LColor::tabularonoffline:LColor::tabularline,
531 on_off ? Painter::line_onoffdash:Painter::line_solid);
535 void InsetTabular::GetCursorPos(int & x, int & y)
542 void InsetTabular::ToggleInsetCursor(BufferView * bv)
544 if (the_locking_inset) {
545 the_locking_inset->ToggleInsetCursor(bv);
549 LyXFont font; // = the_locking_inset->GetFont(par, cursor.pos);
551 int asc = lyxfont::maxAscent(font);
552 int desc = lyxfont::maxDescent(font);
555 bv->hideLockedInsetCursor();
557 bv->showLockedInsetCursor(cursor.x, cursor.y, asc, desc);
558 cursor_visible = !cursor_visible;
562 void InsetTabular::ShowInsetCursor(BufferView * bv)
564 if (!cursor_visible) {
565 LyXFont font; // = GetFont(par, cursor.pos);
567 int asc = lyxfont::maxAscent(font);
568 int desc = lyxfont::maxDescent(font);
569 bv->fitLockedInsetCursor(cursor.x, cursor.y, asc, desc);
570 bv->showLockedInsetCursor(cursor.x, cursor.y, asc, desc);
571 cursor_visible = true;
576 void InsetTabular::HideInsetCursor(BufferView * bv)
579 ToggleInsetCursor(bv);
583 void InsetTabular::setPos(Painter &, int x, int y) const
585 cursor.y = cursor.pos = actcell = actrow = actcol = 0;
586 int ly = tabular->DescentOfRow(actrow);
588 // first search the right row
589 while((ly < y) && (actrow < tabular->rows())) {
590 cursor.y += tabular->DescentOfRow(actrow) +
591 tabular->AscentOfRow(actrow+1) +
592 tabular->AdditionalHeight(tabular->GetCellNumber(actcol,actrow+1));
594 ly = cursor.y + tabular->DescentOfRow(actrow);
596 actcell = tabular->GetCellNumber(actcol, actrow);
598 // now search the right column
599 int lx = tabular->GetWidthOfCell(actcell);
601 !tabular->IsLastCellInRow(actcell) && (lx < x);
602 ++actcell,lx += tabular->GetWidthOfCell(actcell)) {}
603 cursor.x = lx - tabular->GetWidthOfCell(actcell) + top_x + 2;
607 void InsetTabular::resetPos(BufferView * bv)
609 actrow = cursor.y = actcol = 0;
612 for(; (cell<actcell) && !tabular->IsLastRow(cell); ++cell) {
613 if (tabular->IsLastCellInRow(cell)) {
614 cursor.y += tabular->DescentOfRow(actrow) +
615 tabular->AscentOfRow(actrow+1) +
616 tabular->AdditionalHeight(cell+1);
620 for(cell=actcell;!tabular->IsFirstCellInRow(cell);--cell)
622 int lx = tabular->GetWidthOfCell(actcell);
623 for(; (cell < actcell); ++cell) {
624 lx += tabular->GetWidthOfCell(actcell);
627 cursor.x = lx - tabular->GetWidthOfCell(actcell) + top_x + 2;
628 if (cursor.pos % 2) {
629 LyXFont font(LyXFont::ALL_SANE);
630 cursor.x += tabular->GetCellInset(actcell)->width(bv->painter(),font);
635 void InsetTabular::setWidthOfCell(int, int, int)
640 UpdatableInset::RESULT InsetTabular::moveRight(BufferView * bv)
642 if (cursor.pos % 2) { // behind the inset
644 if (actcell >= tabular->GetNumberOfCells())
647 } else { // before the inset
651 return DISPATCHED_NOUPDATE;
655 UpdatableInset::RESULT InsetTabular::moveLeft()
657 return DISPATCHED_NOUPDATE;
661 UpdatableInset::RESULT InsetTabular::moveUp()
663 return DISPATCHED_NOUPDATE;
667 UpdatableInset::RESULT InsetTabular::moveDown()
669 return DISPATCHED_NOUPDATE;
673 bool InsetTabular::moveNextCell()
679 bool InsetTabular::movePrevCell()
685 bool InsetTabular::Delete()
691 void InsetTabular::SetFont(LyXFont const &)
696 void InsetTabular::TabularFeatures(int, string)
704 setAlign = LYX_ALIGN_LEFT,
710 case LyXTabular::ALIGN_LEFT:
711 setAlign=LYX_ALIGN_LEFT;
713 case LyXTabular::ALIGN_RIGHT:
714 setAlign=LYX_ALIGN_RIGHT;
716 case LyXTabular::ALIGN_CENTER:
717 setAlign=LYX_ALIGN_CENTER;
722 if (hasCellSelection()) {
723 if (sel_cell_start > sel_cell_end) {
724 sel_pos_start = sel_cell_end;
725 sel_pos_end = sel_cell_start;
727 sel_pos_start = sel_cell_start;
728 sel_pos_end = sel_cell_end;
731 sel_pos_start = sel_pos_end = actcell;
733 case LyXTabular::SET_PWIDTH:
734 tabular->SetPWidth(actcell,val);
736 case LyXTabular::SET_SPECIAL_COLUMN:
737 case LyXTabular::SET_SPECIAL_MULTI:
738 tabular->SetAlignSpecial(actcell,val,feature);
740 case LyXTabular::APPEND_ROW:
747 // if there is a ContRow following this row I have to add
748 // the row after the ContRow's
749 if ((pos < par->last()) && tabular->RowHasContRow(cell_org)) {
750 while((pos < par->last()) && !tabular->IsContRow(cell)) {
751 while (pos < par->last() && !par->IsNewline(pos))
753 if (pos < par->last())
757 while((pos < par->last()) && tabular->IsContRow(cell)) {
758 while (pos < par->last() && !par->IsNewline(pos))
760 if (pos < par->last())
765 if (pos < par->last())
768 while ((pos < par->last()) &&
769 ((cell == cell_org) || !tabular->IsFirstCell(cell))) {
770 while ((pos < par->last()) && !par->IsNewline(pos))
772 if (pos < par->last())
776 // insert the new cells
777 int number = tabular->NumberOfCellsInRow(cell_org);
778 for (i=0; i<number; ++i)
779 par->InsertChar(pos, LYX_META_NEWLINE);
781 // append the row into the tabular
782 tabular->AppendRow(cell_org);
783 calculate_width_of_cells();
787 case LyXTabular::APPEND_CONT_ROW:
794 // if there is already a controw but not for this cell
795 // the AppendContRow sets only the right values but does
796 // not actually add a row
797 if (tabular->RowHasContRow(cell_org) &&
798 (tabular->CellHasContRow(cell_org) < 0)) {
799 tabular->AppendContRow(cell_org);
800 calculate_width_of_cells();
804 while ((pos < par->last()) &&
805 ((cell == cell_org) || !tabular->IsFirstCell(cell))) {
806 while (pos < par->last() && !par->IsNewline(pos))
808 if (pos < par->last())
812 // insert the new cells
813 int number = tabular->NumberOfCellsInRow(cell_org);
814 for (i=0; i<number; ++i)
815 par->InsertChar(pos, LYX_META_NEWLINE);
816 // append the row into the tabular
817 tabular->AppendContRow(cell_org);
818 calculate_width_of_cells();
822 case LyXTabular::APPEND_COLUMN:
829 if (pos && (par->IsNewline(pos-1))) {
830 if (tabular->AppendCellAfterCell(cell_org, cell)) {
831 par->InsertChar(pos, LYX_META_NEWLINE);
832 if (pos <= cursor.pos)
839 } while (pos <= par->last());
840 // remember that the very last cell doesn't end with a newline.
841 // This saves one byte memory per tabular ;-)
842 if (tabular->AppendCellAfterCell(cell_org, cell))
843 par->InsertChar(par->last(), LYX_META_NEWLINE);
844 // append the column into the tabular
845 tabular->AppendColumn(cell_org);
846 calculate_width_of_cells();
850 case LyXTabular::DELETE_ROW:
852 calculate_width_of_cells();
855 case LyXTabular::DELETE_COLUMN:
860 if (!pos || (par->IsNewline(pos-1))){
861 if (tabular->DeleteCellIfColumnIsDeleted(cell, actcell)) {
863 while (pos < par->last() && !par->IsNewline(pos))
865 if (pos < par->last())
868 par->Erase(pos - 1); // the missing newline
869 // at the end of a tabular
870 --pos; // because of ++pos below
875 } while (pos <= par->last());
876 /* delete the column from the tabular */
877 tabular->DeleteColumn(actcell);
878 calculate_width_of_cells();
882 case LyXTabular::TOGGLE_LINE_TOP:
883 lineSet = !tabular->TopLine(actcell);
884 for(i=sel_pos_start; i<=sel_pos_end; ++i)
885 tabular->SetTopLine(i,lineSet);
886 calculate_width_of_cells();
890 case LyXTabular::TOGGLE_LINE_BOTTOM:
891 lineSet = !tabular->BottomLine(actcell);
892 for(i=sel_pos_start; i<=sel_pos_end; ++i)
893 tabular->SetBottomLine(i,lineSet);
894 calculate_width_of_cells();
898 case LyXTabular::TOGGLE_LINE_LEFT:
899 lineSet = !tabular->LeftLine(actcell);
900 for(i=sel_pos_start; i<=sel_pos_end; ++i)
901 tabular->SetLeftLine(i,lineSet);
902 calculate_width_of_cells();
906 case LyXTabular::TOGGLE_LINE_RIGHT:
907 lineSet = !tabular->RightLine(actcell);
908 for(i=sel_pos_start; i<=sel_pos_end; ++i)
909 tabular->SetRightLine(i,lineSet);
910 calculate_width_of_cells();
913 case LyXTabular::ALIGN_LEFT:
914 case LyXTabular::ALIGN_RIGHT:
915 case LyXTabular::ALIGN_CENTER:
916 for(i=sel_pos_start; i<=sel_pos_end; ++i)
917 tabular->SetAlignment(i,setAlign);
920 case LyXTabular::MULTICOLUMN:
922 if (tabular->row_of_cell(sel_pos_start) !=
923 tabular->row_of_cell(sel_pos_end)) {
924 WriteAlert(_("Impossible Operation!"),
925 _("Multicolumns can only be horizontally."),
929 // just multicol for one Single Cell
930 if (!hasCellSelection()) {
931 // check wether we are completly in a multicol
932 if (tabular->IsMultiColumn(actcell)) {
936 if ((newlines=tabular->UnsetMultiColumn(actcell))) {
937 while ((pos < par->last()) && !par->IsNewline(pos))
939 for (;newlines;--newlines)
940 par->InsertChar(pos, LYX_META_NEWLINE);
942 calculate_width_of_cells();
944 tabular->SetMultiColumn(actcell, 1);
949 // we have a selection so this means we just add all this
950 // cells to form a multicolumn cell
955 if (sel_pos_start > sel_pos_end) {
956 s_start = sel_pos_end;
957 s_end = sel_pos_start;
959 s_start = sel_pos_start;
962 for(i=s_start; i < s_end; ++i) {
963 if (par->IsNewline(i)) {
965 // check for double-blanks
966 if ((i && !par->IsLineSeparator(i-1)) &&
967 (i < par->last()) && !par->IsLineSeparator(i))
968 par->InsertChar(i, ' ');
974 tabular->SetMultiColumn(sel_pos_start,number);
975 cursor.pos = s_start;
976 sel_cell_end = sel_cell_start;
977 calculate_width_of_cells();
981 case LyXTabular::SET_ALL_LINES:
983 case LyXTabular::UNSET_ALL_LINES:
984 for(i=sel_pos_start; i<=sel_pos_end; ++i)
985 tabular->SetAllLines(i, setLines);
986 calculate_width_of_cells();
989 case LyXTabular::SET_LONGTABULAR:
990 tabular->SetLongTabular(true);
991 UpdateLocal(); // because this toggles displayed
993 case LyXTabular::UNSET_LONGTABULAR:
994 tabular->SetLongTabular(false);
995 UpdateLocal(); // because this toggles displayed
997 case LyXTabular::SET_ROTATE_TABULAR:
998 tabular->SetRotateTabular(true);
1000 case LyXTabular::UNSET_ROTATE_TABULAR:
1001 tabular->SetRotateTabular(false);
1003 case LyXTabular::SET_ROTATE_CELL:
1004 for(i=sel_pos_start; i<=sel_pos_end; ++i)
1005 tabular->SetRotateCell(i,true);
1007 case LyXTabular::UNSET_ROTATE_CELL:
1008 for(i=sel_pos_start; i<=sel_pos_end; ++i)
1009 tabular->SetRotateCell(i,false);
1011 case LyXTabular::SET_LINEBREAKS:
1012 what = !tabular->Linebreaks(tabular->FirstVirtualCell(actcell));
1013 for(i=sel_pos_start; i<=sel_pos_end; ++i)
1014 tabular->SetLinebreaks(i,what);
1016 case LyXTabular::SET_LTFIRSTHEAD:
1017 tabular->SetLTHead(actcell,true);
1019 case LyXTabular::SET_LTHEAD:
1020 tabular->SetLTHead(actcell,false);
1022 case LyXTabular::SET_LTFOOT:
1023 tabular->SetLTFoot(actcell,false);
1025 case LyXTabular::SET_LTLASTFOOT:
1026 tabular->SetLTFoot(actcell,true);
1028 case LyXTabular::SET_LTNEWPAGE:
1029 what = !tabular->LTNewPage(actcell);
1030 tabular->SetLTNewPage(actcell,what);
1036 void InsetTabular::RemoveTabularRow()