From 371e05fd3e94f9b2ff97321d0ea1052df4660219 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Fri, 22 Aug 2003 12:00:58 +0000 Subject: [PATCH] hm... too eager I suppose git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7591 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/text.C | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/text.C b/src/text.C index ba76a8a251..139d56ebf3 100644 --- a/src/text.C +++ b/src/text.C @@ -999,9 +999,21 @@ 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 @@ -1221,15 +1233,12 @@ void LyXText::setHeightOfRow(ParagraphList::iterator pit, RowList::iterator rit) rit->top_of_text(rit->baseline() - font_metrics::maxAscent(font)); double x = 0; - if (layout->margintype != MARGIN_RIGHT_ADDRESS_BOX) { -#warning needed? #if 0 // this IS needed rit->width(maxwidth); double dummy; prepareToPrint(pit, rit, x, dummy, dummy, dummy, false); #endif - } rit->width(int(maxwidth + x)); if (inset_owner) { width = max(0, workWidth()); @@ -1973,7 +1982,9 @@ void LyXText::backspace() } cursorLeft(bv()); - redoParagraph(cursor.par()); + + // the layout things can change the height of a row ! + setHeightOfRow(cursor.par(), cursorRow()); return; } }