using lyx::support::subst;
using std::endl;
-
+using std::string;
using std::ostream;
using std::ostringstream;
Paragraph::Paragraph()
- : y(0), pimpl_(new Paragraph::Pimpl(this))
+ : y(0), height(0), pimpl_(new Paragraph::Pimpl(this))
{
- enumdepth = 0;
itemdepth = 0;
params().clear();
}
Paragraph::Paragraph(Paragraph const & lp)
- : y(0), text_(lp.text_), pimpl_(new Paragraph::Pimpl(*lp.pimpl_, this))
+ : y(0), height(0), text_(lp.text_), pimpl_(new Paragraph::Pimpl(*lp.pimpl_, this))
{
- enumdepth = 0;
itemdepth = 0;
// this is because of the dummy layout of the paragraphs that
// follow footnotes
delete pimpl_;
pimpl_ = new Pimpl(*lp.pimpl_, this);
- enumdepth = lp.enumdepth;
itemdepth = lp.itemdepth;
// this is because of the dummy layout of the paragraphs that
// follow footnotes
else
layoutfont = lout->font;
- LyXFont tmpfont = getFontSettings(bparams, pos);
- tmpfont.realize(layoutfont);
- tmpfont.realize(outerfont);
- tmpfont.realize(bparams.getLyXTextClass().defaultfont());
+ LyXFont font = getFontSettings(bparams, pos);
+ font.realize(layoutfont);
+ font.realize(outerfont);
+ font.realize(bparams.getLyXTextClass().defaultfont());
- return tmpfont;
+ return font;
}
BOOST_ASSERT(pos <= size());
// First, reduce font against layout/label font
- // Update: The SetCharFont() routine in text2.C already
+ // Update: The setCharFont() routine in text2.C already
// reduces font, so we don't need to do that here. (Asger)
// No need to simplify this because it will disappear
// in a new kernel. (Asger)
// Unroll the first two cycles of the loop
// and remember the previous character to
- // remove unnecessary GetChar() calls
+ // remove unnecessary getChar() calls
pos_type i = 0;
if (i < size() && !isNewline(i)) {
++i;
return pimpl_->inset_owner->owner()->lyxCode() == InsetOld::ERT_CODE;
return false;
}
+
+
+RowList::iterator Paragraph::getRow(pos_type pos)
+{
+ RowList::iterator rit = rows.end();
+ RowList::iterator const begin = rows.begin();
+
+ for (--rit; rit != begin && rit->pos() > pos; --rit)
+ ;
+
+ return rit;
+}