- x = 0;
- for (i = 0; i < m_ContentsCnt; i++) if (m_Contents[i].m_Book == book && m_Contents[i].m_Level > 0) x++;
- x = wxINT32_SWAP_ON_BE(x);
- f -> Write(&x, sizeof(x));
- for (i = 0; i < m_ContentsCnt; i++) {
- if (m_Contents[i].m_Book != book || m_Contents[i].m_Level == 0) continue;
- x = wxINT32_SWAP_ON_BE(m_Contents[i].m_Level);
- f -> Write(&x, sizeof(x));
- x = wxINT32_SWAP_ON_BE(m_Contents[i].m_ID);
- f -> Write(&x, sizeof(x));
- x = wxINT32_SWAP_ON_BE(wxStrlen(m_Contents[i].m_Name) + 1);
- f -> Write(&x, sizeof(x));
- WRITE_STRING(f, m_Contents[i].m_Name, x);
- x = wxINT32_SWAP_ON_BE(wxStrlen(m_Contents[i].m_Page) + 1);
- f -> Write(&x, sizeof(x));
- WRITE_STRING(f, m_Contents[i].m_Page, x);
+ for (i = 0; i < m_ContentsCnt; i++)
+ {
+ if (m_Contents[i].m_Book != book || m_Contents[i].m_Level == 0)
+ continue;
+ CacheWriteInt32(f, m_Contents[i].m_Level);
+ CacheWriteInt32(f, m_Contents[i].m_ID);
+ CacheWriteString(f, m_Contents[i].m_Name);
+ CacheWriteString(f, m_Contents[i].m_Page);