Return-Path: X-Original-To: apmail-poi-dev-archive@www.apache.org Delivered-To: apmail-poi-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 582FBC0AE for ; Wed, 9 May 2012 23:05:35 +0000 (UTC) Received: (qmail 72661 invoked by uid 500); 9 May 2012 23:05:35 -0000 Delivered-To: apmail-poi-dev-archive@poi.apache.org Received: (qmail 72477 invoked by uid 500); 9 May 2012 23:05:35 -0000 Mailing-List: contact dev-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "POI Developers List" Delivered-To: mailing list dev@poi.apache.org Received: (qmail 72467 invoked by uid 99); 9 May 2012 23:05:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 May 2012 23:05:35 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [167.206.4.198] (HELO mta3.srv.hcvlny.cv.net) (167.206.4.198) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 May 2012 23:05:27 +0000 Received: from [192.168.1.85] (ool-45703dca.dyn.optonline.net [69.112.61.202]) by mta3.srv.hcvlny.cv.net (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <0M3S0017W2SHY1K0@mta3.srv.hcvlny.cv.net> for dev@poi.apache.org; Wed, 09 May 2012 19:05:06 -0400 (EDT) Date: Wed, 09 May 2012 19:04:59 -0400 From: Aram Mirzadeh Subject: Re: [Bug 53209] Too many styles corrupts the excel In-reply-to: To: POI Developers List Cc: bugzilla@apache.org Message-id: <4FAAF81B.4010305@mbcli.com> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 7BIT References: User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 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 changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > Status|NEW |NEEDINFO > OS| |All > > --- Comment #2 from Nick Burch --- > 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