[cvs-nhc98] Refactor the expression-squashing code into the paintOne r