runrig/spreadsheet-parseexcel — pull request #2 by tlhackque (2014-03-15 00:28:20+00:00)
Title: Add support for cells containing hyperlinks

This patch provides support for cells containing hyperlinks.

Includes tests & doc in the pod.

This allows a reader to (a) know when a cell contains a hyperlink and (b) get the link in a usable form.

Without this, the cell value has the description - but not the link. So rendering active hyperlinks requires this patch.

The hyperlinks are a new record (to SPE); files without them will see no impact.

Hyperlinks are more like merged areas than cells. They can be replicated in a rectangular area. When this happens, the perl data structures are shared. But the rectangle has been 1 cell in every case tested.

There is a documented $cell->get_hyperlink method.

The whole table is kept in the worksheet (but not documented) because (a) it gets a reference the cell(s) at the end of parsing and (b) it may be useful someday. Since the data is shared with the cells, there is no point in deleting the table.

The loops at the end of parsing a workbook look scary, but they are skipped unless a hyperlink record exists in a work sheet and the row/column loops are almost always 1 trip. (start row == end row and start col == end col). It's small linear cost in number of hyperlink records - simply setting up references.