]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insettext.C
Clean up InsetGraphics::Cache and rename as GraphicsInset.
[lyx.git] / src / insets / insettext.C
index c7c3b74f28f7f0ec9bf3980f8166b65dd5ee14ea..6f68e04604e47037f74738eb662a7107c0ae2122 100644 (file)
@@ -224,7 +224,7 @@ void InsetText::clear(bool just_mark_erased)
 }
 
 
-Inset * InsetText::clone(Buffer const &) const
+Inset * InsetText::clone() const
 {
        return new InsetText(*this);
 }
@@ -293,15 +293,14 @@ void InsetText::read(Buffer const * buf, LyXLex & lex)
 }
 
 
-void InsetText::dimension(BufferView * bv, LyXFont const &,
-       Dimension & dim) const
+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;
        dim.wid = max(dim.wid, 10);
-       // cache it
        dim_ = dim;
 }
 
@@ -336,9 +335,6 @@ void InsetText::draw(PainterInfo & pi, int x, int baseline) const
        BufferView * bv = pi.base.bv;
        Painter & pain = pi.pain;
 
-       // call this method so that dim_ has the right value
-       dimension(bv, pi.base.font, dim_);
-
        // repaint the background if needed
        if (backgroundColor() != LColor::background)
                clearInset(bv, start_x + TEXT_TO_INSET_OFFSET, baseline);