List<FieldRef> fieldRefs = new ArrayList<FieldRef>();
for( P p : fl.getStarts() ) {
int index;
if (p.getParent() instanceof ContentAccessor) {
index = ((ContentAccessor)p.getParent()).getContent().indexOf(p);
P newP = FieldsPreprocessor.canonicalise(p, fieldRefs);
// log.debug("NewP length: " + newP.getContent().size() );
((ContentAccessor)p.getParent()).getContent().set(index, newP);
} else if (p.getParent() instanceof java.util.List) {
// This does happen!
index = ((java.util.List)p.getParent()).indexOf(p);
P newP = FieldsPreprocessor.canonicalise(p, fieldRefs);
// log.debug("NewP length: " + newP.getContent().size() );
((java.util.List)p.getParent()).set(index, newP);
} else {
throw new Docx4JException ("Unexpected parent: " + p.getParent().getClass().getName() );
}