Exemplo 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));
        }
Exemplo 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];
 }
Exemplo 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;
                }
            }
        }
Exemplo n.º 4
0
 public ObjRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo) : base(staticDescriptor, bodyLength, br)
 {
     this.items = new ArrayList();
 }
Exemplo 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();
     }
 }
Exemplo n.º 6
0
 public RowRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo) : base(bodyLength, br, previousRecord, operationInfo)
 {
 }
Exemplo n.º 7
0
 public ByteArrRec(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo)
 {
     this.data = br.ReadBytes(this.GetDescriptor().BodySize);
 }
Exemplo n.º 8
0
 public BoundSheetRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo)
     : base(staticDescriptor, bodyLength, br)
 {
     this.SheetName = (ExcelShortString)base.GetArguments()[3];
 }
Exemplo 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();
 }
Exemplo n.º 10
0
 public HorizontalPageBreaksRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo) : base(staticDescriptor, bodyLength, br)
 {
 }
Exemplo 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);
 }
Exemplo n.º 12
0
 public MsoDrawingGroupRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo) : base(staticDescriptor, bodyLength, br)
 {
     this.continueTotalSize = 0;
     this.Read(bodyLength, br);
 }
Exemplo 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;
 }
Exemplo n.º 14
0
 public DBCellRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo)
     : base(staticDescriptor, bodyLength, br)
 {
     this.StartingCellsForRows = new ArrayList();
 }
Exemplo n.º 15
0
 public PaletteRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo) : base(staticDescriptor, bodyLength, br)
 {
 }
Exemplo 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;
 }
Exemplo n.º 17
0
 public RKRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo)
 {
     this.Header = new CellRecordHeader(br);
     this.Val    = br.ReadUInt32();
 }
Exemplo 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);
                    }
                }
            }
        }