X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4fd5055c0d0b4f94fdf88fbddb54439f18b06f10..e7300ec6d9ebbd1cfa2fcf12c0ce6e5aee85a152:/src/html/helpdata.cpp diff --git a/src/html/helpdata.cpp b/src/html/helpdata.cpp index 9c2fe51130..44392854d3 100644 --- a/src/html/helpdata.cpp +++ b/src/html/helpdata.cpp @@ -452,11 +452,18 @@ bool wxHtmlHelpData::AddBookParam(const wxFSFile& bookfile, int IndexOld = m_IndexCnt, ContentsOld = m_ContentsCnt; - if (! path.IsEmpty()) + if (!path.IsEmpty()) fsys.ChangePathTo(path, TRUE); - bookr = new wxHtmlBookRecord(fsys.GetPath(), title, deftopic); + size_t booksCnt = m_BookRecords.GetCount(); + for (size_t i = 0; i < booksCnt; i++) + { + if ( m_BookRecords[i].GetBookFile() == bookfile.GetLocation() ) + return TRUE; // book is (was) loaded + } + bookr = new wxHtmlBookRecord(bookfile.GetLocation(), fsys.GetPath(), title, deftopic); + if (m_ContentsCnt % wxHTML_REALLOC_STEP == 0) m_Contents = (wxHtmlContentsItem*) realloc(m_Contents, (m_ContentsCnt + wxHTML_REALLOC_STEP) * sizeof(wxHtmlContentsItem)); m_Contents[m_ContentsCnt].m_Level = 0; @@ -611,7 +618,7 @@ bool wxHtmlHelpData::AddBook(const wxString& book) wxFontEncoding enc; if (charset == wxEmptyString) enc = wxFONTENCODING_SYSTEM; - else enc = wxTheFontMapper->CharsetToEncoding(charset); + else enc = wxFontMapper::Get()->CharsetToEncoding(charset); bool rtval = AddBookParam(*fi, enc, title, contents, index, start, fsys.GetPath()); delete fi;