* @return the index of the column
*/
public int getColumnIndex() {
int result = 0;
OdfTable table = getTable();
TableTableColumnElement columnEle;
TableTableElement mTableElement = table.getOdfElement();
for (Node n : new DomNodeList(mTableElement.getChildNodes())) {
if (n instanceof TableTableHeaderColumnsElement) {
TableTableHeaderColumnsElement headers = (TableTableHeaderColumnsElement) n;
for (Node m : new DomNodeList(headers.getChildNodes())) {
if (m instanceof TableTableColumnElement) {
columnEle = (TableTableColumnElement) m;
if (columnEle == getOdfElement()) {
return result + mnRepeatedIndex;
}
if (columnEle.getTableNumberColumnsRepeatedAttribute() == null) {
result += 1;
} else {
result += columnEle.getTableNumberColumnsRepeatedAttribute();
}
}
}
}
if (n instanceof TableTableColumnElement) {
columnEle = (TableTableColumnElement) n;
if (columnEle == getOdfElement()) {
break;
}
if (columnEle.getTableNumberColumnsRepeatedAttribute() == null) {
result += 1;
} else {
result += columnEle.getTableNumberColumnsRepeatedAttribute();
}
}
}
return result + mnRepeatedIndex;
}