public TextMasterStyle9Atom(BinaryReader _reader, uint size, uint typeCode, uint version, uint instance) : base(_reader, size, typeCode, version, instance) { uint level = this.Reader.ReadUInt16(); for (int i = 0; i < level; i++) { ParagraphMask pmask = (ParagraphMask)Reader.ReadUInt32(); ParagraphRun9 pr = new ParagraphRun9(); pr.mask = pmask; if ((pmask & ParagraphMask.BulletBlip) != 0) { int bulletblipref = Reader.ReadInt16(); pr.bulletblipref = bulletblipref; } if ((pmask & ParagraphMask.BulletHasScheme) != 0) { pr.fBulletHasAutoNumber = Reader.ReadInt16(); } if ((pmask & ParagraphMask.BulletScheme) != 0) { pr.bulletAutoNumberScheme = Reader.ReadUInt16(); pr.startAt = Reader.ReadInt16(); //start value } this.pruns.Add(pr); CharacterMask cmask = (CharacterMask)Reader.ReadUInt32(); if ((cmask & CharacterMask.pp11ext) != 0) { byte[] rest = Reader.ReadBytes(4); } } }
public StyleTextProp9Atom(BinaryReader _reader, uint size, uint typeCode, uint version, uint instance) : base(_reader, size, typeCode, version, instance) { while (Reader.BaseStream.Position < Reader.BaseStream.Length) { try { ParagraphRun9 pr = new ParagraphRun9(); ParagraphMask pmask = (ParagraphMask)Reader.ReadUInt32(); pr.mask = pmask; if ((pmask & ParagraphMask.BulletBlip) != 0) { int bulletblipref = Reader.ReadInt16(); pr.bulletblipref = bulletblipref; } if ((pmask & ParagraphMask.BulletHasScheme) != 0) { pr.fBulletHasAutoNumber = Reader.ReadInt16(); } if ((pmask & ParagraphMask.BulletScheme) != 0) { pr.bulletAutoNumberScheme = Reader.ReadInt16(); pr.startAt = Reader.ReadInt16(); //start value } P9Runs.Add(pr); CharacterMask cmask = (CharacterMask)Reader.ReadUInt32(); if ((cmask & CharacterMask.pp11ext) != 0) { byte[] rest = Reader.ReadBytes(4); } si = new TextSIException(Reader); } catch (Exception) { //ignore } } }
public ParagraphRun(BinaryReader reader, bool noIndentField) { try { this.IndentLevel = noIndentField ? (ushort)0 : reader.ReadUInt16(); this.Mask = (ParagraphMask)reader.ReadUInt32(); // Note: These appear in Mask as well -- there they are true // when the flag differs from the Master style. // The actual value for the differing flags is stored here. // (TODO: This is still a guess. Verify.) if (this.BulletFlagsFieldPresent) { this.BulletFlags = reader.ReadUInt16(); } if (this.BulletCharPresent) { this.BulletChar = (char)reader.ReadUInt16(); } if (this.BulletFontPresent) { this.BulletTypefaceIdx = reader.ReadUInt16(); } if (this.BulletSizePresent) { this.BulletSize = reader.ReadInt16(); } if (this.BulletColorPresent) { this.BulletColor = new GrColorAtom(reader); } if (this.AlignmentPresent) { this.Alignment = reader.ReadInt16(); } if (this.LineSpacingPresent) { this.LineSpacing = reader.ReadInt16(); } if (this.SpaceBeforePresent) { this.SpaceBefore = reader.ReadInt16(); } if (this.SpaceAfterPresent) { this.SpaceAfter = reader.ReadInt16(); } if (this.LeftMarginPresent) { this.LeftMargin = reader.ReadInt16(); } if (this.IndentPresent) { this.Indent = reader.ReadInt16(); } if (this.DefaultTabSizePresent) { this.DefaultTabSize = reader.ReadInt16(); } if (this.TabStopsPresent) { ushort tabStopsCount = reader.ReadUInt16(); this.TabStops = new TabStop[tabStopsCount]; for (int i = 0; i < tabStopsCount; i++) { this.TabStops[i] = new TabStop(reader); } } if (this.FontAlignPresent) { this.FontAlign = reader.ReadUInt16(); } if (this.LineBreakFlagsFieldPresent) { this.LineBreakFlags = reader.ReadUInt16(); } if (this.TextDirectionPresent) { this.TextDirection = reader.ReadUInt16(); } } catch (Exception e) { string s = e.ToString(); } //if (this.TabStopsPresent) //{ // UInt16 tabStopsCount = reader.ReadUInt16(); // this.TabStops = new TabStop[tabStopsCount]; // for (int i = 0; i < tabStopsCount; i++) // { // this.TabStops[i] = new TabStop(reader); // } //} }
public ParagraphRun(BinaryReader reader) { this.Length = reader.ReadUInt32(); this.IndentLevel = reader.ReadUInt16(); this.Mask = (ParagraphMask)reader.ReadUInt32(); // Note: These appear in Mask as well -- there they are true // when the flag differs from the Master style. // The actual value for the differing flags is stored here. // (TODO: This is still a guess. Verify.) if (this.BulletFlagsFieldPresent) { this.BulletFlags = reader.ReadUInt16(); } if (this.BulletCharPresent) { this.BulletChar = (char)reader.ReadUInt16(); } if (this.BulletTypefacePresent) { this.BulletTypefaceIdx = reader.ReadUInt16(); } if (this.BulletSizePresent) { this.BulletSize = reader.ReadInt16(); } if (this.BulletColorPresent) { this.BulletColor = new GrColorAtom(reader); } if (this.AlignmentPresent) { this.Alignment = reader.ReadInt16(); } if (this.LineSpacingPresent) { this.LineSpacing = reader.ReadInt16(); } if (this.SpaceBeforePresent) { this.SpaceBefore = reader.ReadInt16(); } if (this.SpaceAfterPresent) { this.SpaceAfter = reader.ReadInt16(); } if (this.LeftMarginPresent) { this.LeftMargin = reader.ReadInt16(); } if (this.IndentPresent) { this.Indent = reader.ReadInt16(); } if (this.DefaultTabSizePresent) { this.DefaultTabSize = reader.ReadInt16(); } if (this.TabStopsPresent) { UInt16 tabStopsCount = reader.ReadUInt16(); if (tabStopsCount != 0) { throw new NotImplementedException("Tab stop reading not yet implemented"); // TODO } } if (this.BaseLinePresent) { this.BaseLine = reader.ReadUInt16(); } if (this.LineBreakFlagsFieldPresent) { this.LineBreakFlags = reader.ReadUInt16(); } if (this.TextDirectionPresent) { this.TextDirection = reader.ReadUInt16(); } }