From 9385f99ef2e755620d3f00e68fdbe546e4a8240b Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Sun, 1 Mar 2009 10:49:23 +0000 Subject: [PATCH] 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 --- generators/chm/generator_chm.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/generators/chm/generator_chm.cpp b/generators/chm/generator_chm.cpp index fa8fd3a77..1ff5fdebf 100644 --- a/generators/chm/generator_chm.cpp +++ b/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);