From a17710e4995584932fe6d1540927e58f526477f8 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Wed, 21 May 2014 21:47:01 +0200 Subject: [PATCH] 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 ;) --- src/TextMetrics.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 0be9058fa3..226f842081 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -1909,10 +1909,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); -- 2.39.5