remove the spurious metrics() (ex-update()) call from setRowHeight()

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7590 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2003-08-22 11:54:02 +00:00
parent e2df724add
commit 359519bda4
3 changed files with 12 additions and 35 deletions

View File

@ -999,21 +999,9 @@ void LyXText::setHeightOfRow(ParagraphList::iterator pit, RowList::iterator rit)
if (par.isInset(pos)) {
InsetOld const * tmpinset = par.getInset(pos);
if (tmpinset) {
#if 1 // this is needed for deep update on initialitation
#warning inset->update FIXME
//tmpinset->update(bv());
LyXFont const tmpfont = getFont(pit, pos);
Dimension dim;
MetricsInfo mi(bv(), tmpfont, workWidth());
tmpinset->metrics(mi, dim);
maxwidth += dim.wid;
maxasc = max(maxasc, dim.asc);
maxdesc = max(maxdesc, dim.des);
#else
maxwidth += tmpinset->width();
maxasc = max(maxasc, tmpinset->ascent());
maxdesc = max(maxdesc, tmpinset->descent());
#endif
}
} else {
// Fall-back to normal case
@ -1985,9 +1973,7 @@ void LyXText::backspace()
}
cursorLeft(bv());
// the layout things can change the height of a row !
setHeightOfRow(cursor.par(), cursorRow());
redoParagraph(cursor.par());
return;
}
}

View File

@ -555,6 +555,15 @@ void LyXText::redoParagraph(ParagraphList::iterator pit)
height -= rit->height();
pit->rows.clear();
// redo insets
InsetList::iterator ii = pit->insetlist.begin();
InsetList::iterator iend = pit->insetlist.end();
for (; ii != iend; ++ii) {
Dimension dim;
MetricsInfo mi(bv(), getFont(pit, ii->pos), 0);
ii->inset->metrics(mi, dim);
}
// rebreak the paragraph
for (pos_type z = 0; z < pit->size() + 1; ) {
Row row(z);
@ -593,25 +602,7 @@ void LyXText::metrics(MetricsInfo & mi, Dimension & dim)
height = 0;
//anchor_y_ = 0;
ParagraphList::iterator pit = ownerParagraphs().begin();
ParagraphList::iterator end = ownerParagraphs().end();
for (; pit != end; ++pit) {
pit->rows.clear();
InsetList::iterator ii = pit->insetlist.begin();
InsetList::iterator iend = pit->insetlist.end();
for (; ii != iend; ++ii) {
Dimension dim;
MetricsInfo m = mi;
#warning FIXME: pos != 0
m.base.font = getFont(pit, 0);
ii->inset->metrics(m, dim);
}
redoParagraph(pit);
}
redoParagraphs(ownerParagraphs().begin(), ownerParagraphs().end());
// final dimension
dim.asc = firstRow()->ascent_of_text();

View File

@ -402,7 +402,7 @@ InsetOld::RESULT LyXText::dispatch(FuncRequest const & cmd)
if (tmp->params().startOfAppendix()) {
recordUndo(bv, Undo::ATOMIC, tmp);
tmp->params().startOfAppendix(false);
setHeightOfRow(tmp, getRow(tmp, 0));
redoParagraph(tmp);
break;
}
}