The cloneFromStyle() method works fine, I have made use of it myself recently. As for the equlas() method, after taking a look at the javadoc - not the source so I cannot be certain and could very well be wrong - I think this method has been inherited not overridden. Therefore, it may only check for object equality and it is up to the users of the API to monitor the individual attributes of the style.
The method I have used in the past is to create a cell, add it to a row, insert the data, create a new cell style and then check to see if I already have one with the relevant attributes. If so, apply that to the cell, if not apply the new one to the cell and add it to the pool. --- On Thu, 10/16/08, Rob Y <[EMAIL PROTECTED]> wrote: From: Rob Y <[EMAIL PROTECTED]> Subject: Re: HSSFCellStyle - global styles vs individual cell styles To: [email protected] Date: Thursday, October 16, 2008, 1:03 PM > Sorry if you wasted any time with the cell utility class, I only spotted it whilst having a quick break and did > not have the opportunity to test it out. Not at all. It was useful, if only to confirm that others have attempted to solve the problem. And in a similar way. I contacted the author of the cell utility class to see if he wants to work together to extend it to do more. Question about scanning the existing styles, though. You said you'd have to check each attribute individually. I had thought I could use cloneStyleFrom to create a temporary style, fill it in, and then use the 'equals' operator of HSSFCellStyle to just compare all the attributes at once when scanning the list. Do you think that won't work? If so, why? Rob --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
