commit 9b603d90c8611aba2326f1e5ef40f880692cb68f
Author: Juergen Spitzmueller <[email protected]>
Date: Sat Jan 13 09:59:09 2018 +0100
Fix loop while separating
getMaxDepthAfter() gives wrong result here.
Fixes: #10979
Signed-off-by: Juergen Spitzmueller <[email protected]>
(cherry picked from commit bceaa7f92971f62014da43557815479d40adf551)
---
src/Text3.cpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Text3.cpp b/src/Text3.cpp
index 0eebbc0..777f79f 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);
}