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
This commit is contained in:
Harco de Hilster 1999-08-31 23:26:36 +00:00
parent 5ca24bf4e0
commit 6245e5b6e8

View File

@ -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
#endif