+
+
+// ----------------------------------------------------------------------------
+// wxHtmlTerminalCellsInterator
+// ----------------------------------------------------------------------------
+
+const wxHtmlCell* wxHtmlTerminalCellsInterator::operator++()
+{
+ if ( !m_pos )
+ return NULL;
+
+ do
+ {
+ if ( m_pos == m_to )
+ {
+ m_pos = NULL;
+ return NULL;
+ }
+
+ if ( m_pos->GetNext() )
+ m_pos = m_pos->GetNext();
+ else
+ {
+ // we must go up the hierarchy until we reach container where this
+ // is not the last child, and then go down to first terminal cell:
+ while ( m_pos->GetNext() == NULL )
+ {
+ m_pos = m_pos->GetParent();
+ if ( !m_pos )
+ return NULL;
+ }
+ m_pos = m_pos->GetNext();
+ }
+ while ( m_pos->GetFirstChild() != NULL )
+ m_pos = m_pos->GetFirstChild();
+ } while ( !m_pos->IsTerminalCell() );
+
+ return m_pos;
+}
+