void addUndoAction(UndoAction action){
  int iAction=m_undoStack.size() - 1;
  while (iAction > m_nCurrentEditAction) {
    m_undoStack.remove(iAction--);
  }
  if (m_nSavedPointer > m_nCurrentEditAction) {
    m_nSavedPointer=-2;
  }
  m_undoStack.add(action);
  m_nCurrentEditAction++;
}

void addUndoAction ( UndoAction action ) { int iAction = m_undoStack . size ( ) - 1 ; while ( iAction > m_nCurrentEditAction ) { m_undoStack . remove ( iAction -- ) ; } if ( m_nSavedPointer > m_nCurrentEditAction ) { m_nSavedPointer = - 2 ; } m_undoStack . add ( action ) ; m_nCurrentEditAction ++ ; }
add undo action to the undo stack .
