// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
m_ContentsBox = new wxTreeCtrl(dummy, wxID_HTML_TREECTRL,
wxDefaultPosition, wxDefaultSize,
m_ContentsBox = new wxTreeCtrl(dummy, wxID_HTML_TREECTRL,
wxDefaultPosition, wxDefaultSize,
wxDefaultPosition, wxDefaultSize,
wxTE_PROCESS_ENTER);
m_SearchChoice = new wxChoice(dummy, wxID_HTML_SEARCHCHOICE,
wxDefaultPosition, wxDefaultSize,
wxTE_PROCESS_ENTER);
m_SearchChoice = new wxChoice(dummy, wxID_HTML_SEARCHCHOICE,
m_SearchCaseSensitive = new wxCheckBox(dummy, wxID_ANY, _("Case sensitive"));
m_SearchWholeWords = new wxCheckBox(dummy, wxID_ANY, _("Whole words only"));
m_SearchButton = new wxButton(dummy, wxID_HTML_SEARCHBUTTON, _("Search"));
m_SearchCaseSensitive = new wxCheckBox(dummy, wxID_ANY, _("Case sensitive"));
m_SearchWholeWords = new wxCheckBox(dummy, wxID_ANY, _("Whole words only"));
m_SearchButton = new wxButton(dummy, wxID_HTML_SEARCHBUTTON, _("Search"));
const int MAX_ROOTS = 64;
wxTreeItemId roots[MAX_ROOTS];
// VS: this array holds information about whether we've set item icon at
const int MAX_ROOTS = 64;
wxTreeItemId roots[MAX_ROOTS];
// VS: this array holds information about whether we've set item icon at
// and there's no way of recognizing if some item has subitems or not.
// We set the icon later: when we find an item with level=n, we know
// and there's no way of recognizing if some item has subitems or not.
// We set the icon later: when we find an item with level=n, we know
{
if (m_hfStyle & wxHF_MERGE_BOOKS)
// VS: we don't want book nodes, books' content should
{
if (m_hfStyle & wxHF_MERGE_BOOKS)
// VS: we don't want book nodes, books' content should
m_PagesHash->Put(it->GetFullPath(),
new wxHtmlHelpHashData(i, roots[it->level + 1]));
m_PagesHash->Put(it->GetFullPath(),
new wxHtmlHelpHashData(i, roots[it->level + 1]));
-static void SetFontsToHtmlWin(wxHtmlWindow *win, wxString scalf, wxString fixf, int size)
+static void SetFontsToHtmlWin(wxHtmlWindow *win, const wxString& scalf, const wxString& fixf, int size)
- wxString an = m_HtmlWin->GetOpenedAnchor();
- wxHtmlHelpHashData *ha;
- if (an.IsEmpty())
- ha = (wxHtmlHelpHashData*) m_PagesHash->Get(m_HtmlWin->GetOpenedPage());
- else
- ha = (wxHtmlHelpHashData*) m_PagesHash->Get(m_HtmlWin->GetOpenedPage() + wxT("#") + an);
+ wxString page = wxHtmlHelpHtmlWindow::GetOpenedPageWithAnchor(m_HtmlWin);
+ wxHtmlHelpHashData *ha = NULL;
+ if (!page.empty())
+ ha = (wxHtmlHelpHashData*) m_PagesHash->Get(page);
+
- wxString an = m_HtmlWin->GetOpenedAnchor();
- wxHtmlHelpHashData *ha;
- if (an.IsEmpty())
- ha = (wxHtmlHelpHashData*) m_PagesHash->Get(m_HtmlWin->GetOpenedPage());
- else
- ha = (wxHtmlHelpHashData*) m_PagesHash->Get(m_HtmlWin->GetOpenedPage() + wxT("#") + an);
+ wxString page = wxHtmlHelpHtmlWindow::GetOpenedPageWithAnchor(m_HtmlWin);
+ wxHtmlHelpHashData *ha = NULL;
+ if (!page.empty())
+ ha = (wxHtmlHelpHashData*) m_PagesHash->Get(page);
if (ha && ha->m_Index > 0)
{
const wxHtmlHelpDataItem& it = m_Data->GetContentsArray()[ha->m_Index - 1];
if (ha && ha->m_Index > 0)
{
const wxHtmlHelpDataItem& it = m_Data->GetContentsArray()[ha->m_Index - 1];
- wxString an = m_HtmlWin->GetOpenedAnchor();
- wxHtmlHelpHashData *ha;
- if (an.IsEmpty())
- ha = (wxHtmlHelpHashData*) m_PagesHash->Get(m_HtmlWin->GetOpenedPage());
- else
- ha = (wxHtmlHelpHashData*) m_PagesHash->Get(m_HtmlWin->GetOpenedPage() + wxT("#") + an);
+ wxString page = wxHtmlHelpHtmlWindow::GetOpenedPageWithAnchor(m_HtmlWin);
+ wxHtmlHelpHashData *ha = NULL;
+ if (!page.empty())
+ ha = (wxHtmlHelpHashData*) m_PagesHash->Get(page);
- wxString an = m_HtmlWin->GetOpenedAnchor();
- wxString adr;
- wxHtmlHelpHashData *ha;
-
- if (an.IsEmpty()) adr = m_HtmlWin->GetOpenedPage();
- else adr = m_HtmlWin->GetOpenedPage() + wxT("#") + an;
-
- ha = (wxHtmlHelpHashData*) m_PagesHash->Get(adr);
+ wxString page = wxHtmlHelpHtmlWindow::GetOpenedPageWithAnchor(m_HtmlWin);
+ wxHtmlHelpHashData *ha = NULL;
+ if (!page.empty())
+ ha = (wxHtmlHelpHashData*) m_PagesHash->Get(page);
const wxHtmlHelpDataItems& contents = m_Data->GetContentsArray();
if (ha && ha->m_Index < (int)contents.size() - 1)
{
size_t idx = ha->m_Index + 1;
const wxHtmlHelpDataItems& contents = m_Data->GetContentsArray();
if (ha && ha->m_Index < (int)contents.size() - 1)
{
size_t idx = ha->m_Index + 1;