Skip to content

Commit

Permalink
Close #17 Remove convenience Methods for getParagraph/Table
Browse files Browse the repository at this point in the history
Confusing together with the new syntax to access bodyElements directly.
Use `.bodyElement(int).asParagraph()` instead.
  • Loading branch information
alexpartsch committed Apr 7, 2021
1 parent 9c7635a commit 05edd46
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,4 @@ public BodyElementWrapper bodyElement(int index) {
return new BodyElementWrapper(document.getBodyElements().get(index));
}

public ParagraphWrapper paragraph(int index) {
return bodyElement(index).asParagraph();
}

public TableWrapper table(int index) {
return bodyElement(index).asTable();
}

}
2 changes: 1 addition & 1 deletion src/test/java/com/docutools/poipath/xwpf/XWPFTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void findTables() throws IOException {
@Test
void findPictures() throws IOException {
try (var document = Documents.resource("/XWPF/pictureTest.docx")) {
var picture = new XWPFDocumentWrapper(document).paragraph(0).run(0).pictures();
var picture = new XWPFDocumentWrapper(document).bodyElement(0).asParagraph().run(0).pictures();

assertThat(picture.size(), equalTo(1));
}
Expand Down

0 comments on commit 05edd46

Please sign in to comment.