Commit 7d410b92 authored by Pino Toscano's avatar Pino Toscano

check whether the loading really suceeeded

sadly libspectre does not seem to fail in cases where it should... (bug filed)

svn path=/trunk/KDE/kdegraphics/okular/; revision=896112
parent cba63bd6
......@@ -159,6 +159,14 @@ bool GSGenerator::loadDocument( const QString & fileName, QVector< Okular::Page
m_internalDocument = spectre_document_new();
spectre_document_load(m_internalDocument, QFile::encodeName(fileName));
const SpectreStatus loadStatus = spectre_document_status(m_internalDocument);
if (loadStatus != SPECTRE_STATUS_SUCCESS)
{
kDebug(4711) << "ERR:" << spectre_status_to_string(loadStatus);
spectre_document_free(m_internalDocument);
m_internalDocument = 0;
return false;
}
pagesVector.resize( spectre_document_get_n_pages(m_internalDocument) );
kDebug(4711) << "Page count:" << pagesVector.count();
return loadPages(pagesVector);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment