java - Changing the order of paragraphs not working -


i trying manipulate order of paragraphs in worddocument using docx4j.

p1 p2 t1

should this

p2 t1 p1

the following code nothing

in clipboard paragraphs, should moved are. first delete them document. index index of first paragraph.

for ( p p: clipboard ) {   this.c.wordmlpackage.getmaindocumentpart().getcontent().remove( p); } 

then try reinsert them

for ( p p : clipboard ) {   system.out.println("adding to+"+ index+" " + child.getp());   this.c.wordmlpackage.getmaindocumentpart().getcontent().add( index-1, p ); } 


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -