Applied patch for Forty, print patch and wxHTML book patch
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14465 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -439,6 +439,25 @@ static wxString SafeFileName(const wxString& s)
|
||||
return res;
|
||||
}
|
||||
|
||||
bool wxHtmlHelpData::AlreadyHasBook(wxHtmlBookRecord * bookr)
|
||||
{
|
||||
size_t bookCount = m_BookRecords.GetCount();
|
||||
if (bookCount == 0) return FALSE ;
|
||||
|
||||
wxHtmlBookRecord currentBook(wxEmptyString,wxEmptyString,wxEmptyString);
|
||||
size_t i;
|
||||
for (i=0; i<bookCount; i++)
|
||||
{
|
||||
currentBook = m_BookRecords.Item(i) ;
|
||||
if (currentBook.GetBasePath().IsSameAs(bookr->GetBasePath()) &&
|
||||
currentBook.GetTitle().IsSameAs(bookr->GetTitle()) &&
|
||||
currentBook.GetStart().IsSameAs(bookr->GetStart()) )
|
||||
return TRUE ;
|
||||
|
||||
}
|
||||
return FALSE ;
|
||||
}
|
||||
|
||||
bool wxHtmlHelpData::AddBookParam(const wxFSFile& bookfile,
|
||||
wxFontEncoding encoding,
|
||||
const wxString& title, const wxString& contfile,
|
||||
@@ -456,7 +475,9 @@ bool wxHtmlHelpData::AddBookParam(const wxFSFile& bookfile,
|
||||
fsys.ChangePathTo(path, TRUE);
|
||||
|
||||
bookr = new wxHtmlBookRecord(fsys.GetPath(), title, deftopic);
|
||||
|
||||
// return TRUE to indicate book is loaded
|
||||
if (AlreadyHasBook(bookr)) return TRUE ;
|
||||
|
||||
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;
|
||||
|
Reference in New Issue
Block a user