Bug 58572

Summary: Make XSSFSheet.getHyperlinkList() and XSSFSheet.getHyperlink(row, col) available in Sheet interface
Product: POI Reporter: Javen O'Neal <onealj>
Component: SS CommonAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: enhancement CC: dominique.demunck
Priority: P2    
Version: 3.14-dev   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Bug Depends on:    
Bug Blocks: 58348    
Attachments: changes to make hyperlinks accessible via HSSFSheet and SXSSFSheet

Description Javen O'Neal 2015-11-02 08:28:53 UTC
XSSFSheet.getHyperlinkList and XSSFSheet.getHyperlink are currently only available in the XSSFSheet implementation, and aren't available in HSSFSheets. Currently the only way to get a hyperlink from an HSSFWorkbook is to use HSSFCell.getHyperlink(). To get all hyperlinks in a workbook, this requires iterating over all cells, which is unnecessarily expensive (and also currently runs in quadratic time with the number of cells in a sheet).
Comment 1 Javen O'Neal 2015-11-02 09:41:57 UTC
Created attachment 33246 [details]
changes to make hyperlinks accessible via HSSFSheet and SXSSFSheet
Comment 2 Javen O'Neal 2015-11-02 09:45:49 UTC
Applied in r1711923 to trunk.

Site docs updated in r1711924.
Comment 3 Dominik Stadler 2015-11-02 12:41:32 UTC
*** Bug 58507 has been marked as a duplicate of this bug. ***
Comment 4 Javen O'Neal 2015-11-02 13:06:18 UTC
After reading about the problems with Java's Cloneable interface[1], I replaced Cloneable interface with copy constructors in r1711951.

I wrote code for copying between hyperlink types (HSSFHyperlink/XSSFHyperlink). OOXML code is not available in TestHSSFHyperlink.java (results in compile error). Where should I place the HSSFHyperlink copy constructor unit test [2] in order for it to run as part of the suite?

[1] https://stackoverflow.com/questions/2427883/clone-vs-copy-constructor-which-is-recommended-in-java
[2] https://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java?r1=1711952&r2=1711950&pathrev=1711952