Commit 56e1002a authored by Pino Toscano's avatar Pino Toscano
Browse files

djvu: try to extract "line" text blocks if there are no "word" ones

documents could have no word precision, so we could make a try in using line blocks
(leave the "char" extraction still there and commented)
parent 9dab4693
......@@ -240,13 +240,14 @@ QVariant DjVuGenerator::metaData( const QString &key, const QVariant &option ) c
Okular::TextPage* DjVuGenerator::textPage( Okular::Page *page )
{
userMutex()->lock();
QList<KDjVu::TextEntity> te;
#if 0
QList<KDjVu::TextEntity> te = m_djvu->textEntities( page->number(), "char" );
m_djvu->textEntities( page->number(), "char" );
#endif
if ( te.isEmpty() )
te = m_djvu->textEntities( page->number(), "word" );
#else
QList<KDjVu::TextEntity> te = m_djvu->textEntities( page->number(), "word" );
#endif
if ( te.isEmpty() )
te = m_djvu->textEntities( page->number(), "line" );
userMutex()->unlock();
QList<KDjVu::TextEntity>::ConstIterator it = te.constBegin();
QList<KDjVu::TextEntity>::ConstIterator itEnd = te.constEnd();
......
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