Get the file list from the document, instead of spoofing them from the TOC.

FIlter out files not ending with ".html", to avoid loading non-HTML contents as pages.
BUG: 183542

svn path=/trunk/KDE/kdegraphics/okular/; revision=933550
remotes/origin/KDE/4.3
Pino Toscano 17 years ago
parent c49986b62d
commit 9385f99ef2
  1. 7
      generators/chm/generator_chm.cpp

@ -105,12 +105,13 @@ bool CHMGenerator::loadDocument( const QString & fileName, QVector< Okular::Page
// fill m_urlPage and m_pageUrl
int pageNum = 0;
foreach(const LCHMParsedEntry &e, topics)
QStringList pageList;
m_file->enumerateFiles(&pageList);
foreach (const QString &url, pageList)
{
if (e.urls.isEmpty())
if (!url.toLower().endsWith(QLatin1String(".html")))
continue;
const QString &url = e.urls.first();
int pos = url.indexOf ('#');
QString tmpUrl = pos == -1 ? url : url.left(pos);

Loading…
Cancel
Save