Beispiel #1
0
        private void Read(byte[] tableStream, FileInformationBlock fib)
        {
            int namesStart  = fib.GetFcSttbfbkmk();
            int namesLength = fib.GetLcbSttbfbkmk();

            if (namesStart != 0 && namesLength != 0)
            {
                this.names = SttbfUtils.Read(tableStream, namesStart);
            }

            int firstDescriptorsStart  = fib.GetFcPlcfbkf();
            int firstDescriptorsLength = fib.GetLcbPlcfbkf();

            if (firstDescriptorsStart != 0 && firstDescriptorsLength != 0)
            {
                descriptorsFirst = new PlexOfCps(tableStream,
                                                 firstDescriptorsStart, firstDescriptorsLength,
                                                 BookmarkFirstDescriptor.GetSize());
            }

            int limDescriptorsStart  = fib.GetFcPlcfbkl();
            int limDescriptorsLength = fib.GetLcbPlcfbkl();

            if (limDescriptorsStart != 0 && limDescriptorsLength != 0)
            {
                descriptorsLim = new PlexOfCps(tableStream, limDescriptorsStart,
                                               limDescriptorsLength, 0);
            }
        }
Beispiel #2
0
        public void WriteSttbfBkmk(FileInformationBlock fib,
                                   HWPFStream tableStream)
        {
            if (names == null || names.Length == 0)
            {
                fib.SetFcSttbfbkmk(0);
                fib.SetLcbSttbfbkmk(0);
                return;
            }

            int start = tableStream.Offset;

            SttbfUtils.Write(tableStream, names);
            int end = tableStream.Offset;

            fib.SetFcSttbfbkmk(start);
            fib.SetLcbSttbfbkmk(end - start);
        }