- retfont = cit->font();
- else if (pos == size() && !empty())
- retfont = getFontSettings(bparams, pos - 1);
- else
- retfont = LyXFont(LyXFont::ALL_INHERIT, getParLanguage(bparams));
+ return cit->font();
+
+ if (pos == size() && !empty())
+ return getFontSettings(bparams, pos - 1);
+
+ return LyXFont(LyXFont::ALL_INHERIT, getParLanguage(bparams));
+}
+
+
+lyx::pos_type
+Paragraph::getEndPosOfFontSpan(lyx::pos_type pos) const
+{
+ Assert(pos <= size());
+
+ Pimpl::FontList::const_iterator cit = pimpl_->fontlist.begin();
+ Pimpl::FontList::const_iterator end = pimpl_->fontlist.end();
+ for (; cit != end; ++cit)
+ if (cit->pos() >= pos)
+ return cit->pos();