#include "LyXView.h"
#include "insets/insettext.h"
#include "frontends/Dialogs.h"
+#include "frontends/Alert.h"
#include "debug.h"
#include "WorkArea.h"
#include "gettext.h"
clearSelection();
need_update = INIT;
in_update = false;
+ in_reset_pos = false;
}
bool same_id)
: UpdatableInset(tab, same_id), buffer(&buf)
{
- tabular.reset(new LyXTabular(this, *(tab.tabular)));
+ tabular.reset(new LyXTabular(this, *(tab.tabular), same_id));
the_locking_inset = 0;
locked = no_selection = false;
oldcell = -1;
sel_cell_start = sel_cell_end = 0;
need_update = INIT;
in_update = false;
+ in_reset_pos = false;
}
}
i = tabular->row_of_cell(cell);
if (the_locking_inset != tabular->GetCellInset(cell)) {
- lyxerr[Debug::INSETS] << "ERROR this shouldn't happen\n";
+ lyxerr[Debug::INSETTEXT] << "ERROR this shouldn't happen\n";
return;
}
float dx = nx + tabular->GetBeginningOfTextInCell(cell);
UpdatableInset::edit(bv, x, y, button);
if (!bv->lockInset(this)) {
- lyxerr[Debug::INSETS] << "InsetTabular::Cannot lock inset" << endl;
+ lyxerr[Debug::INSETTEXT] << "InsetTabular::Cannot lock inset" << endl;
return;
}
locked = true;
UpdatableInset::edit(bv, front);
if (!bv->lockInset(this)) {
- lyxerr[Debug::INSETS] << "InsetTabular::Cannot lock inset" << endl;
+ lyxerr[Debug::INSETTEXT] << "InsetTabular::Cannot lock inset" << endl;
return;
}
locked = true;
bool InsetTabular::lockInsetInInset(BufferView * bv, UpdatableInset * inset)
{
- lyxerr[Debug::INSETS] << "InsetTabular::LockInsetInInset("
+ lyxerr[Debug::INSETTEXT] << "InsetTabular::LockInsetInInset("
<< inset << "): ";
if (!inset)
return false;
oldcell = -1;
if (inset == tabular->GetCellInset(actcell)) {
- lyxerr[Debug::INSETS] << "OK" << endl;
+ lyxerr[Debug::INSETTEXT] << "OK" << endl;
the_locking_inset = tabular->GetCellInset(actcell);
resetPos(bv);
return true;
} else if (the_locking_inset && (the_locking_inset == inset)) {
- lyxerr[Debug::INSETS] << "OK" << endl;
+ lyxerr[Debug::INSETTEXT] << "OK" << endl;
resetPos(bv);
} else if (the_locking_inset) {
- lyxerr[Debug::INSETS] << "MAYBE" << endl;
+ lyxerr[Debug::INSETTEXT] << "MAYBE" << endl;
return the_locking_inset->lockInsetInInset(bv, inset);
}
- lyxerr[Debug::INSETS] << "NOT OK" << endl;
+ lyxerr[Debug::INSETTEXT] << "NOT OK" << endl;
return false;
}
{
if (!locked || nodraw())
return;
+#warning This should be fixed in the right manner (20011128 Jug)
+ // fast hack to fix infinite repaintings!
+ if (in_reset_pos)
+ return;
+ in_reset_pos = true;
+
actcol = tabular->column_of_cell(actcell);
int cell = 0;
bv->owner()->getDialogs()->updateTabular(inset);
oldcell = actcell;
}
+ in_reset_pos = false;
}
case LyXTabular::MULTICOLUMN:
{
if (sel_row_start != sel_row_end) {
- WriteAlert(_("Impossible Operation!"),
+ Alert::alert(_("Impossible Operation!"),
_("Multicolumns can only be horizontally."),
_("Sorry."));
return;
cell = actcell;
if (tabular->GetCellInset(cell) != inset) {
- lyxerr << "Actcell not equal to actual cell!\n";
+ lyxerr[Debug::INSETTEXT] << "Actcell not equal to actual cell!\n";
cell = -1;
}
}