some fixes in names of cached helpbooks (does not contain # or : anymore)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5667 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2000-01-26 00:49:52 +00:00
parent ecacdf8fc5
commit 29e6059738

View File

@@ -394,6 +394,17 @@ void wxHtmlHelpData::SetTempDir(const wxString& path)
}
static wxString SafeFileName(const wxString& s)
{
wxString res(s);
res.Replace(wxT("#"), wxT("_"));
res.Replace(wxT(":"), wxT("_"));
res.Replace(wxT("\\"), wxT("_"));
res.Replace(wxT("/"), wxT("_"));
return res;
}
bool wxHtmlHelpData::AddBookParam(const wxFSFile& bookfile,
wxFontEncoding encoding,
const wxString& title, const wxString& contfile,
@@ -446,7 +457,7 @@ bool wxHtmlHelpData::AddBookParam(const wxFSFile& bookfile,
if (m_TempPath != wxEmptyString)
{
wxFileOutputStream *outs = new wxFileOutputStream(m_TempPath +
wxFileNameFromPath(bookfile.GetLocation()) + wxT(".cached"));
SafeFileName(wxFileNameFromPath(bookfile.GetLocation())) + wxT(".cached"));
SaveCachedBook(bookr, outs);
delete outs;
}