The actual number of pages is given by the number of elements in m_PageBreaks vector after CountPages() is shown and is unknown until then, so m_NumPages is completely unnecessary and can be just removed.