Skip to content

Commit

Permalink
Fix "unlink views" when the document is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
fagu committed May 25, 2023
1 parent 78558fc commit 4585220
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,8 @@ void MainWindow::setLinkedPages(bool on) {
if (m_views_linked) {
// Try to keep the focused view the same and change other views.
// This might be impossible if there are too few pages before or after the focused page.
showPages(assign_pages_linked_fixing_one_view(doc->pages().size(), focused_view, page_numbers[focused_view]), focused_view);
if (focused_view != -1)
showPages(assign_pages_linked_fixing_one_view(doc->pages().size(), focused_view, page_numbers[focused_view]), focused_view);
} else {
// Try to keep everything as is, but display the last page in all empty views, assuming the document is nonempty.
std::array<int, 2> res = page_numbers;
Expand Down

0 comments on commit 4585220

Please sign in to comment.