Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions main/DDF/DefaultEscherRecordFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ namespace NPOI.DDF
/// </summary>
public class DefaultEscherRecordFactory : IEscherRecordFactory
{
private static Type[] escherRecordClasses = {
private static readonly Type[] escherRecordClasses = {

typeof(EscherBSERecord), typeof(EscherOptRecord), typeof(EscherTertiaryOptRecord),
typeof(EscherClientAnchorRecord),
typeof(EscherDgRecord), typeof(EscherSpgrRecord), typeof(EscherSpRecord),
typeof(EscherClientDataRecord), typeof(EscherDggRecord),
typeof(EscherSplitMenuColorsRecord), typeof(EscherChildAnchorRecord), typeof(EscherTextboxRecord)
};
private static Dictionary<short,ConstructorInfo> recordsMap = RecordsToMap(escherRecordClasses);
private static readonly Dictionary<short,ConstructorInfo> recordsMap = RecordsToMap(escherRecordClasses);

/// <summary>
/// Initializes a new instance of the <see cref="DefaultEscherRecordFactory"/> class.
Expand Down
4 changes: 2 additions & 2 deletions main/DDF/EscherContainerRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class EscherContainerRecord : EscherRecord
public const short SPGR_CONTAINER = unchecked((short)0xF003);
public const short SP_CONTAINER = unchecked((short)0xF004);
public const short SOLVER_CONTAINER = unchecked((short)0xF005);
private static POILogger log = POILogFactory.GetLogger(typeof(EscherContainerRecord));
private static readonly POILogger log = POILogFactory.GetLogger(typeof(EscherContainerRecord));

/**
* in case if document contains any charts we have such document structure:
Expand All @@ -65,7 +65,7 @@ public class EscherContainerRecord : EscherRecord
* and add it to container size when we serialize it
*/
private int _remainingLength;
private List<EscherRecord> _childRecords = new List<EscherRecord>();
private readonly List<EscherRecord> _childRecords = new List<EscherRecord>();

/// <summary>
/// The contract of this method is to deSerialize an escher record including
Expand Down
2 changes: 1 addition & 1 deletion main/HPSF/Array.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public ArrayDimension( byte[] data, int offset )

internal class ArrayHeader
{
private ArrayDimension[] _dimensions;
private readonly ArrayDimension[] _dimensions;
internal int _type;

public ArrayHeader( byte[] data, int startOffset )
Expand Down
2 changes: 1 addition & 1 deletion main/HPSF/Blob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace NPOI.HPSF
{
internal class Blob
{
private byte[] _value;
private readonly byte[] _value;

public Blob(byte[] data, int offset)
{
Expand Down
4 changes: 2 additions & 2 deletions main/HPSF/ClipboardData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ public class ClipboardData
//private static final POILogger logger = POILogFactory
// .getLogger( ClipboardData.class );

private int _format;
private byte[] _value;
private readonly int _format;
private readonly byte[] _value;

public ClipboardData(byte[] data, int offset)
{
Expand Down
4 changes: 2 additions & 2 deletions main/HPSF/Filetime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ public class Filetime
{
public const int SIZE = LittleEndian.INT_SIZE * 2;

private int _dwHighDateTime;
private int _dwLowDateTime;
private readonly int _dwHighDateTime;
private readonly int _dwLowDateTime;

public Filetime(byte[] data, int offset)
{
Expand Down
2 changes: 1 addition & 1 deletion main/HPSF/IndirectPropertyName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
public class IndirectPropertyName
{
private CodePageString _value;
private readonly CodePageString _value;

public IndirectPropertyName(byte[] data, int offset)
{
Expand Down
2 changes: 1 addition & 1 deletion main/HPSF/UnicodeString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class UnicodeString
//private final static POILogger logger = POILogFactory
// .getLogger( UnicodeString.class );

private byte[] _value;
private readonly byte[] _value;

public UnicodeString(byte[] data, int offset)
{
Expand Down
2 changes: 1 addition & 1 deletion main/HPSF/Vector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace NPOI.HPSF
{
public class Vector
{
private short _type;
private readonly short _type;

private TypedPropertyValue[] _values;

Expand Down
2 changes: 1 addition & 1 deletion main/HPSF/VersionedStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace NPOI.HPSF
public class VersionedStream
{
private GUID _versionGuid;
private IndirectPropertyName _streamName;
private readonly IndirectPropertyName _streamName;

public VersionedStream(byte[] data, int offset)
{
Expand Down
4 changes: 2 additions & 2 deletions main/HSSF/EventModel/EventRecordFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ namespace NPOI.HSSF.EventModel
public class EventRecordFactory
{

private IERFListener _listener;
private ArrayList _sids;
private readonly IERFListener _listener;
private readonly ArrayList _sids;

/**
* Create an EventRecordFactory
Expand Down
4 changes: 2 additions & 2 deletions main/HSSF/Extractor/ExcelExtractor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ namespace NPOI.HSSF.Extractor
/// </summary>
public class ExcelExtractor : POIOLE2TextExtractor, IExcelExtractor
{
private HSSFWorkbook wb;
private HSSFDataFormatter _formatter;
private readonly HSSFWorkbook wb;
private readonly HSSFDataFormatter _formatter;
private bool includeSheetNames = true;
private bool formulasNotResults = false;
private bool includeCellComments = false;
Expand Down
6 changes: 3 additions & 3 deletions main/HSSF/Model/InternalSheet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public static InternalSheet CreateSheet(RecordStream rs)

private class RecordCloner : RecordVisitor
{
private IList<Record> _destList;
private readonly IList<Record> _destList;

public RecordCloner(IList<Record> destList)
{
Expand Down Expand Up @@ -452,7 +452,7 @@ private InternalSheet(RecordStream rs)
}
private class RecordVisitor1:RecordVisitor
{
List<RecordBase> _records;
readonly List<RecordBase> _records;
public RecordVisitor1(List<RecordBase> recs)
{
_records=recs;
Expand Down Expand Up @@ -2339,7 +2339,7 @@ public int GetColumnOutlineLevel(int columnIndex)

public class UnsupportedBOFType : RecordFormatException
{
private BOFRecordType type;
private readonly BOFRecordType type;
public UnsupportedBOFType(BOFRecordType type)
: base("BOF not of a supported type, found " + type)
{
Expand Down
14 changes: 7 additions & 7 deletions main/HSSF/Model/LinkTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ private static ExternSheetRecord ReadExtSheetRecord(RecordStream rs)
private class CRNBlock
{

private CRNCountRecord _countRecord;
private CRNRecord[] _crns;
private readonly CRNCountRecord _countRecord;
private readonly CRNRecord[] _crns;

public CRNBlock(RecordStream rs)
{
Expand All @@ -113,7 +113,7 @@ public CRNRecord[] GetCrns()

private class ExternalBookBlock
{
private SupBookRecord _externalBookRecord;
private readonly SupBookRecord _externalBookRecord;
internal ExternalNameRecord[] _externalNameRecords;
private CRNBlock[] _crnBlocks;
/**
Expand Down Expand Up @@ -217,10 +217,10 @@ public int GetNameIx(int definedNameIndex)
}

private ExternalBookBlock[] _externalBookBlocks;
private ExternSheetRecord _externSheetRecord;
private List<NameRecord> _definedNames;
private int _recordCount;
private WorkbookRecordList _workbookRecordList; // TODO - would be nice to Remove this
private readonly ExternSheetRecord _externSheetRecord;
private readonly List<NameRecord> _definedNames;
private readonly int _recordCount;
private readonly WorkbookRecordList _workbookRecordList; // TODO - would be nice to Remove this

public LinkTable(List<Record> inputList, int startIndex, WorkbookRecordList workbookRecordList, Dictionary<String, NameCommentRecord> commentRecords)
{
Expand Down
10 changes: 5 additions & 5 deletions main/HSSF/Model/ParseNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ class ParseNode
{

public static ParseNode[] EMPTY_ARRAY = { };
private Ptg _token;
private ParseNode[] _children;
private bool _isIf;
private int _tokenCount;
private readonly Ptg _token;
private readonly ParseNode[] _children;
private readonly bool _isIf;
private readonly int _tokenCount;

public ParseNode(Ptg token, ParseNode[] children)
{
Expand Down Expand Up @@ -178,7 +178,7 @@ public ParseNode[] Children
private class TokenCollector
{

private Ptg[] _ptgs;
private readonly Ptg[] _ptgs;
private int _offset;

public TokenCollector(int tokenCount)
Expand Down
4 changes: 2 additions & 2 deletions main/HSSF/Model/RecordStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ namespace NPOI.HSSF.Model
public class RecordStream
{

private IList _list;
private readonly IList _list;
private int _nextIndex;
private int _endIx;
private readonly int _endIx;
private int _countRead;

public RecordStream(IList inputList, int startIndex, int endIx)
Expand Down
6 changes: 3 additions & 3 deletions main/HSSF/Model/RowBlocksReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ namespace NPOI.HSSF.Model
public class RowBlocksReader
{

private ArrayList _plainRecords;
private SharedValueManager _sfm;
private MergeCellsRecord[] _mergedCellsRecords;
private readonly ArrayList _plainRecords;
private readonly SharedValueManager _sfm;
private readonly MergeCellsRecord[] _mergedCellsRecords;

/**
* Also collects any loose MergeCellRecords and puts them in the supplied
Expand Down
10 changes: 5 additions & 5 deletions main/HSSF/Record/Aggregates/Chart/ChartSheetAggregate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ namespace NPOI.HSSF.Record.Aggregates.Chart
/// </summary>
public class ChartSheetAggregate : ChartRecordAggregate
{
private BOFRecord _bofRec;
private readonly BOFRecord _bofRec;
/**
* All the records between BOF and EOF
*/
private List<RecordBase> _recs;
private PageSettingsBlock _psBlock;
private readonly List<RecordBase> _recs;
private readonly PageSettingsBlock _psBlock;

private ChartFormatsAggregate chartFormats;
private SeriesDataAggregate seriesData;
private readonly ChartFormatsAggregate chartFormats;
private readonly SeriesDataAggregate seriesData;

public ChartSheetAggregate(RecordStream rs, ChartRecordAggregate container)
: base(RuleName_CHARTSHEET, container)
Expand Down
6 changes: 3 additions & 3 deletions main/HSSF/Record/Aggregates/ChartSubstreamRecordAggregate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ namespace NPOI.HSSF.Record.Aggregates
public class ChartSubstreamRecordAggregate : RecordAggregate
{

private BOFRecord _bofRec;
private readonly BOFRecord _bofRec;
/**
* All the records between BOF and EOF
*/
private List<RecordBase> _recs;
private PageSettingsBlock _psBlock;
private readonly List<RecordBase> _recs;
private readonly PageSettingsBlock _psBlock;

public ChartSubstreamRecordAggregate(RecordStream rs)
{
Expand Down
2 changes: 1 addition & 1 deletion main/HSSF/Record/Aggregates/ConditionalFormattingTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace NPOI.HSSF.Record.Aggregates
public class ConditionalFormattingTable : RecordAggregate
{

private IList<CFRecordsAggregate> _cfHeaders;
private readonly IList<CFRecordsAggregate> _cfHeaders;

/**
* Creates an empty ConditionalFormattingTable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ namespace NPOI.HSSF.Record.Aggregates
public class CustomViewSettingsRecordAggregate : RecordAggregate
{

private Record _begin;
private Record _end;
private readonly Record _begin;
private readonly Record _end;
/**
* All the records between BOF and EOF
*/
private List<RecordBase> _recs;
private PageSettingsBlock _psBlock;
private readonly List<RecordBase> _recs;
private readonly PageSettingsBlock _psBlock;

public CustomViewSettingsRecordAggregate(RecordStream rs)
{
Expand Down
4 changes: 2 additions & 2 deletions main/HSSF/Record/Aggregates/DataValidityTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ namespace NPOI.HSSF.Record.Aggregates
public class DataValidityTable : RecordAggregate
{

private DVALRecord _headerRec;
private readonly DVALRecord _headerRec;
/**
* The list of data validations for the current sheet.
* Note - this may be empty (contrary to OOO documentation)
*/
private IList _validationList;
private readonly IList _validationList;

public DataValidityTable(RecordStream rs)
{
Expand Down
2 changes: 1 addition & 1 deletion main/HSSF/Record/Aggregates/MergedCellsTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class MergedCellsTable : RecordAggregate
{
private const int MAX_MERGED_REGIONS = 1027; // enforced by the 8224 byte limit

private List<CellRangeAddress> _mergedRegions;
private readonly List<CellRangeAddress> _mergedRegions;

/// <summary>
/// Creates an empty aggregate
Expand Down
6 changes: 3 additions & 3 deletions main/HSSF/Record/Aggregates/PLSAggregate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ namespace NPOI.HSSF.Record.Aggregates
{
internal class PLSAggregate : RecordAggregate
{
private static ContinueRecord[] EMPTY_CONTINUE_RECORD_ARRAY = { };
private Record _pls;
private static readonly ContinueRecord[] EMPTY_CONTINUE_RECORD_ARRAY = { };
private readonly Record _pls;
/**
* holds any continue records found after the PLS record.<br/>
* This would not be required if PLS was properly interpreted.
* Currently, PLS is an {@link UnknownRecord} and does not automatically
* include any trailing {@link ContinueRecord}s.
*/
private ContinueRecord[] _plsContinues;
private readonly ContinueRecord[] _plsContinues;

public PLSAggregate(RecordStream rs)
{
Expand Down
12 changes: 6 additions & 6 deletions main/HSSF/Record/Aggregates/PageSettingsBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public class PageSettingsBlock : RecordAggregate
private Record _bitmap;
private HeaderFooterRecord _headerFooter;

private List<HeaderFooterRecord> _sviewHeaderFooters = new List<HeaderFooterRecord>();
private List<PLSAggregate> _plsRecords;
private readonly List<HeaderFooterRecord> _sviewHeaderFooters = new List<HeaderFooterRecord>();
private readonly List<PLSAggregate> _plsRecords;

private Record _printSize;

Expand Down Expand Up @@ -671,10 +671,10 @@ public void PositionRecords(List<RecordBase> sheetRecords)
}
private class CustomRecordVisitor1 : RecordVisitor
{
CustomViewSettingsRecordAggregate _cv;
HeaderFooterRecord _hf;
List<HeaderFooterRecord> _sviewHeaderFooters;
Dictionary<String, HeaderFooterRecord> _hfGuidMap;
readonly CustomViewSettingsRecordAggregate _cv;
readonly HeaderFooterRecord _hf;
readonly List<HeaderFooterRecord> _sviewHeaderFooters;
readonly Dictionary<String, HeaderFooterRecord> _hfGuidMap;
public CustomRecordVisitor1(CustomViewSettingsRecordAggregate cv, HeaderFooterRecord hf,
List<HeaderFooterRecord> sviewHeaderFooter, Dictionary<String, HeaderFooterRecord> hfGuidMap)
{
Expand Down
6 changes: 3 additions & 3 deletions main/HSSF/Record/Aggregates/RecordAggregate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ public override int RecordSize
private class SerializingRecordVisitor : RecordVisitor
{

private byte[] _data;
private int _startOffset;
private readonly byte[] _data;
private readonly int _startOffset;
private int _countBytesWritten;

public SerializingRecordVisitor(byte[] data, int startOffset)
Expand Down Expand Up @@ -129,7 +129,7 @@ public virtual Record CloneViaReserialise()
*/
public class PositionTrackingVisitor : RecordVisitor
{
private RecordVisitor _rv;
private readonly RecordVisitor _rv;
private int _position;

public PositionTrackingVisitor(RecordVisitor rv, int initialPosition)
Expand Down
Loading