poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aram Mirzadeh <...@apache.org>
Subject Re: [Bug 53209] Too many styles corrupts the excel
Date Wed, 09 May 2012 23:10:50 GMT

Okay, I see the rookie mistake I made.

Thanks.

Sorry about the bug report.  You can close it out.

Aram

On 5/9/2012 7:04 PM, Aram Mirzadeh wrote:
>
> Hi,
>
> But does that number apply to the "number" of styles defined, or the 
> number of times the style is applied?
>
> The code only defines about a dozen styles.  I simply just applied the 
> same style to all cells.
>
> Aram
>
> On 5/9/2012 5:35 PM, bugzilla@apache.org wrote:
>> https://issues.apache.org/bugzilla/show_bug.cgi?id=53209
>>
>> Nick Burch<nick.burch@alfresco.com>  changed:
>>
>>             What    |Removed                     |Added
>> ---------------------------------------------------------------------------- 
>>
>>               Status|NEW                         |NEEDINFO
>>                   OS|                            |All
>>
>> --- Comment #2 from Nick Burch<nick.burch@alfresco.com>  ---
>> In HSSF, we have a maximum number of styles, and throw an exception 
>> if someone
>> tries to add more than that
>>
>>      /**
>>       * The maximum number of cell styles in a .xls workbook.
>>       * The 'official' limit is 4,000, but POI allows a slightly 
>> larger number.
>>       * This extra delta takes into account built-in styles that are
>> automatically
>>       * created for new workbooks
>>       *
>>       * See
>> http://office.microsoft.com/en-us/excel-help/excel-specifications-and-limits-HP005199291.aspx

>>
>>       */
>>      private static final int MAX_STYLES = 4030;
>>
>> The .xlsx file format also has a maximum number of styles, but it 
>> doesn't look
>> like we enforce that in the same way. From a quick check, neither
>> XSSFWorkbook.createCellStyle() nor StylesTable appears to have the check
>>
>> The fix is probably for someone to dig out the official maximum 
>> number of
>> styles in a .xlsx file, from the file format docs, then implement a 
>> similar
>> check in xssf
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org


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


Mime
View raw message