Esempio n. 1
0
        private int SavePlex(FileInformationBlock fib, FieldsDocumentPart part,
                             PlexOfCps plexOfCps, HWPFStream outputStream)
        {
            if (plexOfCps == null || plexOfCps.Length == 0)
            {
                fib.SetFieldsPlcfOffset(part, outputStream.Offset);
                fib.SetFieldsPlcfLength(part, 0);
                return(0);
            }

            byte[] data = plexOfCps.ToByteArray();

            int start  = outputStream.Offset;
            int length = data.Length;

            outputStream.Write(data);

            fib.SetFieldsPlcfOffset(part, start);
            fib.SetFieldsPlcfLength(part, length);

            return(length);
        }
Esempio n. 2
0
        private int SavePlex(FileInformationBlock fib, FieldsDocumentPart part,
                PlexOfCps plexOfCps, HWPFStream outputStream)
        {
            if (plexOfCps == null || plexOfCps.Length == 0)
            {
                fib.SetFieldsPlcfOffset(part, outputStream.Offset);
                fib.SetFieldsPlcfLength(part, 0);
                return 0;
            }

            byte[] data = plexOfCps.ToByteArray();

            int start = outputStream.Offset;
            int length = data.Length;

            outputStream.Write(data);

            fib.SetFieldsPlcfOffset(part, start);
            fib.SetFieldsPlcfLength(part, length);

            return length;
        }