Ejemplo n.º 1
0
        internal void WriteTo(BinaryWriter tableWriter, BinaryWriter mainWriter, int lastCp)
        {
            tableWriter.Write(0);
            int count = m_cpOffsets.Count;

            for (int i = 0; i < count; i++)
            {
                tableWriter.Write(m_cpOffsets[i]);
            }
            tableWriter.Write(lastCp);
            SprmBuffer sprmBuffer = m_grpprl;

            if (UseTitlePage)
            {
                SprmBuffer obj = (SprmBuffer)m_grpprl.Clone();
                obj.AddSprm(12298, 1, null);
                sprmBuffer = obj;
            }
            for (int j = 0; j < count + 1; j++)
            {
                tableWriter.Write(new byte[2]);
                tableWriter.Write((int)mainWriter.BaseStream.Position);
                tableWriter.Write(new byte[6]);
                if (j == 1)
                {
                    sprmBuffer = m_grpprl;
                    AddSprm(12297, 0, null);
                }
                mainWriter.Write((short)sprmBuffer.Offset);
                mainWriter.Write(sprmBuffer.Buf);
            }
        }
Ejemplo n.º 2
0
        public object Clone()
        {
            SprmBuffer sprmBuffer = new SprmBuffer(m_grpprl.Length, m_initialOffset);

            sprmBuffer.m_offset = m_offset;
            Array.Copy(m_grpprl, sprmBuffer.m_grpprl, m_offset);
            return(sprmBuffer);
        }
Ejemplo n.º 3
0
 internal TableData(int tableLevel, bool layoutTable)
 {
     m_tapx = new SprmBuffer(2048, 2);
     m_tapx.AddSprm(9238, 1, null);
     m_tapx.AddSprm((ushort)((tableLevel > 1) ? 9292 : 9239), 1, null);
     m_tapx.AddSprm(26185, tableLevel, null);
     m_tableBorders    = new BorderCode[4];
     m_tableBorders[0] = new BorderCode();
     m_tableBorders[1] = new BorderCode();
     m_tableBorders[2] = new BorderCode();
     m_tableBorders[3] = new BorderCode();
     m_cellBorders     = new BorderCode[4];
     m_cellBorders[0]  = new BorderCode();
     m_cellBorders[1]  = new BorderCode();
     m_cellBorders[2]  = new BorderCode();
     m_cellBorders[3]  = new BorderCode();
     m_layoutTable     = layoutTable;
 }
        internal void CommitParagraph(int cpEnd, TableData currentRow, Stream dataStream)
        {
            byte[] array = m_grpprl.Buf;
            int    num   = m_grpprl.Offset;

            if (currentRow != null)
            {
                array = currentRow.Tapx;
                num   = array.Length;
                if (num >= 488)
                {
                    int          param        = (int)dataStream.Length;
                    BinaryWriter binaryWriter = new BinaryWriter(dataStream);
                    binaryWriter.Write((ushort)(array.Length - 2));
                    binaryWriter.Write(array, 2, array.Length - 2);
                    binaryWriter.Flush();
                    SprmBuffer sprmBuffer = new SprmBuffer(8, 2);
                    sprmBuffer.AddSprm(26182, param, null);
                    array = sprmBuffer.Buf;
                    num   = sprmBuffer.Offset;
                }
            }
            if (!AddPropToPapFkp(m_papFkp, cpEnd, m_papFcOffset, new byte[13], m_papOffsetOffset, array, num, m_papGrpprlOffset))
            {
                m_papTable.Write(m_papFkp, 0, m_papFkp.Length);
                m_papOffsets.Add(m_parStart * 2 + m_fcStart);
                Array.Clear(m_papFkp, 0, m_papFkp.Length);
                LittleEndian.PutInt(m_papFkp, m_parStart * 2 + m_fcStart);
                m_papFcOffset     = 4;
                m_papOffsetOffset = m_papFcOffset;
                m_papGrpprlOffset = 510;
                AddPropToPapFkp(m_papFkp, cpEnd, m_papFcOffset, new byte[13], m_papOffsetOffset, array, num, m_papGrpprlOffset);
            }
            m_papFkp[511]++;
            m_papFcOffset     += 4;
            m_papOffsetOffset += 17;
            int num2 = num + 1;

            m_papGrpprlOffset = m_papGrpprlOffset - num2 - num2 % 2;
            m_parStart        = cpEnd;
            m_grpprl.ClearStyle();
            m_grpprl.Reset();
        }
Ejemplo n.º 5
0
 internal void Push(int bufSize)
 {
     m_formatStack.Push(m_grpprl);
     m_grpprl = new SprmBuffer(bufSize, 0);
 }