コード例 #1
0
        private void LoadContent(Stream wordDocumentStream, Stream tableStream, Fib fib)
        {
            // reading text. p.35
            uint clxOffset = ((FibRbFcLcb97)fib.fibRgFcLcbBlob).fcClx;
            tableStream.Position = clxOffset;
            uint clxLength = ((FibRbFcLcb97)fib.fibRgFcLcbBlob).lcbClx;
            Clx clx = BasicTypesReader.ReadClx(tableStream, (int)clxLength);

            LoadCharacters(wordDocumentStream, clx);

            // reading paragraphs p.36
            uint plcfBtePapxOffset = ((FibRbFcLcb97)fib.fibRgFcLcbBlob).fcPlcfBtePapx;
            tableStream.Position = plcfBtePapxOffset;
            uint plcfBtePapxLength = ((FibRbFcLcb97)fib.fibRgFcLcbBlob).lcbPlcfBtePapx;
            PlcBtePapx plcfBtePapx = BasicTypesReader.ReadPlcfBtePapx(tableStream, plcfBtePapxLength);

            LoadParagraphs(wordDocumentStream, clx, plcfBtePapx);

            // reading character formattings p.43
            uint plcfBteChpxOffset = ((FibRbFcLcb97)fib.fibRgFcLcbBlob).fcPlcfBteChpx;
            tableStream.Position = plcfBteChpxOffset;
            uint plcfBteChpxLength = ((FibRbFcLcb97)fib.fibRgFcLcbBlob).lcbPlcfBteChpx;
            PlcBteChpx plcBteChpx = BasicTypesReader.ReadPlcBteChpx(tableStream, plcfBteChpxLength);
            LoadCharacterFormatting(wordDocumentStream, plcBteChpx);

            // reading styles p.46
            uint stshOffset = ((FibRbFcLcb97)fib.fibRgFcLcbBlob).fcStshf;
            tableStream.Position = stshOffset;
            uint stshLength = ((FibRbFcLcb97)fib.fibRgFcLcbBlob).lcbStshf;
            STSH stsh = BasicTypesReader.ReadStsh(tableStream, stshLength);
            LoadStsh(wordDocumentStream, stsh);
        }
コード例 #2
0
        internal static Fib ReadFib(Stream s)
        {
            Fib fib = new Fib();
            fib.@base = ReadFibBase(s);
            fib.csw = BitConverter.ToUInt16(ReadUtils.ReadExact(s, ReadUtils.WordSize), 0);
            fib.fibRgW = ReadFibRgW97(s, fib.csw);
            fib.cslw = BitConverter.ToUInt16(ReadUtils.ReadExact(s, ReadUtils.WordSize), 0);
            fib.fibRgLw = ReadFibRgLw97(s, fib.cslw);
            fib.cbRgFcLcb = BitConverter.ToUInt16(ReadUtils.ReadExact(s, ReadUtils.WordSize), 0);
            fib.fibRgFcLcbBlob = ReadFibRgFcLcbBlob(s, [email protected], fib.cbRgFcLcb);
            fib.cswNew = BitConverter.ToUInt16(ReadUtils.ReadExact(s, ReadUtils.WordSize), 0);
            fib.fibRgCswNew = ReadFibRgCswNew(s, [email protected], fib.cswNew);

            return fib;
        }
コード例 #3
0
 static string GetTableStreamName(Fib fib)
 {
     return [email protected] ? "1Table" : "0Table";
 }