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:
parent
5ca24bf4e0
commit
6245e5b6e8
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user