diff --git a/src/Text.cpp b/src/Text.cpp index 820b755511..45033a3bbf 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -6901,10 +6901,18 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd, case LFUN_OUTLINE_UP: case LFUN_OUTLINE_DOWN: - case LFUN_OUTLINE_IN: - case LFUN_OUTLINE_OUT: enable = cur.text()->getTocLevel(cur.pit()) != Layout::NOT_IN_TOC; break; + case LFUN_OUTLINE_IN: + enable = cur.text()->getTocLevel(cur.pit()) != Layout::NOT_IN_TOC + && cur.text()->getTocLevel(cur.pit()) != + cur.buffer()->params().documentClass().max_toclevel(); + break; + case LFUN_OUTLINE_OUT: + enable = cur.text()->getTocLevel(cur.pit()) != Layout::NOT_IN_TOC + && cur.text()->getTocLevel(cur.pit()) != + cur.buffer()->params().documentClass().min_toclevel(); + break; case LFUN_NEWLINE_INSERT: // LaTeX restrictions (labels or empty par)