l_margin += font_metrics::signedWidth(tclass.leftmargin(), tclass.defaultfont());
if (par.getDepth() != 0) {
- // find the next level paragraph
- pit_type newpar = outerHook(pit, pars_);
+ // find the next level paragraph
+ pit_type newpar = outerHook(pit, pars_);
if (newpar != pit_type(pars_.size())) {
if (pars_[newpar].layout()->isEnvironment()) {
l_margin = leftMargin(newpar);
}
}
+ // This happens after sections in standard classes. The 1.3.x
+ // code compared depths too, but it does not seem necessary
+ // (JMarc)
+ if (par.layout() == tclass.defaultLayout()
+ && pit > 0 && pars_[pit - 1].layout()->nextnoindent)
+ parindent.erase();
+
LyXFont const labelfont = getLabelFont(par);
switch (layout->margintype) {
case MARGIN_DYNAMIC:
z = row.endpos();
} while (z < par.size());
+ // Make sure that if a par ends in newline, there is one more row
+ // under it
+ // FIXME this is a dirty trick. Now the _same_ position in the
+ // paragraph occurs in _two_ different rows, and has two different
+ // display positions, leading to weird behaviour when moving up/down.
+ if (z > 0 && par.isNewline(z - 1)) {
+ Row row(z - 1);
+ row.endpos(z - 1);
+ setRowWidth(pit, row);
+ setHeightOfRow(pit, row);
+ par.rows().push_back(row);
+ dim.des += row.height();
+ }
+
dim.asc += par.rows()[0].ascent();
dim.des -= par.rows()[0].ascent();