private void addUndo(CPUndo undo) {
		if (undoList.isEmpty() || !(undoList.getFirst()).merge(undo)) {
			if (undoList.size() >= maxUndo) {
				undoList.removeLast();
			}
			undoList.addFirst(undo);
		} else {
			// Two merged changes can mean no change at all
			// don't leave a useless undo in the list
			if ((undoList.getFirst()).noChange()) {
				undoList.removeFirst();
			}
		}
		if (!redoList.isEmpty()) {
			redoList = new LinkedList();
		}
	}