X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4fd5055c0d0b4f94fdf88fbddb54439f18b06f10..ad42b67c35ddcf8df2075ab582c9b64525756d09:/src/html/helpdata.cpp?ds=sidebyside diff --git a/src/html/helpdata.cpp b/src/html/helpdata.cpp index 9c2fe51130..312857dedf 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;