Don't attempt to convert non-ascii strings to filenames
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58342 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -701,15 +701,29 @@ bool wxHtmlHelpData::AddBook(const wxString& book)
|
|||||||
|
|
||||||
wxString wxHtmlHelpData::FindPageByName(const wxString& x)
|
wxString wxHtmlHelpData::FindPageByName(const wxString& x)
|
||||||
{
|
{
|
||||||
int cnt;
|
|
||||||
int i;
|
int i;
|
||||||
wxFileSystem fsys;
|
|
||||||
wxFSFile *f;
|
|
||||||
|
|
||||||
// 1. try to open given file:
|
bool has_non_ascii = false;
|
||||||
cnt = m_bookRecords.GetCount();
|
wxString::const_iterator it;
|
||||||
for (i = 0; i < cnt; i++)
|
for (it = x.begin(); it != x.end(); ++it)
|
||||||
{
|
{
|
||||||
|
wxUniChar ch = *it;
|
||||||
|
if (!ch.IsAscii())
|
||||||
|
{
|
||||||
|
has_non_ascii = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int cnt = m_bookRecords.GetCount();
|
||||||
|
|
||||||
|
if (!has_non_ascii)
|
||||||
|
{
|
||||||
|
wxFileSystem fsys;
|
||||||
|
wxFSFile *f;
|
||||||
|
// 1. try to open given file:
|
||||||
|
for (i = 0; i < cnt; i++)
|
||||||
|
{
|
||||||
f = fsys.OpenFile(m_bookRecords[i].GetFullPath(x));
|
f = fsys.OpenFile(m_bookRecords[i].GetFullPath(x));
|
||||||
if (f)
|
if (f)
|
||||||
{
|
{
|
||||||
@@ -717,6 +731,7 @@ wxString wxHtmlHelpData::FindPageByName(const wxString& x)
|
|||||||
delete f;
|
delete f;
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user