]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetText.cpp
* src/paragraph_funcs.cpp (breakParagraph): change parameter 'flag' to
[lyx.git] / src / insets / InsetText.cpp
index 2e9a3dd4b3449681506bc3dee297b61a34a526c8..1f19ea5ad38fb9c2d8a82d2d30beb2f36e500cf2 100644 (file)
@@ -166,7 +166,7 @@ void InsetText::read(Buffer const & buf, Lexer & lex)
 }
 
 
-bool InsetText::metrics(MetricsInfo & mi, Dimension & dim) const
+void InsetText::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        TextMetrics & tm = mi.base.bv->textMetrics(&text_);
 
@@ -175,14 +175,14 @@ bool InsetText::metrics(MetricsInfo & mi, Dimension & dim) const
        // Hand font through to contained lyxtext:
        tm.font_ = mi.base.font;
        mi.base.textwidth -= 2 * TEXT_TO_INSET_OFFSET;
-       tm.metrics(mi, dim);
+       if (hasFixedWidth())
+               tm.metrics(mi, dim, mi.base.textwidth);
+       else
+               tm.metrics(mi, dim);
        mi.base.textwidth += 2 * TEXT_TO_INSET_OFFSET;
        dim.asc += TEXT_TO_INSET_OFFSET;
        dim.des += TEXT_TO_INSET_OFFSET;
        dim.wid += 2 * TEXT_TO_INSET_OFFSET;
-       bool const changed = dim_ != dim;
-       dim_ = dim;
-       return changed;
 }
 
 
@@ -191,8 +191,7 @@ void InsetText::draw(PainterInfo & pi, int x, int y) const
        TextMetrics & tm = pi.base.bv->textMetrics(&text_);
 
        if (drawFrame_ || pi.full_repaint) {
-               int const w = hasFixedWidth() ? 
-                       tm.maxWidth() : tm.width() + 2 * TEXT_TO_INSET_OFFSET;
+               int const w = tm.width() + 2 * TEXT_TO_INSET_OFFSET;
                int const yframe = y - TEXT_TO_INSET_OFFSET - tm.ascent();
                int const h = tm.height() + 2 * TEXT_TO_INSET_OFFSET;
                if (pi.full_repaint)