예제 #1
0
        // Token: 0x060034B0 RID: 13488 RVA: 0x000EAA6C File Offset: 0x000E8C6C
        private void PreCoalesceRow(DocumentNode dn, ref bool fVMerged)
        {
            DocumentNodeArray rowsCells        = dn.GetRowsCells();
            RowFormat         rowFormat        = dn.FormatState.RowFormat;
            DocumentNode      parentOfType     = dn.GetParentOfType(DocumentNodeType.dnTable);
            ColumnStateArray  columnStateArray = (parentOfType != null) ? parentOfType.ColumnStateArray : null;
            int num = (rowsCells.Count < rowFormat.CellCount) ? rowsCells.Count : rowFormat.CellCount;
            int i   = 0;
            int j   = 0;

            while (j < num)
            {
                DocumentNode documentNode = rowsCells.EntryAt(j);
                CellFormat   cellFormat   = rowFormat.NthCellFormat(j);
                long         cellX        = cellFormat.CellX;
                if (cellFormat.IsVMerge)
                {
                    fVMerged = true;
                }
                if (cellFormat.IsHMergeFirst)
                {
                    for (j++; j < num; j++)
                    {
                        cellFormat = rowFormat.NthCellFormat(j);
                        if (cellFormat.IsVMerge)
                        {
                            fVMerged = true;
                        }
                        if (cellFormat.IsHMerge)
                        {
                            rowsCells.EntryAt(j).ColSpan = 0;
                        }
                    }
                }
                else
                {
                    j++;
                }
                if (columnStateArray != null)
                {
                    int num2 = i;
                    while (i < columnStateArray.Count)
                    {
                        ColumnState columnState = columnStateArray.EntryAt(i);
                        i++;
                        if (columnState.CellX == cellX || columnState.CellX > cellX)
                        {
                            break;
                        }
                    }
                    if (i - num2 > documentNode.ColSpan)
                    {
                        documentNode.ColSpan = i - num2;
                    }
                }
            }
        }
예제 #2
0
 // Token: 0x060034B1 RID: 13489 RVA: 0x000EABA4 File Offset: 0x000E8DA4
 private void ProcessTableRowSpan(DocumentNodeArray dnaTables)
 {
     for (int i = 0; i < dnaTables.Count; i++)
     {
         DocumentNode     documentNode     = dnaTables.EntryAt(i);
         ColumnStateArray columnStateArray = documentNode.ColumnStateArray;
         if (columnStateArray != null && columnStateArray.Count != 0)
         {
             int count = columnStateArray.Count;
             DocumentNodeArray tableRows         = documentNode.GetTableRows();
             DocumentNodeArray documentNodeArray = new DocumentNodeArray();
             for (int j = 0; j < count; j++)
             {
                 documentNodeArray.Add(null);
             }
             for (int k = 0; k < tableRows.Count; k++)
             {
                 DocumentNode      documentNode2 = tableRows.EntryAt(k);
                 RowFormat         rowFormat     = documentNode2.FormatState.RowFormat;
                 DocumentNodeArray rowsCells     = documentNode2.GetRowsCells();
                 int num = count;
                 if (rowFormat.CellCount < num)
                 {
                     num = rowFormat.CellCount;
                 }
                 if (rowsCells.Count < num)
                 {
                     num = rowsCells.Count;
                 }
                 int num2 = 0;
                 int num3 = 0;
                 while (num3 < num && num2 < documentNodeArray.Count)
                 {
                     DocumentNode documentNode3 = rowsCells.EntryAt(num3);
                     CellFormat   cellFormat    = rowFormat.NthCellFormat(num3);
                     if (cellFormat.IsVMerge)
                     {
                         DocumentNode documentNode4 = documentNodeArray.EntryAt(num2);
                         if (documentNode4 != null)
                         {
                             documentNode4.RowSpan++;
                         }
                         num2 += documentNode3.ColSpan;
                         documentNode3.ColSpan = 0;
                     }
                     else
                     {
                         if (cellFormat.IsVMergeFirst)
                         {
                             documentNode3.RowSpan   = 1;
                             documentNodeArray[num2] = documentNode3;
                         }
                         else
                         {
                             documentNodeArray[num2] = null;
                         }
                         for (int l = num2 + 1; l < num2 + documentNode3.ColSpan; l++)
                         {
                             documentNodeArray[l] = null;
                         }
                         num2 += documentNode3.ColSpan;
                     }
                     num3++;
                 }
             }
         }
     }
 }