// scan the list once to compute total min, opt and max length
ListIterator oldListIterator = oldList.listIterator();
while (oldListIterator.hasNext()) {
KnuthElement element = (KnuthElement) oldListIterator.next();
if (element.isBox()) {
totalLength = totalLength.plus(element.getWidth());
//log.debug("box " + element.getWidth());
} else if (element.isGlue()) {
totalLength = totalLength.minusMin(element.getShrink());
totalLength = totalLength.plusMax(element.getStretch());
//leafValue = ((LeafPosition) element.getPosition()).getLeafPos();