private void LoadStsh(Stream wordDocumentStream, STSH stsh) { styleDefinitionsMap = new Dictionary<ushort, StyleDefinition>(); for (ushort istd = 0; istd < stsh.rglpstd.Length; istd++) { STD std = stsh.rglpstd[istd]; if (std == null) continue; // skip empty StyleDefinition def = new StyleDefinition(this, std); styleDefinitionsMap.Add(istd, def); } // global/default properties List<Prl> defaultPrls = new List<Prl>(); short ftcBi = stsh.stshi.ftcBi; // sprmCFtcBi defaultPrls.Add(new Prl(SinglePropertyModifiers.sprmCFtcBi, BitConverter.GetBytes(ftcBi))); short ftcAsci = stsh.stshi.stshif.ftcAsci; // sprmCRgFtc0 defaultPrls.Add(new Prl(SinglePropertyModifiers.sprmCRgFtc0, BitConverter.GetBytes(ftcAsci))); short ftcFE = stsh.stshi.stshif.ftcFE; // sprmCRgFtc1 defaultPrls.Add(new Prl(SinglePropertyModifiers.sprmCRgFtc1, BitConverter.GetBytes(ftcFE))); short ftcOther = stsh.stshi.stshif.ftcOther; // sprmCRgFtc2 defaultPrls.Add(new Prl(SinglePropertyModifiers.sprmCRgFtc2, BitConverter.GetBytes(ftcOther))); this.defaultPrls = defaultPrls.ToArray(); }
internal static STSH ReadStsh(Stream s, uint stshLength) { int read; STSH stsh = new STSH(); read = 0; ushort cbStshi = BitConverter.ToUInt16(ReadUtils.ReadExact(s, ReadUtils.WordSize, ref read), 0); int readPortion; Stshi stshi = ReadStshi(s, cbStshi, out readPortion); read += readPortion; stsh.stshi = stshi; stsh.rglpstd = new STD[stsh.stshi.stshif.cstd]; for (int i = 0; i < stsh.rglpstd.Length; i++) { ushort cbStd = BitConverter.ToUInt16(ReadUtils.ReadExact(s, ReadUtils.WordSize, ref read), 0); if (cbStd > 0) { STD std = ReadStd(s, cbStd, stshi.stshif.cbSTDBaseInFile, out readPortion); stsh.rglpstd[i] = std; read += readPortion; } } return stsh; }