Skip to content

Dourouc05 patch xwpfabstractfootnoteendnote#156

Closed
dourouc05 wants to merge 3 commits intoapache:trunkfrom
dourouc05:dourouc05-patch-xwpfabstractfootnoteendnote
Closed

Dourouc05 patch xwpfabstractfootnoteendnote#156
dourouc05 wants to merge 3 commits intoapache:trunkfrom
dourouc05:dourouc05-patch-xwpfabstractfootnoteendnote

Conversation

@dourouc05
Copy link

@dourouc05 dourouc05 commented Jun 25, 2019

Add a helper method to directly create a paragraph within a footnote (rather than allowing the note to "eat" an existing CTP paragraph).

Should this function handle the first paragraph as a special case, in order to create a FootnoteRef (in case this is a footnote) and to respect the documentation of https://poi.apache.org/apidocs/dev/org/apache/poi/xwpf/usermodel/XWPFFootnote.html#ensureFootnoteRef-org.apache.poi.xwpf.usermodel.XWPFParagraph-?

@asfgit
Copy link

asfgit commented Jun 25, 2019

Can one of the admins verify this patch?

@pjfanning
Copy link
Member

This doesn't even compile. There is already a createParagraph method.

    /**
     * Appends a new {@link XWPFParagraph} to this footnote.
     *
     * @return The new {@link XWPFParagraph}
     * @since 4.0.0
     */
    public XWPFParagraph createParagraph() {
        XWPFParagraph p = new XWPFParagraph(this.ctFtnEdn.addNewP(), this);
        paragraphs.add(p);
        bodyElements.add(p);
    
        // If the paragraph is the first paragraph in the footnote, 
        // ensure that it has a footnote reference run.
        
        if (p.equals(getParagraphs().get(0))) {
            ensureFootnoteRef(p);
        }
        return p;
    }

Copy link
Member

@pjfanning pjfanning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code needs to compile

@pjfanning
Copy link
Member

I merged the other parts of the PR (excluding the broken createParagraph code)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants