GoTo dialogs: Restrict input values to existing pages

This commit is contained in:
Felix Kauselmann
2021-07-06 10:27:24 +02:00
parent 54b9952253
commit df32cf01fb
3 changed files with 9 additions and 13 deletions

View File

@ -109,8 +109,10 @@ void GoToFlowToolBar::setTop(int numPages)
void GoToFlowToolBar::goTo()
{
if (edit->text().toInt() != 0)
emit(goTo(edit->text().toInt() - 1));
unsigned int page = edit->text().toInt();
if (page >= 1 && page <= v->top()) {
emit(goTo(page - 1));
}
}
void GoToFlowToolBar::centerSlide()