+1/-1 when storing/loading pages

This commit is contained in:
Sebastian Ramacher 2011-10-06 18:33:23 +02:00
parent b380f6f14b
commit b843331afc
2 changed files with 3 additions and 3 deletions

View file

@ -180,7 +180,7 @@ zathura_db_set_fileinfo(zathura_database_t* db, const char* file, unsigned int p
g_return_val_if_fail(db && file, false);
static const char SQL_FILEINFO_SET[] =
"REPLACE INTO fileinfo (file, page, offset, scale) VALUES (?, ?, ?);";
"REPLACE INTO fileinfo (file, page, offset, scale) VALUES (?, ?, ?, ?);";
sqlite3_stmt* stmt = prepare_statement(db->session, SQL_FILEINFO_SET);
if (stmt == NULL) {

View file

@ -344,7 +344,7 @@ document_open(zathura_t* zathura, const char* path, const char* password)
int offset = 0;
float scale = 1.0f;
if (zathura_db_get_fileinfo(zathura->database, zathura->document->file_path, &page, &offset, &scale)) {
page_set_delayed(zathura, page);
page_set_delayed(zathura, page - 1);
zathura->document->scale = scale;
}
@ -398,7 +398,7 @@ document_close(zathura_t* zathura)
}
/* store last seen page */
zathura_db_set_fileinfo(zathura->database, zathura->document->file_path, zathura->document->current_page_number,
zathura_db_set_fileinfo(zathura->database, zathura->document->file_path, zathura->document->current_page_number + 1,
/* zathura->document->offset TODO */ 0, zathura->document->scale);
render_free(zathura->sync.render_thread);