1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-04 02:09:35 +02:00

fixed hyphenations after book info editing; fixed possible NPE in library

This commit is contained in:
Nikolay Pultsin 2011-01-03 13:41:26 +00:00
parent d163878097
commit aac0fc50d1
9 changed files with 53 additions and 20 deletions

View file

@ -128,6 +128,7 @@ public final class SQLiteBooksDatabase extends BooksDatabase {
return new Date(cursor.getLong(index));
}
@Override
protected Book loadBook(long bookId) {
Book book = null;
final Cursor cursor = myDatabase.rawQuery("SELECT file_id,title,encoding,language FROM Books WHERE book_id = " + bookId, null);
@ -140,6 +141,17 @@ public final class SQLiteBooksDatabase extends BooksDatabase {
return book;
}
@Override
protected void reloadBook(Book book) {
final Cursor cursor = myDatabase.rawQuery("SELECT title,encoding,language FROM Books WHERE book_id = " + book.getId(), null);
if (cursor.moveToNext()) {
book.setTitle(cursor.getString(0));
book.setEncoding(cursor.getString(1));
book.setLanguage(cursor.getString(2));
}
cursor.close();
}
protected Book loadBookByFile(long fileId, ZLFile file) {
if (fileId == -1) {
return null;