Example #1
0
 private void Read(int bodyLength, BinaryReader br)
 {
     if (bodyLength == 8224)
     {
         this.SkipContinueRecordsAndFillBody(br);
     }
     this.arguments = base.GetArguments();
     this.parent    = this.arguments[0] as MsoContainerRecord;
 }
Example #2
0
        private void SaveMsoDrawing(AbsXLSRecords records, MsoContainerRecord dgContainer)
        {
            XLSRecord         record;
            MsoDelayedRecords delayedRecords = new MsoDelayedRecords
            {
                Offset = 8
            };

            byte[] sourceArray = dgContainer.ConvertToBytes(delayedRecords);
            sourceArray[0] = 15;
            int sourceIndex = 0;

            if (delayedRecords.Lengths.Count > 0)
            {
                int num2  = 0;
                int count = delayedRecords.Lengths.Count;
                while (num2 < count)
                {
                    int       num4             = (int)delayedRecords.Lengths[num2];
                    ArrayList list             = (ArrayList)delayedRecords.DelayedRecords[num2];
                    int       length           = num4 - sourceIndex;
                    byte[]    destinationArray = new byte[length];
                    Array.Copy(sourceArray, sourceIndex, destinationArray, 0, length);
                    new OptimizedBuffer();
                    if (num4 > 8224)
                    {
                        MemoryStream input = new MemoryStream();
                        input.Write(BitConverter.GetBytes((ushort)length), 0, 2);
                        input.Write(destinationArray, 2, destinationArray.Length);
                        input.Position = 0L;
                        record         = new XLSRecord(60, destinationArray.Length + 2, new BinaryReader(input));
                        input.Close();
                    }
                    else
                    {
                        record = new MsoDrawingRecord();
                        (record as MsoDrawingRecord).Data = destinationArray;
                    }
                    sourceIndex = num4;
                    records.Add(record);
                    for (int i = 0; i < list.Count; i++)
                    {
                        XLSRecord record2 = (XLSRecord)list[i];
                        records.Add(record2);
                    }
                    num2++;
                }
            }
            else
            {
                record = new MsoDrawingRecord();
                (record as MsoDrawingRecord).Data = sourceArray;
                records.Add(record);
            }
        }
Example #3
0
        public override void Save(MsoContainerRecord spgrContainer, uint shapeId)
        {
            MsoContainerRecord item    = ImageRecordsFactory.CreateContainer(MsoType.SpContainer);
            MsofbtSpRecord     record2 = new MsofbtSpRecord {
                Parent   = spgrContainer,
                Instance = 1750
            };
            MsofbtOptRecord record3 = new MsofbtOptRecord();

            record2.ShapeId = shapeId;
            FopteStructure property = new FopteStructure();

            property = new FopteStructure {
                Id        = MsoOptions.LockAgainstSelect,
                UintValue = Convert.ToUInt32(true),
                IsValid   = true,
                IsComplex = false
            };
            record3.Add(property);
            property = new FopteStructure {
                Id        = MsoOptions.LockAdjustHandles,
                UintValue = Convert.ToUInt32(true),
                IsValid   = true,
                IsComplex = false
            };
            record3.Add(property);
            property = new FopteStructure {
                Id        = MsoOptions.LockAgainstGrouping,
                UintValue = Convert.ToUInt32(true),
                IsValid   = true,
                IsComplex = false
            };
            record3.Add(property);
            property = new FopteStructure {
                Id        = MsoOptions.BlipId,
                UintValue = (uint)base.Id,
                IsValid   = true,
                IsComplex = false
            };
            record3.Add(property);
            record3.Version  = 3;
            record3.Instance = 2;
            item.Add(record2);
            item.Add(record3);
            item.Add(base.GenerateClientAnchorRecord());
            spgrContainer.Add(item);
        }
Example #4
0
 private uint SaveShapes(MsoContainerRecord spgrContainer, uint shapeId)
 {
     foreach (ExcelShape shape in this.items)
     {
         if (shape is BitmapShape)
         {
             shape.Save(spgrContainer, shapeId);
             shapeId = this.GenerateUniqueShapeId();
         }
     }
     foreach (ExcelShape shape2 in this.items)
     {
         if (shape2 is CommentShape)
         {
             shape2.Save(spgrContainer, shapeId);
             shapeId = this.GenerateUniqueShapeId();
         }
     }
     return(shapeId);
 }
Example #5
0
        public override void Save(MsoContainerRecord spgrContainer, uint shapeId)
        {
            MsoContainerRecord parent = ImageRecordsFactory.CreateContainer(MsoType.SpContainer);
            MsofbtSpRecord     item   = new MsofbtSpRecord
            {
                Parent = spgrContainer
            };
            MsofbtClientDataRecord record3 = new MsofbtClientDataRecord
            {
                Parent = parent
            };
            CmoObjSubRecord subRecord = null;
            ObjRecord       record5   = new ObjRecord();

            subRecord = new CmoObjSubRecord();
            record5.Add(subRecord);
            record3.Add(record5);
            subRecord.ID  = (ushort)shapeId;
            item.Version  = 2;
            item.Instance = 202;
            parent.Add(item);
            MsofbtOptRecord options = new MsofbtOptRecord
            {
                Parent = parent
            };

            this.SaveIsVisibleOption(options);
            parent.Add(options);
            base.Left   = (this.column + 1) * 64;
            base.Top    = this.row * 17;
            base.Right  = base.Left + 100;
            base.Bottom = base.Top + 100;
            parent.Add(base.GenerateClientAnchorRecord());
            parent.Add(record3);
            parent.Add(this.GenerateClientTextBox(parent));
            spgrContainer.Add(parent);
            this.SaveNote(subRecord.ID);
        }
Example #6
0
 public void WriteOnDemand(AbsXLSRecords records)
 {
     if (this.Count != 0)
     {
         MsoContainerRecord dgContainer = ImageRecordsFactory.CreateContainer(MsoType.DgContainer);
         MsofbtDgRecord     item        = new MsofbtDgRecord
         {
             Parent = dgContainer
         };
         MsoContainerRecord record3 = ImageRecordsFactory.CreateContainer(MsoType.SpgrContainer);
         record3.Parent = dgContainer;
         MsoContainerRecord record4 = ImageRecordsFactory.CreateContainer(MsoType.SpContainer);
         record4.Parent = record3;
         MsofbtSpgrRecord record5 = new MsofbtSpgrRecord
         {
             Parent = record4
         };
         uint           shapeId = this.GenerateUniqueShapeId();
         MsofbtSpRecord record6 = new MsofbtSpRecord
         {
             Parent    = record5,
             ShapeId   = shapeId,
             IsTopMost = true
         };
         dgContainer.Add(item);
         dgContainer.Add(record3);
         record3.Add(record4);
         record4.Add(record5);
         record4.Add(record6);
         record4.Parent    = record3;
         shapeId           = this.SaveShapes(record3, shapeId);
         item.ShapesNumber = (uint)(this.Worksheet.Shapes.Count + 1);
         item.LastId       = shapeId;
         this.SaveMsoDrawing(records, dgContainer);
         this.SaveNotes(records);
     }
 }
Example #7
0
 public abstract void Save(MsoContainerRecord spgrContainer, uint shapeId);