#include "gettext.h"
#include "lyxtext.h"
#include "layout.h"
+#include "insets/lyxinset.h"
// Prototypes
// Joacim
#define IS_TABULAR (current_view->the_locking_inset && \
- (current_view->the_locking_inset->LyxCode() == \
- Inset::TABULAR_CODE))
+ current_view->the_locking_inset->GetFirstLockingInsetOfType(Inset::TABULAR_CODE))
bool UpdateLayoutTable(int flag)
{
if (!current_view->available())
update = false;
- if (update && current_view->text->cursor.par->table) {
+ if (update && current_view->text->cursor.par()->table) {
char buf[12];
string pwidth, special;
- LyXTable * table = current_view->text->cursor.par->table;
+ LyXTable * table = current_view->text->cursor.par()->table;
int cell = current_view->text->
- NumberOfCell(current_view->text->cursor.par,
- current_view->text->cursor.pos);
+ NumberOfCell(current_view->text->cursor.par(),
+ current_view->text->cursor.pos());
ActCell = cell;
int column = table->column_of_cell(cell)+1;
fl_set_object_label(fd_form_table_options->text_warning, "");
table->RotateTable());
fl_set_focus_object(fd_form_table_options->form_table_options,
fd_form_table_options->button_table_delete);
- } else if (update && IS_TABULAR) {
- UpdateLayoutTabular(flag);
} else if (fd_form_table_options->form_table_options->visible) {
fl_set_focus_object(fd_form_table_options->form_table_options,
fd_form_table_options->button_table_delete);
}
}
-
void MenuLayoutTable(int flag)
{
if (UpdateLayoutTable(flag)) {
string special, str;
if (!current_view->available()
- || !(table = current_view->text->cursor.par->table)) {
+ || !(table = current_view->text->cursor.par()->table)) {
MenuLayoutTable(0);
return;
}
int cell = current_view->text->
- NumberOfCell(current_view->text->cursor.par,
- current_view->text->cursor.pos);
+ NumberOfCell(current_view->text->cursor.par(),
+ current_view->text->cursor.pos());
if (ActCell != cell) {
MenuLayoutTable(0);
fl_set_object_label(fd_form_table_options->text_warning,
current_view->hideCursor();
if (!current_view->text->selection){
current_view->beforeChange();
- current_view->update(-2);
+ current_view->update(BufferView::SELECT|BufferView::FITCUR);
}
if ((num == LyXTable::SET_SPECIAL_COLUMN) ||
(num == LyXTable::SET_SPECIAL_MULTI))
- current_view->text->TableFeatures(num, special);
+ current_view->text->TableFeatures(current_view, num, special);
else
- current_view->text->TableFeatures(num);
- current_view->update(1);
+ current_view->text->TableFeatures(current_view, num);
+ current_view->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
}
if (num == LyXTable::DELETE_TABLE) {
fl_set_focus_object(fd_form_table_options->form_table_options,
void SetPWidthCB(FL_OBJECT * ob, long l)
{
if (IS_TABULAR) {
- SetPWidthCB(ob, l);
+ SetPWidthTabularCB(ob, l);
return;
}
current_view->hideCursor();
if (!current_view->text->selection) {
current_view->beforeChange();
- current_view->update(-2);
+ current_view->update(BufferView::SELECT|BufferView::FITCUR);
}
- current_view->text->TableFeatures(LyXTable::SET_PWIDTH, str);
- current_view->update(1);
+ current_view->text->TableFeatures(current_view, LyXTable::SET_PWIDTH, str);
+ current_view->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
}
MenuLayoutTable(0); // update for alignment
}