// TODO insert preface
private static void replaceParagraphWithPreface(final Context context, final XWPFParagraph paragraph) {
        try (final CursorHelper cursorHelper = context.newCursorHelper(paragraph)) {
            // TODO insert preface
        } finally {
            context.getDocument().removeBodyElement(context.getDocument().getPosOfParagraph(paragraph));
        }
    }
private static void replaceParagraphWithPreface(final Context context, final XWPFParagraph paragraph) {
try (final CursorHelper cursorHelper = context.newCursorHelper(paragraph)) {
// TODO insert preface
} finally {
context.getDocument().removeBodyElement(context.getDocument().getPosOfParagraph(paragraph));
private static void replaceParagraphWithPreface(final Context context, final XWPFParagraph paragraph) {
try (final CursorHelper cursorHelper = context.newCursorHelper(paragraph)) {
// TODO insert preface
} finally {
context.getDocument().removeBodyElement(context.getDocument().getPosOfParagraph(paragraph));
}
}
private static void replaceParagraphWithPreface(final Context context, final XWPFParagraph paragraph) {
try (final CursorHelper cursorHelper = context.newCursorHelper(paragraph)) {
// TODO insert preface
} finally {
context.getDocument().removeBodyElement(context.getDocument().getPosOfParagraph(paragraph));
}
}