From: Juergen Spitzmueller Date: Sat, 13 Jan 2018 08:59:09 +0000 (+0100) Subject: Fix loop while separating X-Git-Tag: lyx-2.4.0dev-acb2ca7b~4026 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=bceaa7f92971f62014da43557815479d40adf551;hp=2ba00ecb7bf00b5f6a22f2f6ae23c4c9127e8a93;p=lyx.git Fix loop while separating getMaxDepthAfter() gives wrong result here. Fixes: #10979 Signed-off-by: Juergen Spitzmueller --- diff --git a/src/Text3.cpp b/src/Text3.cpp index 7aa10a6ed3..f4190d2e95 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -1601,9 +1601,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); }