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); }
internal void MergeFromPxlGlobals(TWorkbookGlobals SourceGlobals) { sBOF = SourceGlobals.sBOF; FSST = SourceGlobals.FSST; FReferences = SourceGlobals.FReferences; FBoundSheets = SourceGlobals.FBoundSheets; //Pxl doesn't have styles. CellXF.MergeFromPxlXF(SourceGlobals.CellXF, Fonts.Count - 1, this, SourceGlobals); //-1 because fonts[0] will be merged FFonts.MergeFromPxlFont(SourceGlobals.Fonts); //Formats are added in FXF.Merge FNames = SourceGlobals.FNames; Window1 = SourceGlobals.Window1; CodePage = SourceGlobals.CodePage; Country = SourceGlobals.Country; }
public void EnsureRequiredRecords() { if (sBOF == null) { sBOF = TBOFRecord.CreateEmptyWorkbook(4); } if (sEOF == null) { sEOF = new TEOFRecord(); } if (Window1 == null) { Window1 = new TWindow1Record[1]; Window1[0] = new TWindow1Record(); } CellXF.EnsureMinimumCellXFs(this); StyleXF.EnsureMinimumStyles(Styles, this); }
internal int AddStyleFormat(TFlxFormat format, string StyleName) { if (!format.IsStyle) { format = (TFlxFormat)format.Clone(); format.IsStyle = true; } int OldFmt = Styles.GetStyle(StyleName); if (OldFmt >= 0 && OldFmt < StyleXF.Count) { TXFRecord XF1 = new TXFRecord(format, OldFmt == 0, this, false); StyleXF[OldFmt] = XF1; CellXF.UpdateChangedStyleInCellXF(OldFmt, XF1, false); return(OldFmt); } TXFRecord XFRec = new TXFRecord(format, false, this, false); StyleXF.Add(XFRec); return(StyleXF.Count - 1); }