Disable OUTLINE functions when min or max toclevel is reached

This commit is contained in:
Juergen Spitzmueller 2023-10-21 13:49:50 +02:00
parent 2b33da5944
commit 8e619462e1

View File

@ -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)