1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-05 10:49:24 +02:00

native plugin synchronization (fixed possible crash); fixed rtf encoding reading

This commit is contained in:
Nikolay Pultsin 2012-03-23 02:46:10 +00:00
parent 3978af83ec
commit 3aa047e970
8 changed files with 24 additions and 22 deletions

View file

@ -17,7 +17,6 @@
* 02110-1301, USA.
*/
#include <ZLStringUtil.h>
#include <ZLFile.h>
#include <ZLInputStream.h>
@ -38,18 +37,21 @@ const std::string RtfPlugin::supportedFileType() const {
}
bool RtfPlugin::readMetaInfo(Book &book) const {
shared_ptr<ZLInputStream> stream = new RtfReaderStream(book.file(), 50000);
if (stream.isNull()) {
return false;
}
detectEncodingAndLanguage(book, *stream);
if (!RtfDescriptionReader(book).readDocument(book.file())) {
return false;
}
if (book.encoding().empty()) {
book.setEncoding("utf-8");
}
if (book.language().empty()) {
shared_ptr<ZLInputStream> stream = new RtfReaderStream(book.file(), 50000);
if (!stream.isNull()) {
//detectLanguage(book, *stream);
}
}
return true;
}