From: Harco de Hilster <harcoh@caos.kun.nl> Date: Tue, 31 Aug 1999 23:26:36 +0000 (+0000) Subject: change to make wxHtmlHelp more flexible; don't panic if an empty X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/6245e5b6e82a923007d9fa44b09ab274785bef2c?ds=sidebyside change to make wxHtmlHelp more flexible; don't panic if an empty index or contents filename is given git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3545 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/html/htmlhelp_io.cpp b/src/html/htmlhelp_io.cpp index 78353f4725..89f9fb1194 100644 --- a/src/html/htmlhelp_io.cpp +++ b/src/html/htmlhelp_io.cpp @@ -127,7 +127,9 @@ void wxHtmlHelpController::LoadMSProject(HtmlBookRecord *book, wxFileSystem& fsy HP_TagHandler *handler = new HP_TagHandler(book); parser.AddTagHandler(handler); - f = fsys.OpenFile(contentsfile); + // Don't panic if no index or contensfile is supplied. + // (without contents is a bit useless, but leaving out the index is sometimes handy) + f = ( contentsfile.IsEmpty() ? NULL : fsys.OpenFile(contentsfile) ); if (f) { sz = f -> GetStream() -> GetSize(); buf = new char[sz+1]; @@ -140,7 +142,7 @@ void wxHtmlHelpController::LoadMSProject(HtmlBookRecord *book, wxFileSystem& fsy delete[] buf; } - f = fsys.OpenFile(indexfile); + f = ( indexfile.IsEmpty() ? NULL : fsys.OpenFile(indexfile) ); if (f) { sz = f -> GetStream() -> GetSize(); buf = new char[sz+1]; @@ -247,4 +249,4 @@ void wxHtmlHelpController::SaveCachedBook(HtmlBookRecord *book, wxOutputStream * } } -#endif \ No newline at end of file +#endif