Esempio n. 1
0
        public static AbsXLSRec Read(BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo)
        {
            int code = br.ReadUInt16();

            if (code == 0)
            {
                return(null);
            }
            int           size   = br.ReadUInt16();
            XLSDescriptor byCode = XLSDescriptors.GetByCode(code);

            if (!XLSDescriptors.ValidBodySize(byCode, size, false))
            {
                byCode = null;
            }
            if ((byCode != null) && (byCode.Name == "FILEPASS"))
            {
                throw new Exception("Current version of ebexcel can't read encrypted workbooks. You can use only simple password protection against modifying (set in MS Excel 'Save As' dialog).");
            }
            if ((byCode != null) && (byCode.HandlerClass != typeof(XLSRecord)))
            {
                return((AbsXLSRec)Activator.CreateInstance(byCode.HandlerClass, new object[] { size, br, previousRecord, operationInfo }));
            }
            return(new XLSRecord(code, size, br));
        }
Esempio n. 2
0
 public SSTRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo)
     : base(staticDescriptor, bodyLength, br)
 {
     object[] arguments = base.GetArguments();
     this.TotalStringCount  = (int)((uint)arguments[0]);
     this.UniqueStringCount = (int)((uint)arguments[1]);
     base.ExcelStrings      = (ExcelLongStrings)arguments[2];
 }
Esempio n. 3
0
        public void Read(BinaryReader br, IoOperationInfo operationInfo)
        {
            AbsXLSRec previousRecord = null;

Label_0002:
            if (br.PeekChar() != -1)
            {
                try
                {
                    previousRecord = AbsXLSRec.Read(br, previousRecord, operationInfo);
                }
                catch (Exception exception)
                {
                    string message = exception.Message;
                }
                while (previousRecord != null)
                {
                    this.Add(previousRecord);
                    goto Label_0002;
                }
            }
        }
Esempio n. 4
0
 public ObjRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo) : base(staticDescriptor, bodyLength, br)
 {
     this.items = new ArrayList();
 }
Esempio n. 5
0
 public Window2Record(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo)
 {
     this.window2Options = (WorksheetWindowOptions)br.ReadUInt16();
     this.firstRow       = br.ReadUInt16();
     this.firstColumn    = br.ReadUInt16();
     if (bodyLength == 18)
     {
         this.smallRecord = false;
         br.ReadUInt16();
         br.ReadUInt16();
         this.pageBreakViewZoom = br.ReadUInt16();
         this.zoom = br.ReadUInt16();
         br.ReadUInt32();
     }
     else
     {
         if (bodyLength != 10)
         {
             throw new Exception("Internal error: Window2 record of size " + this.BodySize);
         }
         this.smallRecord = true;
         br.ReadUInt32();
     }
 }
Esempio n. 6
0
 public RowRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo) : base(bodyLength, br, previousRecord, operationInfo)
 {
 }
Esempio n. 7
0
 public ByteArrRec(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo)
 {
     this.data = br.ReadBytes(this.GetDescriptor().BodySize);
 }
Esempio n. 8
0
 public BoundSheetRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo)
     : base(staticDescriptor, bodyLength, br)
 {
     this.SheetName = (ExcelShortString)base.GetArguments()[3];
 }
Esempio n. 9
0
 public IndexRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo) : base(staticDescriptor, bodyLength, br)
 {
     this.FirstRow       = -1;
     this.LastRowPlusOne = -1;
     this.DBCells        = new ArrayList();
 }
Esempio n. 10
0
 public HorizontalPageBreaksRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo) : base(staticDescriptor, bodyLength, br)
 {
 }
Esempio n. 11
0
 public MsoBaseRecord(XLSDescriptor descriptor, int bodyLength, BinaryReader br, MsoType type, IoOperationInfo operationInfo) : base(descriptor, bodyLength, br)
 {
     this.type          = (ushort)type;
     this.operationInfo = operationInfo;
     this.Read(br);
 }
Esempio n. 12
0
 public MsoDrawingGroupRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo) : base(staticDescriptor, bodyLength, br)
 {
     this.continueTotalSize = 0;
     this.Read(bodyLength, br);
 }
Esempio n. 13
0
 public MsoDrawingRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo) : base(staticDescriptor, bodyLength, br)
 {
     this.arguments = base.GetArguments();
     this.Parent    = this.arguments[0] as MsoContainerRecord;
 }
Esempio n. 14
0
 public DBCellRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo)
     : base(staticDescriptor, bodyLength, br)
 {
     this.StartingCellsForRows = new ArrayList();
 }
Esempio n. 15
0
 public PaletteRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo) : base(staticDescriptor, bodyLength, br)
 {
 }
Esempio n. 16
0
 public MsoBitmapPictureRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo) : base(staticDescriptor, bodyLength, br, MsoType.Bitmap, operationInfo)
 {
     this.loadedFromExcel = true;
     base.Instance        = 1760;
 }
Esempio n. 17
0
 public RKRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo)
 {
     this.Header = new CellRecordHeader(br);
     this.Val    = br.ReadUInt32();
 }
Esempio n. 18
0
        public ContinueRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo) : base(staticDescriptor, bodyLength, br)
        {
            SSTRelated related = previousRecord as SSTRelated;

            if ((related != null) && (related.ExcelStrings != null))
            {
                using (MemoryStream stream = new MemoryStream(this.Body))
                {
                    using (BinaryReader reader = new BinaryReader(stream, new UnicodeEncoding()))
                    {
                        base.ExcelStrings = new ExcelLongStrings(reader, bodyLength, related.ExcelStrings);
                    }
                }
            }
        }