+
+2003-07-30 André Pönitz <poenitz@gmx.net>
+
+ * tabular.C: don't use Assert too heavily. This crashes where it
+ shouldn't
+
2003-07-30 Alfredo Braunstein <abraunst@libero.it>
* lyxfunc.C (dispatch): do not mark the buffer dirty if the action
+
+2003-07-30 André Pönitz <poenitz@gmx.net>
+
+ * insetcollapsable.C:
+ * insetfootlike.C:
+ * insettabular.C: parantheses, localize vars etc.
+
2003-07-29 Martin Vermeer <martin.vermeer@hut.fi>
* insetnote.C: Implement a newenvironment in preamble for
void InsetCollapsable::dimension_collapsed(Dimension & dim) const
{
font_metrics::buttonText(label, labelfont, dim.wid, dim.asc, dim.des);
- dim.wid += 2 * TEXT_TO_INSET_OFFSET;
}
void InsetCollapsable::draw_collapsed(PainterInfo & pi, int x, int y) const
{
- pi.pain.buttonText(x + TEXT_TO_INSET_OFFSET, y, label, labelfont);
+ pi.pain.buttonText(x, y, label, labelfont);
}
inset.draw(pi, x, y);
} else {
draw_collapsed(pi, old_x, bl);
- int const yy = bl + dim_collapsed.descent() + inset.ascent();
- inset.draw(pi, x, yy);
+ inset.draw(pi, x, bl + dim_collapsed.descent() + inset.ascent());
}
}
bool InsetFootlike::insetAllowed(InsetOld::Code code) const
{
- if ((code == InsetOld::FOOT_CODE) || (code == InsetOld::MARGIN_CODE)
- || (code == InsetOld::FLOAT_CODE))
+ if (code == InsetOld::FOOT_CODE || code == InsetOld::MARGIN_CODE
+ || code == InsetOld::FLOAT_CODE)
return false;
return InsetCollapsable::insetAllowed(code);
}
{
//lyxerr << "InsetTabular::draw: " << x << " " << y << "\n";
if (nodraw()) {
+ lyxerr << "InsetTabular::nodraw: " << x << " " << y << "\n";
need_update = FULL;
return;
}
BufferView * bv = pi.base.bv;
- int i;
- int j;
- int nx;
#if 0
UpdatableInset::draw(pi, x, y);
x += ADD_TO_TABULAR_WIDTH;
int cell = 0;
- int cx;
first_visible_cell = -1;
- for (i = 0; i < tabular.rows(); ++i) {
- nx = x;
+ for (int i = 0; i < tabular.rows(); ++i) {
+ int nx = x;
cell = tabular.getCellNumber(i, 0);
- if (!((y + tabular.getDescentOfRow(i)) > 0) &&
- (y - tabular.getAscentOfRow(i)) < pi.pain.paperHeight())
+ if (y + tabular.getDescentOfRow(i) <= 0 &&
+ y - tabular.getAscentOfRow(i) < pi.pain.paperHeight())
{
- y += tabular.getDescentOfRow(i) +
- tabular.getAscentOfRow(i + 1) +
- tabular.getAdditionalHeight(i + 1);
+ y += tabular.getDescentOfRow(i) +
+ tabular.getAscentOfRow(i + 1) +
+ tabular.getAdditionalHeight(i + 1);
continue;
}
- for (j = 0; j < tabular.columns(); ++j) {
+ for (int j = 0; j < tabular.columns(); ++j) {
if (nx > bv->workWidth())
break;
if (tabular.isPartOfMultiColumn(i, j))
continue;
- cx = nx + tabular.getBeginningOfTextInCell(cell);
+ int cx = nx + tabular.getBeginningOfTextInCell(cell);
if (first_visible_cell < 0)
first_visible_cell = cell;
if (hasSelection()) {
// well we didn't obviously find it so maybe our owner knows more
if (owner())
return owner()->forceDefaultParagraphs(in);
+
// if we're here there is really something strange going on!!!
+ lyxerr << "if we're here there is really something strange going on!\n";
return false;
}
{
// is this inset part of the tabular?
if (!inset || inset->owner() != owner_) {
- lyxerr << "this is not a cell of the tabular!" << endl;
- Assert(0);
+ //lyxerr << "Abort::this is not a cell of the tabular!" << endl;
+ return -1;
}
const int save_cur_cell = cur_cell;