From: Juergen Spitzmueller Date: Sat, 13 Jan 2018 08:59:09 +0000 (+0100) Subject: Fix loop while separating X-Git-Tag: 2.3.0rc2~68 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=9b603d90c8611aba2326f1e5ef40f880692cb68f;p=features.git Fix loop while separating getMaxDepthAfter() gives wrong result here. Fixes: #10979 Signed-off-by: Juergen Spitzmueller (cherry picked from commit bceaa7f92971f62014da43557815479d40adf551) --- diff --git a/src/Text3.cpp b/src/Text3.cpp index 0eebbc0266..777f79fe47 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -1555,9 +1555,9 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) if ((outer || normal) && nextpar_depth > 0) { // restore nesting of following paragraph DocIterator scur = cur; - depth_type const max_depth = cur.paragraph().getMaxDepthAfter(); + depth_type const max_depth = cur.paragraph().params().depth() + 1; cur.forwardPar(); - while (cur.paragraph().params().depth() <= min(nextpar_depth, max_depth)) + while (cur.paragraph().params().depth() < min(nextpar_depth, max_depth)) lyx::dispatch(FuncRequest(LFUN_DEPTH_INCREMENT)); cur.setCursor(scur); }