cnt = m_BookRecords.GetCount();
for (i = 0; i < cnt; i++)
{
- f = fsys.OpenFile(m_BookRecords[i].GetBasePath() + x);
+ f = fsys.OpenFile(wxAddBasePath(m_BookRecords[i].GetBasePath(), x));
if (f)
{
- url = m_BookRecords[i].GetBasePath() + x;
+ url = wxAddBasePath(m_BookRecords[i].GetBasePath(), x);
delete f;
return url;
}
{
if (m_BookRecords[i].GetTitle() == x)
{
- url = m_BookRecords[i].GetBasePath() + m_BookRecords[i].GetStart();
+ url = wxAddBasePath(m_BookRecords[i].GetBasePath(), m_BookRecords[i].GetStart());
return url;
}
}
{
if (wxStrcmp(m_Contents[i].m_Name, x) == 0)
{
- url = m_Contents[i].m_Book->GetBasePath() + m_Contents[i].m_Page;
+ url = wxAddBasePath(m_Contents[i].m_Book->GetBasePath(), m_Contents[i].m_Page);
return url;
}
}
{
if (wxStrcmp(m_Index[i].m_Name, x) == 0)
{
- url = m_Index[i].m_Book->GetBasePath() + m_Index[i].m_Page;
+ url = wxAddBasePath(m_Index[i].m_Book->GetBasePath(), m_Index[i].m_Page);
return url;
}
}
{
if (m_Contents[i].m_ID == id)
{
- url = m_Contents[i].m_Book->GetBasePath() + m_Contents[i].m_Page;
+ url = wxAddBasePath(m_Contents[i].m_Book->GetBasePath(), m_Contents[i].m_Page);
return url;
}
}
else m_LastPage = thepage;
wxFileSystem fsys;
- file = fsys.OpenFile(m_Data->m_Contents[i].m_Book->GetBasePath() + thepage);
+ file = fsys.OpenFile(wxAddBasePath(m_Data->m_Contents[i].m_Book->GetBasePath(), thepage));
if (file)
{
if (m_Engine.Scan(file->GetStream())) {
return found;
}
+// Utility function
+wxString wxAddBasePath(const wxString& basePath, const wxString& path)
+{
+ if (wxIsAbsolutePath(path))
+ return path;
+ else
+ return basePath + path;
+}
m_Cfg.navig_on = TRUE;
}
m_NavigPan->SetSelection(0);
+ if (m_Data->GetBookRecArray().GetCount() > 0)
+ {
+ wxHtmlBookRecord& book = m_Data->GetBookRecArray()[0];
+ if (!book.GetStart().IsEmpty())
+ m_HtmlWin->LoadPage(wxAddBasePath(book.GetBasePath(), book.GetStart()));
+ }
return TRUE;
}
m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos);
}
m_NavigPan->SetSelection(1);
+ if (m_Data->GetBookRecArray().GetCount() > 0)
+ {
+ wxHtmlBookRecord& book = m_Data->GetBookRecArray()[0];
+ if (!book.GetStart().IsEmpty())
+ m_HtmlWin->LoadPage(wxAddBasePath(book.GetBasePath(), book.GetStart()));
+ }
return TRUE;
}
wxHtmlContentsItem *it = (wxHtmlContentsItem*) m_SearchList->GetClientData(0);
if (it)
{
- m_HtmlWin->LoadPage(it->m_Book->GetBasePath() + it->m_Page);
+ m_HtmlWin->LoadPage(wxAddBasePath(it->m_Book->GetBasePath(), it->m_Page));
NotifyPageChanged();
}
}
roots[it->m_Level + 1] = m_ContentsBox->AppendItem(
roots[it->m_Level], it->m_Name, IMG_Page, -1,
new wxHtmlHelpTreeItemData(i));
- m_PagesHash->Put(it->m_Book->GetBasePath() + it->m_Page,
+ m_PagesHash->Put(wxAddBasePath(it->m_Book->GetBasePath(), it->m_Page),
new wxHtmlHelpHashData(i, roots[it->m_Level + 1]));
if (it->m_Level == 0)
wxHtmlContentsItem *it = m_Data->GetContents() + (ha->m_Index - 1);
if (it->m_Page[0] != 0)
{
- m_HtmlWin->LoadPage(it->m_Book->GetBasePath() + it->m_Page);
+ m_HtmlWin->LoadPage(wxAddBasePath(it->m_Book->GetBasePath(), it->m_Page));
NotifyPageChanged();
}
}
{
if (it->m_Page[0] != 0)
{
- m_HtmlWin->LoadPage(it->m_Book->GetBasePath() + it->m_Page);
+ m_HtmlWin->LoadPage(wxAddBasePath(it->m_Book->GetBasePath(), it->m_Page));
NotifyPageChanged();
}
}
{
wxHtmlContentsItem *it = m_Data->GetContents() + (ha->m_Index + 1);
- while (it->m_Book->GetBasePath() + it->m_Page == adr) it++;
+ while (wxAddBasePath(it->m_Book->GetBasePath(), it->m_Page) == adr) it++;
if (it->m_Page[0] != 0)
{
- m_HtmlWin->LoadPage(it->m_Book->GetBasePath() + it->m_Page);
+ m_HtmlWin->LoadPage(wxAddBasePath(it->m_Book->GetBasePath(), it->m_Page));
NotifyPageChanged();
}
}
it = m_Data->GetContents() + (pg->m_Id);
m_UpdateContents = FALSE;
if (it->m_Page[0] != 0)
- m_HtmlWin->LoadPage(it->m_Book->GetBasePath() + it->m_Page);
+ m_HtmlWin->LoadPage(wxAddBasePath(it->m_Book->GetBasePath(), it->m_Page));
m_UpdateContents = TRUE;
}
}
{
wxHtmlContentsItem *it = (wxHtmlContentsItem*) m_IndexList->GetClientData(m_IndexList->GetSelection());
if (it->m_Page[0] != 0)
- m_HtmlWin->LoadPage(it->m_Book->GetBasePath() + it->m_Page);
+ m_HtmlWin->LoadPage(wxAddBasePath(it->m_Book->GetBasePath(), it->m_Page));
NotifyPageChanged();
}
if (first)
{
if (index[i].m_Page[0] != 0)
- m_HtmlWin->LoadPage(index[i].m_Book->GetBasePath() + index[i].m_Page);
+ m_HtmlWin->LoadPage(wxAddBasePath(index[i].m_Book->GetBasePath(), index[i].m_Page));
NotifyPageChanged();
first = FALSE;
}
if (first)
{
if (index[i].m_Page[0] != 0)
- m_HtmlWin->LoadPage(index[i].m_Book->GetBasePath() + index[i].m_Page);
+ m_HtmlWin->LoadPage(wxAddBasePath(index[i].m_Book->GetBasePath(), index[i].m_Page));
NotifyPageChanged();
first = FALSE;
}
if (it)
{
if (it->m_Page[0] != 0)
- m_HtmlWin->LoadPage(it->m_Book->GetBasePath() + it->m_Page);
+ m_HtmlWin->LoadPage(wxAddBasePath(it->m_Book->GetBasePath(), it->m_Page));
NotifyPageChanged();
}
}