// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "helpdata.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
wxHtmlHelpDataItem *ia = *a;
wxHtmlHelpDataItem *ib = *b;
+ if (ia == NULL)
+ return -1;
+ if (ib == NULL)
+ return 1;
+
if (ia->parent == ib->parent)
{
return ia->name.CmpNoCase(ib->name);
}
else
{
- int cnt = 0;
+ int cnt2 = 0;
wxHtmlHelpDataItem *parent = m_index[i].parent;
for (int j = i-1; j >= 0; j--)
{
if (m_index[j].book == book && m_index[j].level > 0)
- cnt++;
+ cnt2++;
if (&m_index[j] == parent)
break;
}
- wxASSERT(cnt > 0);
- CacheWriteInt32(f, cnt);
+ wxASSERT(cnt2 > 0);
+ CacheWriteInt32(f, cnt2);
}
}
return true;
lineptr = ReadLine(lineptr, linebuf, 300);
for (wxChar *ch = linebuf; *ch != wxT('\0') && *ch != wxT('='); ch++)
- *ch = tolower(*ch);
+ *ch = (wxChar)wxTolower(*ch);
if (wxStrstr(linebuf, _T("title=")) == linebuf)
title = linebuf + wxStrlen(_T("title="));
charset = linebuf + wxStrlen(_T("charset="));
} while (lineptr != NULL);
- wxFontEncoding enc;
- if (charset == wxEmptyString) enc = wxFONTENCODING_SYSTEM;
- else enc = wxFontMapper::Get()->CharsetToEncoding(charset);
+ wxFontEncoding enc = wxFONTENCODING_SYSTEM;
+#if wxUSE_FONTMAP
+ if (charset != wxEmptyString)
+ enc = wxFontMapper::Get()->CharsetToEncoding(charset);
+#endif
bool rtval = AddBookParam(*fi, enc,
title, contents, index, start, fsys.GetPath());