From: André Pönitz Date: Fri, 22 Aug 2003 11:54:02 +0000 (+0000) Subject: remove the spurious metrics() (ex-update()) call from setRowHeight() X-Git-Tag: 1.6.10~16245 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=359519bda437680b9c796131c119d9e922c1fd3a;p=features.git 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 --- diff --git a/src/text.C b/src/text.C index acb3710d00..ba76a8a251 100644 --- a/src/text.C +++ b/src/text.C @@ -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; } } diff --git a/src/text2.C b/src/text2.C index e16a58724e..865329529a 100644 --- a/src/text2.C +++ b/src/text2.C @@ -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(); diff --git a/src/text3.C b/src/text3.C index 09b84dd5a0..ebaf72a142 100644 --- a/src/text3.C +++ b/src/text3.C @@ -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; } }