From 8d184505248950efa5cf6ee005d7d661245be19f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Karsten=20Ball=C3=BCder?= Date: Wed, 21 Jul 1999 13:50:47 +0000 Subject: [PATCH] Suppressed a spurious error message, now contents are looked for in entry with help-id 0 and if not found a homemade list of contents is presented. :-) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3071 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/helphtml.cpp | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/generic/helphtml.cpp b/src/generic/helphtml.cpp index cabeb9a825..06a69ad4b0 100644 --- a/src/generic/helphtml.cpp +++ b/src/generic/helphtml.cpp @@ -38,6 +38,8 @@ #include #endif +#define CONTENTS_ID 0 + class wxExtHelpMapEntry : public wxObject { public: @@ -198,11 +200,26 @@ wxHTMLHelpControllerBase::DisplayContents() if(! m_NumOfEntries) return FALSE; - // use ID 0 for contents - if(! DisplaySection(0)) - return KeywordSearch(""); - else - return TRUE; + wxString contents; + wxNode *node = m_MapList->First(); + wxExtHelpMapEntry *entry; + while(node) + { + entry = (wxExtHelpMapEntry *)node->Data(); + if(entry->id == CONTENTS_ID) + { + contents = entry->url; + break; + } + node = node->Next(); + } + + bool rc = FALSE; + if(contents.Length() && wxFileExists(contents.BeforeLast('#'))) + rc = DisplaySection(CONTENTS_ID); + + // if not found, open homemade toc: + return rc ? TRUE : KeywordSearch(""); } bool -- 2.45.2