From: Enrico Forestieri Date: Wed, 21 May 2014 21:59:53 +0000 (+0200) Subject: Fix wrong indentation on screen. X-Git-Tag: 2.1.1~47 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=956f50340144370fac4e76d4d500bbcf55e23e29;p=features.git 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 ;) No status line needed because this is an extension of f5a246b1. --- diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 9e3483932b..9635388e55 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -1905,10 +1905,11 @@ int TextMetrics::leftMargin(int max_width, // This happens after sections or environments in standard classes. // We have to check the previous layout at same depth. - if (tclass.isDefaultLayout(par.layout()) && pit > 0) { - pit_type prev = text_->depthHook(pit, par.getDepth()); - if (pars[prev < pit ? prev : pit - 1].layout().nextnoindent) - parindent.erase(); + if (tclass.isDefaultLayout(par.layout()) && pit > 0 + && pars[pit - 1].getDepth() >= par.getDepth()) { + pit_type prev = text_->depthHook(pit, par.getDepth()); + if (pars[prev < pit ? prev : pit - 1].layout().nextnoindent) + parindent.erase(); } FontInfo const labelfont = text_->labelFont(par);