poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 49654] unreadble content in xls
Date Tue, 03 Aug 2010 12:29:49 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=49654

--- Comment #15 from Yegor Kozlov <yegor@dinom.ru> 2010-08-03 08:29:45 EDT ---
> 
> I have read the source of Hyperlink related files and could not understand
> where the number of Hyperlinks are limited.Could you please give me some advice
> so that I can continue.
>

The number of hyperlinks is not limited in the Excel binary format, it seems to
be a limitation of MS Excel application. I searched the format spec and MSDN
and did not find this limitation. 

> int eofLoc = _sheet.getSheet().findFirstRecordLocBySid( EOFRecord.sid );
> _sheet.getSheet().getRecords().add( eofLoc, link.record );
> 
> 
> meanwhile,what doesnot rhe eofLoc exactly mean? Thanks a lot if you can explain
> more to me.

Excel workbook consists of records and the order of records is determined by
the Excel binary format. Hyperlink records are appended to the sheet records
and EOFRecord marks the end of the sheet. 

I think this code can be improved. EOFRecord seems to be always the last record
in the collection  and a better version would look as follows:

        List<RecordBase> records = _sheet.getSheet().getRecords();
        int eofLoc = records.size() - 1;
        records.add( eofLoc, link.record );

This should significantly improve performance because findFirstRecordLocBySid
takes O(N) operations to find a record in a sheet consisting of N records. 

I'm going commit the fix soon.

Regards,
Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message