added wxHtmlHelpController::AddBook(wxFileName)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18118 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -84,6 +84,11 @@ void wxHtmlHelpController::SetTitleFormat(const wxString& title)
|
||||
}
|
||||
|
||||
|
||||
bool wxHtmlHelpController::AddBook(const wxFileName& book_file, bool show_wait_msg)
|
||||
{
|
||||
return AddBook(wxFileSystem::FileNameToURL(book_file), show_wait_msg);
|
||||
}
|
||||
|
||||
bool wxHtmlHelpController::AddBook(const wxString& book, bool show_wait_msg)
|
||||
{
|
||||
wxBusyCursor cur;
|
||||
@@ -186,7 +191,7 @@ bool wxHtmlHelpController::Initialize(const wxString& file)
|
||||
}
|
||||
}
|
||||
|
||||
return AddBook(actualFilename);
|
||||
return AddBook(wxFileName(actualFilename));
|
||||
}
|
||||
|
||||
bool wxHtmlHelpController::LoadFile(const wxString& WXUNUSED(file))
|
||||
|
||||
@@ -570,7 +570,6 @@ bool wxHtmlHelpData::AddBook(const wxString& book)
|
||||
{
|
||||
wxFSFile *fi;
|
||||
wxFileSystem fsys;
|
||||
wxString bookFull;
|
||||
|
||||
wxString title = _("noname"),
|
||||
safetitle,
|
||||
@@ -579,23 +578,13 @@ bool wxHtmlHelpData::AddBook(const wxString& book)
|
||||
index = wxEmptyString,
|
||||
charset = wxEmptyString;
|
||||
|
||||
#if defined(__WXMAC__) && !defined(__DARWIN__)
|
||||
if (wxIsAbsolutePath(book)) bookFull = book;
|
||||
else bookFull = wxGetCwd() + book; // no slash or dot
|
||||
wxFileName fn( bookFull );
|
||||
bookFull = fn.GetFullPath( wxPATH_UNIX );
|
||||
#else
|
||||
if (wxIsAbsolutePath(book)) bookFull = book;
|
||||
else bookFull = wxGetCwd() + wxT("/") + book;
|
||||
#endif
|
||||
|
||||
fi = fsys.OpenFile(bookFull);
|
||||
fi = fsys.OpenFile(book);
|
||||
if (fi == NULL)
|
||||
{
|
||||
wxLogError(_("Cannot open HTML help book: %s"), bookFull.c_str());
|
||||
wxLogError(_("Cannot open HTML help book: %s"), book.c_str());
|
||||
return FALSE;
|
||||
}
|
||||
fsys.ChangePathTo(bookFull);
|
||||
fsys.ChangePathTo(book);
|
||||
|
||||
const wxChar *lineptr;
|
||||
wxChar linebuf[300];
|
||||
|
||||
Reference in New Issue
Block a user