Handle 0 pages-per-row

This commit is contained in:
Moritz Lipp 2011-04-25 16:54:21 +02:00
parent 4146cfbb84
commit 9f5430e449

View file

@ -335,6 +335,11 @@ error_out:
void void
page_view_set_mode(zathura_t* zathura, unsigned int pages_per_row) page_view_set_mode(zathura_t* zathura, unsigned int pages_per_row)
{ {
/* show at least one page */
if (pages_per_row == 0) {
pages_per_row = 1;
}
gtk_table_resize(GTK_TABLE(zathura->ui.page_view), zathura->document->number_of_pages / pages_per_row + 1, pages_per_row); gtk_table_resize(GTK_TABLE(zathura->ui.page_view), zathura->document->number_of_pages / pages_per_row + 1, pages_per_row);
for (unsigned int i = 0; i < zathura->document->number_of_pages; i++) for (unsigned int i = 0; i < zathura->document->number_of_pages; i++)
{ {