If this is not the first child of this w:r, look at the preceding sibling
*/
boolean firstBr = true; // until proven otherwise
R r = (R)br.getParent();
int pos = getPos(r.getContent(), br);
if (pos<0) {
log.error("Couldn't locate w:br in w:r");
}
else if (pos==0) {
// Need to look in preceding run
Object rParent = r.getParent();
// Handle just the case where this is w:p for now
if(rParent instanceof P) {
P parentP = (P)rParent;
pos = getPos(parentP.getContent(), r);
if (pos<0) {
log.error("Couldn't locate w:r in w:p");
} else if (pos>0) {
Object beforeR = parentP.getContent().get(pos-1);
if (beforeR instanceof R) {
List list = ((R)beforeR).getContent();
Object previous = list.get(list.size()-1);
if (previous instanceof Br) {
firstBr=false;
}
} else {
// System.out.println(beforeR.getClass().getName());
}
}
} else {
log.info("TODO: handle run parent " + rParent.getClass().getName());
}
} else {
Object previous = r.getContent().get(pos-1);
if (previous instanceof Br) {
firstBr=false;
} else {
// System.out.println("previous: " + previous.getClass().getName());
}