By the way, where did you find the implementation of HyperlinkRecord? Which Bug 
#?

1. HyperlinkRecord construction failed on non-URL links, in particular, on 
links to a place in worksheet. 
I added a check to prevent reading past EOF. 
 
2. HyperlinkRecord.fillFields is incomplete. It works only with URL type of 
links.
I didn't decode it yet but fillFields should behave something like this:

if(type == URL){
  //read URL properties 
} else if (type == email){
  //read email properties
} else if (type == document){
  //read coordinates of a cell in this document 
} else {
  //unknown ...

}

In each case the rules are different.
The same applies to serialize().

Any thoughts how to decode it?

3. Hyperlink is a special info attached to a cell. Very much like cell comment. 
To find a hyperlink you need to traverse
through the sheet records and test row and column of found HyperlinkRecords.

I added HSSFHyperlink object and getHyperlink/setHyperlink to HSSFCell. For now 
only getHyperlink() works.

setHyperlink is not yet implemented. First, we need to finish with 
HyperlinkRecord and figure out how to fill data for different types of links.
Once this is implemented, assigning a hyperlink to a cell would be just 
appending a HyperlinkRecord to sheet records.

Regards,
Yegor  

> Hi All

> I had a stab at doing hyperlink support for hssf (bug #37923). After
> discovering a rather old, stub implementation of the record, handily under
> an apache licence, I was able to get most of the Hyperlink record
> supported. (A few unknowns, and one bit of black magic, but all files
> containing the record in our test suite still open fine...). Oh, and I've
> done record tests for it all too, which seem to cover most things.

> On trying to add usermodel support for it, I hit a bit of a snag. The
> records weren't ending up in Workbook.records, as they came after the
> EOFRecord, so weren't being picked up by the interesting records sweep in
> Workbook.createWorkbook

> As a stop-gap, I've got Workbook.createWorkbook to check the records after
> EOFRecord, and pop the Hyperlink records into another array. However, this
> doesn't let them tie in with cells, as they're in the wrong place, and I'm
> not even sure how to tell which sheet a Hyperlink belongs to (row+column
> are easy though)

> I've also done some unit tests in usermodel.HSSFCell, which are disabled
> for now as the cells don't get created, as the Hyperlink records aren't
> picked up by the sheet's record sweep. So, if you fancy trying to finish
> the support off, they should get you most of the way there for a test,
> then you just need to deal with getting the records into where they need
> to be...

> Nick

> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to