This takes care of one of the recently introduced "performance
offenders".
Andre'
--
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)
Index: insettext.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettext.C,v
retrieving revision 1.422
diff -u -p -r1.422 insettext.C
--- insettext.C 10 Jul 2003 14:44:13 -0000 1.422
+++ insettext.C 14 Jul 2003 13:42:35 -0000
@@ -274,10 +274,10 @@ void InsetText::read(Buffer const * buf,
void InsetText::metrics(MetricsInfo & mi, Dimension & dim) const
{
BufferView * bv = mi.base.bv;
- LyXText * text = getLyXText(bv);
- dim.asc = text->rows().begin()->ascent_of_text() + TEXT_TO_INSET_OFFSET;
- dim.des = text->height - dim.asc + TEXT_TO_INSET_OFFSET;
- dim.wid = max(textWidth(bv), int(text->width)) + 2 * TEXT_TO_INSET_OFFSET;
+ setViewCache(bv);
+ dim.asc = text_.rows().begin()->ascent_of_text() + TEXT_TO_INSET_OFFSET;
+ dim.des = text_.height - dim.asc + TEXT_TO_INSET_OFFSET;
+ dim.wid = max(textWidth(bv), int(text_.width)) + 2 * TEXT_TO_INSET_OFFSET;
dim.wid = max(dim.wid, 10);
dim_ = dim;
}
@@ -1938,15 +1938,13 @@ int InsetText::cix(BufferView * bv) cons
int InsetText::cy(BufferView * bv) const
{
- LyXFont font;
- return text_.cursor.y() - ascent(bv, font) + TEXT_TO_INSET_OFFSET;
+ return text_.cursor.y() - dim_.asc + TEXT_TO_INSET_OFFSET;
}
int InsetText::ciy(BufferView * bv) const
{
- LyXFont font;
- return text_.cursor.iy() - ascent(bv, font) + TEXT_TO_INSET_OFFSET;
+ return text_.cursor.iy() - dim_.asc + TEXT_TO_INSET_OFFSET;
}