Hi Yegor After some experimentation I think I've discovered the following:
1. A cell that never had any style applied to it has a CellStyle with an index of 0 2. A cell that had a style applied but then had that style removed will have the next highest unused index. So if I create three cells with three different styles and then remove the style from one of those three, that will become index 4. All cells that have all their styling removed will then become index 4. At the moment I'm looking at comparing the style for each index with the style of index 0. There should only be one index that matches with index 0. If the above is incorrect or anyone has any suggestions I'd appreciate them. Thanks Stuart On 15 January 2013 17:37, Stuart Turner <[email protected]> wrote: > Hi Yegor > > Thanks for your reply. > > I don't understand how I can tell if a cell has had its CellStyle modified. > > What will cell.getCellStyle().getIndex() return if it is the default > style (without any modification)? > > Thanks > > Stuart > > On 15 January 2013 16:56, Yegor Kozlov <[email protected]> wrote: >> CellStyle is a global object stored at workbook level. Cells referer >> to their style by 0-based index. >> >> You can pre-build a map <cellStyleIndex, ifModifiedFleg> and then >> simply check if the value is set for cell.getCellStyle().getIndex(). >> >> >> >> On Tue, Jan 15, 2013 at 5:02 AM, Stuart Turner <[email protected]> wrote: >>> Hi Everyone >>> >>> Is there a way to determine whether a cell has ANY format conditions? >>> In Excel, you can ask Range.FormatConditions.Count to obtain whether >>> any cell has formatting different from the default. >>> >>> In POI, am I correct in saying every cell has a CellStyle and I will >>> need to go through each one to determine if the font, colour, borders, >>> etc. are different from the default? >>> >>> Thanks >>> >>> Stuart >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [email protected] >>> For additional commands, e-mail: [email protected] >>> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
