]> git.lyx.org Git - lyx.git/commitdiff
Fix loop while separating
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 13 Jan 2018 08:59:09 +0000 (09:59 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sat, 13 Jan 2018 08:59:09 +0000 (09:59 +0100)
getMaxDepthAfter() gives wrong result here.

Fixes: #10979
Signed-off-by: Juergen Spitzmueller <spitz@lyx.org>
src/Text3.cpp

index 7aa10a6ed3c514bd89cc7560d53e60a686093a61..f4190d2e95cb2e0c0dcc2dc3b559c9c7969d95b3 100644 (file)
@@ -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);
                }