Example #1
0
        internal override void SaveToPxl(TPxlStream PxlStream, TPxlSaveData SaveData)
        {
            if ((sBOF == null) || (sEOF == null))
            {
                XlsMessages.ThrowException(XlsErr.ErrSectionNotLoaded);
            }

            sBOF.SaveToPxl(PxlStream, 0, SaveData);

            foreach (TWindow1Record w1 in Window1)
            {
                if (w1 != null)
                {
                    w1.SaveToPxl(PxlStream, 0, SaveData);
                }
            }

            Fonts.SaveToPxl(PxlStream, 0, SaveData);
            Formats.SaveToPxl(PxlStream, 0, SaveData);
            CellXF.SaveToPxl(PxlStream, 0, SaveData);

            FBoundSheets.SaveToPxl(PxlStream, SaveData);
            FNames.SaveToPxl(PxlStream, 0, SaveData); //Should be after FBoundSheets.SaveToStream
            sEOF.SaveToPxl(PxlStream, 0, SaveData);
        }
Example #2
0
        internal void SaveToPxl(TPxlStream PxlStream, TPxlSaveData SaveData)
        {
            if (ActiveRow > FlxConsts.Max_PxlRows)
            {
                return;
            }
            if (ActiveCol > FlxConsts.Max_PxlColumns)
            {
                return;
            }

            TXlsCellRange Selection = new TXlsCellRange(ActiveRow, ActiveCol, ActiveRow, ActiveCol);

            if (SelectedCells != null && SelectedCells.Length > 0)
            {
                TXlsCellRange Selection2 = SelectedCells[0];
                if (Selection2.Left >= 0 && Selection2.Right <= FlxConsts.Max_PxlColumns && Selection2.Left <= Selection2.Right)
                {
                    if (Selection2.Top >= 0 && Selection2.Bottom <= FlxConsts.Max_PxlRows && Selection2.Top <= Selection2.Bottom)
                    {
                        Selection = Selection2;
                    }
                }
            }

            PxlStream.WriteByte((byte)pxl.SELECTION);
            PxlStream.Write16((UInt16)Selection.Top);
            PxlStream.WriteByte((byte)Selection.Left);
            PxlStream.Write16((UInt16)Selection.Bottom);
            PxlStream.WriteByte((byte)Selection.Right);

            PxlStream.Write16((UInt16)ActiveRow);
            PxlStream.WriteByte((byte)ActiveCol);
        }
Example #3
0
        internal void SaveToPxl(TPxlStream PxlStream, TPxlSaveData SaveData)
        {
            TDefColWidthRecord.SaveToPxl(PxlStream, DefColWidthChars);
            //Pxl needs the full 255 columns defined, starting at 0 and ending af 255.
            int LastCol = FlxConsts.Max_Columns97_2003 + 1;
            int i       = 0;
            int k       = i;

            while (i <= LastCol)
            {
                k = i + 1;
                while (k <= LastCol && IsEqual(this[k], this[i]))
                {
                    k++;
                }
                if (PxlStream != null)
                {
                    SaveOnePxlRecord(i, k - 1, PxlStream, SaveData);
                }
                i = k;
            }

            if (k < LastCol && (PxlStream != null))
            {
                SaveOnePxlRecord(k, FlxConsts.Max_Columns97_2003, PxlStream, SaveData);
            }
        }
Example #4
0
        private void SaveOnePxlRecord(int i, int k, TPxlStream PxlStream, TPxlSaveData SaveData)
        {
            //We need to ensure this[i] is not bigger than Maxcolumns. this[k] can be=Maxcolumns+1.
            if (i > FlxConsts.Max_Columns97_2003)
            {
                return;
            }
            //really for pxl k should be Maxcolumns only
            if (k > FlxConsts.Max_Columns97_2003)
            {
                k = FlxConsts.Max_Columns97_2003;
            }

            PxlStream.WriteByte((byte)pxl.COLINFO);
            PxlStream.Write16((UInt16)i);
            PxlStream.Write16((UInt16)k);
            if (this[i] == null)
            {
                PxlStream.Write16((UInt16)0x900);             //width
                PxlStream.Write16((UInt16)0);                 //xf
                PxlStream.WriteByte((byte)(0));               //options
            }
            else
            {
                PxlStream.Write16((UInt16)this[i].Width);
                PxlStream.Write16(SaveData.GetBiff8FromCellXF(this[i].XF));
                PxlStream.WriteByte((byte)(this[i].Options & 1));
            }
        }
Example #5
0
 internal void SaveToPxl(TPxlStream PxlStream, TPxlSaveData SaveData)
 {
     for (int i = 0; i < Count; i++)
     {
         FList[i].SaveToPxl(PxlStream, SaveData);
     }
 }
Example #6
0
 internal override void SaveToPxl(TPxlStream PxlStream, int Row, TPxlSaveData SaveData)
 {
     base.SaveToPxl(PxlStream, Row, SaveData);
     if (!PxlRecordIsValid(Row))
     {
         return;
     }
     SaveToPxl(PxlStream, Row, Col, XF, AsString, SaveData);
 }
Example #7
0
        internal void SaveToPxl(TPxlStream PxlStream, TPxlSaveData SaveData)
        {
            TPaneSelection Pane = Panes[3];

            if (Pane == null)
            {
                return;
            }
            Pane.SaveToPxl(PxlStream, SaveData);
        }
Example #8
0
        internal void SaveToPxl(TPxlStream PxlStream)
        {
            FixRows(); //Should be before calculating the offset. it is needed because some non-excel generated files might not have all rows.
            FixSheetVisible();

            TPxlSaveData SaveData = new TPxlSaveData(FGlobals);

            FGlobals.SaveToPxl(PxlStream, SaveData);
            FSheets.SaveToPxl(PxlStream, SaveData);
        }
Example #9
0
 internal override void SaveToPxl(TPxlStream PxlStream, int Row, TPxlSaveData SaveData)
 {
     base.SaveToPxl(PxlStream, Row, SaveData);
     if (OptionFlags2 != 0x00)
     {
         return;                       //Only worksheets.
     }
     PxlStream.WriteByte((byte)pxl.BOUNDSHEET);
     PxlStream.WriteByte(0); //reserved
     PxlStream.WriteString8(SheetName);
 }
Example #10
0
        internal override void SaveToPxl(TPxlStream PxlStream, int Row, TPxlSaveData SaveData)
        {
            base.SaveToPxl(PxlStream, Row, SaveData);
            PxlStream.WriteByte((byte)pxl.PANE);

            PxlStream.Write16((UInt16)ColSplit);
            PxlStream.Write16((UInt16)RowSplit);
            PxlStream.Write16((UInt16)FirstVisibleRow);
            PxlStream.Write16((UInt16)FirstVisibleCol);
            PxlStream.WriteByte((byte)ActivePane);
        }
Example #11
0
        internal override void SaveToPxl(TPxlStream PxlStream, int Row, TPxlSaveData SaveData)
        {
            base.SaveToPxl(PxlStream, Row, SaveData);
            int bType = BOFType;

            Debug.Assert(bType == 0x05 || bType == 0x10, "Only streams valid on Pxl are Globals and Worksheets");
            PxlStream.WriteByte((byte)pxl.BOF);

            PxlStream.Write16(0x010F); //Pxl 2.0
            PxlStream.Write16((UInt16)bType);
        }
Example #12
0
 internal override void SaveToPxl(TPxlStream PxlStream, int Row, TPxlSaveData SaveData)
 {
     base.SaveToPxl(PxlStream, Row, SaveData);
     PxlStream.WriteByte((byte)pxl.BOOLERR);
     PxlStream.Write16((UInt16)Row);
     PxlStream.WriteByte((byte)Col);
     PxlStream.Write16(SaveData.GetBiff8FromCellXF(XF));
     byte[] b = new byte[2];
     b[0] = BoolErr;
     b[1] = ErrFlag;
     PxlStream.Write(b, 0, 2);
 }
Example #13
0
        internal override void SaveToPxl(TPxlStream PxlStream, int Row, TPxlSaveData SaveData)
        {
            base.SaveToPxl(PxlStream, Row, SaveData);
            if (!PxlRecordIsValid(Row))
            {
                return;
            }

            PxlStream.WriteByte((byte)pxl.BLANK);
            PxlStream.Write16((UInt16)Row);
            PxlStream.WriteByte((byte)Col);
            PxlStream.Write16(SaveData.GetBiff8FromCellXF(XF));
        }
Example #14
0
        public virtual void SaveToPxl(TPxlStream PxlStream, int Row, TPxlSaveData SaveData)
        {
            int aCount = FList.Count;

            for (int i = 0; i < aCount; i++)
            {
                T it = (T)FList[i];
                if (it != null)
                {
                    it.SaveToPxl(PxlStream, Row, SaveData);
                }
            }
        }
Example #15
0
        internal override void SaveToPxl(TPxlStream PxlStream, int Row, TPxlSaveData SaveData)
        {
            base.SaveToPxl(PxlStream, Row, SaveData);
            if (!PxlRecordIsValid(Row))
            {
                return;
            }

            PxlStream.WriteByte((byte)pxl.NUMBER);
            PxlStream.Write16((UInt16)Row);
            PxlStream.WriteByte((byte)Col);
            PxlStream.Write16(SaveData.GetBiff8FromCellXF(XF));
            PxlStream.Write(BitConverter.GetBytes(NumValue), 0, 8);
        }
Example #16
0
 internal abstract void SaveToPxl(TPxlStream PxlStream, TPxlSaveData SaveData);
Example #17
0
 internal override void SaveToPxl(TPxlStream PxlStream, int Row, TPxlSaveData SaveData)
 {
     base.SaveToPxl(PxlStream, Row, SaveData);
     PxlStream.WriteByte((byte)pxl.EOF);
 }
Example #18
0
 internal void SaveToPxl(TPxlStream PxlStream, TPxlSaveData SaveData)
 {
     FBoundSheets.SaveToPxl(PxlStream, 0, SaveData);
 }
Example #19
0
 public override void SaveToPxl(TPxlStream PxlStream, int Row, TPxlSaveData SaveData)
 {
     base.SaveToPxl(PxlStream, Row, SaveData);
 }
Example #20
0
 internal static void SaveToPxl(TPxlStream PxlStream, int Row, int Col, int XF, string LabelValue, TPxlSaveData SaveData)
 {
     PxlStream.WriteByte((byte)pxl.LABEL);
     PxlStream.Write16((UInt16)Row);
     PxlStream.WriteByte((byte)Col);
     PxlStream.Write16(SaveData.GetBiff8FromCellXF(XF));
     if (LabelValue == null)
     {
         LabelValue = String.Empty;
     }
     if (LabelValue.Length > 255)
     {
         LabelValue = LabelValue.Substring(0, 255);
     }
     PxlStream.WriteString16(LabelValue);
 }