Hi,

I'm inserting a hyperlink with a non standard protocol into a XSSF
Worksheet like so

                                                Hyperlink link = 
createHelper.createHyperlink(Hyperlink.LINK_URL);
                                                link.setAddress("my-proto://" + 
someURL);
                                                cell.setHyperlink(link);

This is working fine with HSSF but with XSSF it ignores the fact that
this is a URL and not a File link, and generates a
file://localhost/my-proto//... link.

Quickly browsing the source it seems to be related to XSSFHyperlink.java:

            // Try to figure out the type
            if (_location.startsWith("http://";) ||
_location.startsWith("https://";)
                    || _location.startsWith("ftp://";)) {
                _type = Hyperlink.LINK_URL;
            } else if (_location.startsWith("mailto:";)) {
                _type = Hyperlink.LINK_EMAIL;
            } else {
                _type = Hyperlink.LINK_FILE;
            }

That doesn't look right. It ought to use LINK_FILE only for "file"
URLs, LINK_EMAIL for "mailto" and LINK_URL for the rest.

Does anybody know of any workarounds in the mean time ? Any chance one
of the developers could address this ?

Thanks much in advance,
- Filip

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to