Fix wrong indentation on screen.

LyX fails to indent on screen a standard paragraph when it is
nested into an environment. The fix is a one-liner but the diff
is larger because it also fixes a previous wrong indentantion
in the source ;)
This commit is contained in:
Enrico Forestieri 2014-05-21 21:47:01 +02:00
parent 27e0bf54f5
commit a17710e499

View File

@ -1909,10 +1909,11 @@ int TextMetrics::leftMargin(int max_width,
// This happens after sections or environments in standard classes. // This happens after sections or environments in standard classes.
// We have to check the previous layout at same depth. // We have to check the previous layout at same depth.
if (tclass.isDefaultLayout(par.layout()) && pit > 0) { if (tclass.isDefaultLayout(par.layout()) && pit > 0
pit_type prev = text_->depthHook(pit, par.getDepth()); && pars[pit - 1].getDepth() >= par.getDepth()) {
if (pars[prev < pit ? prev : pit - 1].layout().nextnoindent) pit_type prev = text_->depthHook(pit, par.getDepth());
parindent.erase(); if (pars[prev < pit ? prev : pit - 1].layout().nextnoindent)
parindent.erase();
} }
FontInfo const labelfont = text_->labelFont(par); FontInfo const labelfont = text_->labelFont(par);