- Related to my post #23631 about PaneRecord missing from both. - In addition, RecalcIdRecord is missing from EventRecordFactory. - Both are missing many others (not sure if this is intentional). Would we be better served changing the static block of code in say RecordFactory to use reflection to get all *Record.class files in org.apache.poi.hssf.record and eliminate Record and UnknownRecord. Then expose the static Class[] with a getter for EventRecordFactory. Anyway, here's the list: [missing]AreaFormatRecord [missing]AreaRecord [missing]AxisLineFormatRecord [missing]AxisOptionsRecord [missing]AxisParentRecord [missing]AxisRecord [missing]AxisUsedRecord [ ]BackupRecord [missing]BarRecord [missing]BeginRecord [ ]BlankRecord [ ]BOFRecord [ ]BookBoolRecord [ ]BoolErrRecord [ ]BottomMarginRecord [ ]BoundSheetRecord [ ]CalcCountRecord [ ]CalcModeRecord [missing]CategorySeriesAxisRecord [missing]ChartFormatRecord [missing]ChartRecord [ ]CodepageRecord [ ]ColumnInfoRecord [ ]ContinueRecord [ ]CountryRecord [missing]DataFormatRecord [ ]DateWindow1904Record [missing]DatRecord [ ]DBCellRecord [ ]DefaultColWidthRecord [missing]DefaultDataLabelTextPropertiesRecord [ ]DefaultRowHeightRecord [ ]DeltaRecord [ ]DimensionsRecord [ ]DSFRecord [missing]EndRecord [ ]EOFRecord [ ]ExtendedFormatRecord [ ]ExternSheetRecord [missing]ExternSheetSubRecord [missing]ExtSSTInfoSubRecord [ ]ExtSSTRecord [ ]FnGroupCountRecord [missing]FontBasisRecord [missing]FontIndexRecord [ ]FontRecord [ ]FooterRecord [ ]FormatRecord [ ]FormulaRecord [missing]FrameRecord [ ]GridsetRecord [ ]GutsRecord [ ]HCenterRecord [ ]HeaderRecord [ ]HideObjRecord [ ]IndexRecord [ ]InterfaceEndRecord [ ]InterfaceHdrRecord [ ]IterationRecord [ ]LabelRecord [ ]LabelSSTRecord [ ]LeftMarginRecord [missing]LegendRecord [missing]LineFormatRecord [missing]LinkedDataRecord [ ]MergeCellsRecord [ ]MMSRecord [ ]MulBlankRecord [ ]MulRKRecord [ ]NameRecord [missing]NumberFormatIndexRecord [ ]NumberRecord [missing]ObjectLinkRecord [ ]PaletteRecord [missing]PaneRecord [ ]PasswordRecord [ ]PasswordRev4Record [missing]PlotAreaRecord [missing]PlotGrowthRecord [ ]PrecisionRecord [ ]PrintGridlinesRecord [ ]PrintHeadersRecord [ ]PrintSetupRecord [ ]ProtectionRev4Record [ ]ProtectRecord [ ]RecalcIdRecord [ ]RefModeRecord [ ]RefreshAllRecord [ ]RightMarginRecord [ ]RKRecord [ ]RowRecord [ ]SaveRecalcRecord [missing]SCLRecord [ ]SelectionRecord [missing]SeriesChartGroupIndexRecord [missing]SeriesIndexRecord [missing]SeriesLabelsRecord [missing]SeriesListRecord [missing]SeriesRecord [missing]SeriesTextRecord [missing]SeriesToChartGroupRecord [ ]SharedFormulaRecord [missing]SheetPropertiesRecord [ ]SSTRecord [ ]StringRecord [ ]StyleRecord [missing]SupBookRecord [ ]TabIdRecord [missing]TextRecord [missing]TickRecord [ ]TopMarginRecord [missing]UnitsRecord [ ]UseSelFSRecord [missing]ValueRangeRecord [ ]VCenterRecord [ ]WindowOneRecord [ ]WindowProtectRecord [ ]WindowTwoRecord [ ]WriteAccessRecord [ ]WSBoolRecord
Hi Robert, In so far as eliminating UnknownRecord, this record is actually quite useful when debugging and extending HSSF with newer record types. There are some records that we simply dont implement. This may be due to the fact that i use Excel XP here at work and it has introduced new record types that we dont support, or there are records that we have chosed not to support. Now just scanning your list the missing records seem to mainly be chart records. Some such as ExtSSTInfoSubRecord are actually not really true excel records but have been implemented that way. However, Is anyone actively working on charts? Can we add these records to be read/written in the head. Unless someone beats me to it, i will have a look at the non-graph records that you mention. Everyone: I assume that there is no reason why the non graph records havent been added to the factory? Jason
Jason, I wasn't suggesting that we remove the UnknownRecord class itself, just that if we use reflection to enumerate all of the record classes to use in the factory, we should special case Record and UnknownRecord and not add them to the list b/c we'll never get a record read in from the stream for them (Record has no sid, and UnknownRecord has a 0 sid); UnknownRecord is created as a catch all. What do you think about using reflection to prevent further missing classes?
Automatically generating the list of Record classes to be served by EventRecordFactory won't work at the moment, because there are some records which must not be created directly (this was discovered while working on bug 44894). The first step will be to remove all old code from RecordFactory and use EventRecordFactory alone. There might still be ways to improve the management of the record classes list.