XWPFParagraph: easier way to create a link.#153
Closed
dourouc05 wants to merge 4 commits intoapache:trunkfrom
dourouc05:dourouc05-patch-xwpfparagraph-link
Closed
XWPFParagraph: easier way to create a link.#153dourouc05 wants to merge 4 commits intoapache:trunkfrom dourouc05:dourouc05-patch-xwpfparagraph-link
dourouc05 wants to merge 4 commits intoapache:trunkfrom
dourouc05:dourouc05-patch-xwpfparagraph-link
Conversation
|
Can one of the admins verify this patch? |
Author
|
I've just added a test; is this OK to merge? |
pjfanning
requested changes
Jul 16, 2019
Member
pjfanning
left a comment
There was a problem hiding this comment.
Test fails for me.
Testcase: testAddHyperlink took 0.007 sec
Caused an ERROR
null
java.lang.NullPointerException
at org.apache.poi.xwpf.usermodel.TestXWPFDocument.testAddHyperlink(TestXWPFDocument.java:194)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Author
|
The DOCX always got generated as it should have, but retrieving a newly added link could not work. What I did is call initHyperlinks in XWPFDocument each time a link is requested by ID, in case a new link was added (first emptying the Is this approach correct? From my understanding, I think so… Performancewise, it seems problematic, as the list is rebuilt each time a request for a link is made, this is why I made a second commit to rebuild this list only when the link is not found (which is already better). |
Member
|
Merged using https://svn.apache.org/repos/asf/poi/trunk@1863433 |
asfgit
pushed a commit
that referenced
this pull request
Oct 6, 2019
…ibaut Cuvelier. This closes #153 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1863433 13f79535-47bb-0310-9956-ffa450edef68
Alain-Bearez
pushed a commit
to cuali/poi
that referenced
this pull request
Dec 12, 2019
…ibaut Cuvelier. This closes apache#153 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1863433 13f79535-47bb-0310-9956-ffa450edef68
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Inspiration from https://stackoverflow.com/questions/55275241/how-to-add-a-hyperlink-to-the-footer-of-a-xwpfdocument-using-apache-poi