+2005-12-08 Georg Baum <Georg.Baum@post.rwth-aachen.de>
+
+ * text.C (redoParagraph): honor inset->noFontChange()
+ * rowpainter.C (paintInset): ditto
+
2005-12-15 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* lyx_main.C (priv_exec): don't initialize Math on startup
+2005-12-12 Georg Baum <Georg.Baum@post.rwth-aachen.de>
+
+ * insetbase.h (noFontChange): refine documentation
+
2005-12-16 Martin Vermeer <martin.vermeer@hut.fi>
* insetcollapsable.C: fix "turds" when changing openinlined_
virtual mode_type currentMode() const { return UNDECIDED_MODE; }
/// returns whether this inset is allowed in other insets of given mode
virtual bool allowedIn(mode_type) const { return true; }
- /// is this inset allowed within a font change?
+ /**
+ * Is this inset allowed within a font change?
+ *
+ * FIXME: noFontChange means currently that the font change is closed
+ * in LaTeX before the inset, and that the contents of the inset
+ * will be in default font. This should be changed so that the inset
+ * changes the font again.
+ */
virtual bool noFontChange() const { return false; }
/// mark the inset as erased or not
InsetBase const * inset = par_.getInset(pos);
BOOST_ASSERT(inset);
PainterInfo pi(const_cast<BufferView *>(&bv_), pain_);
- pi.base.font = font;
+ // FIXME: We should always use font, see documentation of
+ // noFontChange() in insetbase.h.
+ pi.base.font = inset->noFontChange() ?
+ bv_.buffer()->params().getLyXTextClass().defaultfont() :
+ font;
pi.ltr_pos = (text_.bidi.level(pos) % 2 == 0);
pi.erased_ = erased_ || isDeletedText(par_, pos);
theCoords.insets().add(inset, int(x_), yo_);
}
// redo insets
+ // FIXME: We should always use getFont(), see documentation of
+ // noFontChange() in insetbase.h.
+ LyXFont const tclassfont =
+ bv()->buffer()->params().getLyXTextClass().defaultfont();
InsetList::iterator ii = par.insetlist.begin();
InsetList::iterator iend = par.insetlist.end();
for (; ii != iend; ++ii) {
Dimension dim;
int const w = maxwidth_ - leftMargin(pit, ii->pos) - rightMargin(par);
- MetricsInfo mi(bv(), getFont(par, ii->pos), w);
+ LyXFont const & font = ii->inset->noFontChange() ?
+ tclassfont :
+ getFont(par, ii->pos);
+ MetricsInfo mi(bv(), font, w);
ii->inset->metrics(mi, dim);
}