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)
remotes/origin/KDE/4.8
Pino Toscano 15 years ago
parent 9dab469366
commit 56e1002af6
  1. 9
      generators/djvu/generator_djvu.cpp

@ -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();

Loading…
Cancel
Save