From bceaa7f92971f62014da43557815479d40adf551 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sat, 13 Jan 2018 09:59:09 +0100 Subject: [PATCH 1/1] Fix loop while separating getMaxDepthAfter() gives wrong result here. Fixes: #10979 Signed-off-by: Juergen Spitzmueller --- src/Text3.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } -- 2.39.2