264265266267268269270271272273274
else{ int pos = paragraphs.indexOf(getParagraph((CTP)o))+1; paragraphs.add(pos,newP); } int i=0; cursor.toCursor(p.newCursor()); while(cursor.toPrevSibling()){ o =cursor.getObject(); if(o instanceof CTP || o instanceof CTTbl) i++; }
271272273274275276277278279280281
o =cursor.getObject(); if(o instanceof CTP || o instanceof CTTbl) i++; } bodyElements.add(i, newP); cursor.toCursor(p.newCursor()); cursor.toEndToken(); return newP; } public XWPFTable insertNewTbl(XmlCursor cursor) {
294295296297298299300301302303304
301302303304305306307308309310311
o =cursor.getObject(); if(o instanceof CTP || o instanceof CTTbl) i++; } bodyElements.add(i, newP); cursor.toCursor(p.newCursor()); cursor.toEndToken(); return newP; } return null; }
344345346347348349350351352353354
351352353354355356357358359360361
577578579580581582583584585586587
/* * create a new cursor, that points to the START token of the just * inserted paragraph */ XmlCursor newParaPos = p.newCursor(); try { /* * Calculate the paragraphs index in the list of all body * elements */
273274275276277278279280281282283
280281282283284285286287288289290
175176177178179180181182183184185