示例#1
0
        /// <summary> Constructor
        ///
        /// </summary>
        /// <param name="f">the excel file
        /// </param>
        /// <param name="sst">the shared string table
        /// </param>
        /// <param name="fr">formatting records
        /// </param>
        /// <param name="sb">the bof record which indicates the start of the sheet
        /// </param>
        /// <param name="wb">the bof record which indicates the start of the sheet
        /// </param>
        /// <param name="nf">the 1904 flag
        /// </param>
        /// <param name="wp">the workbook which this sheet belongs to
        /// </param>
        /// <exception cref=""> BiffException
        /// </exception>
        internal SheetImpl(File f, SSTRecord sst, FormattingRecords fr, BOFRecord sb, BOFRecord wb, bool nf, WorkbookParser wp)
        {
            excelFile              = f;
            sharedStrings          = sst;
            formattingRecords      = fr;
            sheetBof               = sb;
            workbookBof            = wb;
            columnInfosArray       = new ArrayList();
            sharedFormulas         = new ArrayList();
            hyperlinks             = new ArrayList();
            rowProperties          = new ArrayList(10);
            columnInfosInitialized = false;
            rowRecordsInitialized  = false;
            nineteenFour           = nf;
            workbook               = wp;
            workbookSettings       = workbook.Settings;

            // Mark the position in the stream, and then skip on until the end
            startPosition = f.Pos;

            if (sheetBof.isChart())
            {
                // Set the start pos to include the bof so the sheet reader can handle it
                startPosition -= (sheetBof.Length + 4);
            }

            Record r    = null;
            int    bofs = 1;

            while (bofs >= 1)
            {
                r = f.next();

                // use this form for quick performance
                if (r.Code == NExcel.Biff.Type.EOF.Value)
                {
                    bofs--;
                }

                if (r.Code == NExcel.Biff.Type.BOF.Value)
                {
                    bofs++;
                }
            }
        }
示例#2
0
 /// <summary> Constructor
 ///
 /// </summary>
 /// <param name="fr">the formatting records
 /// </param>
 /// <param name="sst">the shared string table
 /// </param>
 /// <param name="f">the excel file
 /// </param>
 /// <param name="sb">the bof record which indicates the start of the sheet
 /// </param>
 /// <param name="wb">the bof record which indicates the start of the sheet
 /// </param>
 /// <param name="wp">the workbook which this sheet belongs to
 /// </param>
 /// <param name="sp">the start position of the sheet bof in the excel file
 /// </param>
 /// <param name="sh">the sheet
 /// </param>
 /// <param name="nf">1904 date record flag
 /// </param>
 /// <exception cref=""> BiffException
 /// </exception>
 internal SheetReader(File f, SSTRecord sst, FormattingRecords fr, BOFRecord sb, BOFRecord wb, bool nf, WorkbookParser wp, int sp, SheetImpl sh)
 {
     excelFile         = f;
     sharedStrings     = sst;
     formattingRecords = fr;
     sheetBof          = sb;
     workbookBof       = wb;
     columnInfosArray  = new ArrayList();
     sharedFormulas    = new ArrayList();
     hyperlinks        = new ArrayList();
     rowProperties     = new ArrayList(10);
     charts            = new ArrayList();
     drawings          = new ArrayList();
     nineteenFour      = nf;
     workbook          = wp;
     startPosition     = sp;
     sheet             = sh;
     settings          = new SheetSettings();
     workbookSettings  = workbook.Settings;
 }