- CacheWriteString(f, m_Index[i].m_Name);
- CacheWriteString(f, m_Index[i].m_Page);
+ CacheWriteString(f, m_index[i].name);
+ CacheWriteString(f, m_index[i].page);
+ CacheWriteInt32(f, m_index[i].level);
+ // save distance to parent item, if any:
+ if (m_index[i].parent == NULL)
+ {
+ CacheWriteInt32(f, 0);
+ }
+ else
+ {
+ 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)
+ cnt2++;
+ if (&m_index[j] == parent)
+ break;
+ }
+ wxASSERT(cnt2 > 0);
+ CacheWriteInt32(f, cnt2);
+ }