Ejemplo n.º 1
0
        // Token: 0x060036B1 RID: 14001 RVA: 0x000F5C6C File Offset: 0x000F3E6C
        internal void ValidateStructure(RowSpanVector rowSpanVector)
        {
            this.SetFlags(!rowSpanVector.Empty(), TableRow.Flags.HasForeignCells);
            this.SetFlags(false, TableRow.Flags.HasRealCells);
            this._formatCellCount = 0;
            this._columnCount     = 0;
            int num;
            int num2;

            rowSpanVector.GetFirstAvailableRange(out num, out num2);
            for (int i = 0; i < this._cells.Count; i++)
            {
                TableCell tableCell  = this._cells[i];
                int       columnSpan = tableCell.ColumnSpan;
                int       rowSpan    = tableCell.RowSpan;
                while (num + columnSpan > num2)
                {
                    rowSpanVector.GetNextAvailableRange(out num, out num2);
                }
                tableCell.ValidateStructure(num);
                if (rowSpan > 1)
                {
                    rowSpanVector.Register(tableCell);
                }
                else
                {
                    this._formatCellCount++;
                }
                num += columnSpan;
            }
            this._columnCount = num;
            bool flag = false;

            rowSpanVector.GetSpanCells(out this._spannedCells, out flag);
            if (this._formatCellCount > 0 || flag)
            {
                this.SetFlags(true, TableRow.Flags.HasRealCells);
            }
            this._formatCellCount += this._spannedCells.Length;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// ValidateStructure
        /// </summary>
        internal void ValidateStructure(RowSpanVector rowSpanVector)
        {
            Debug.Assert(rowSpanVector != null);

            SetFlags(!rowSpanVector.Empty(), Flags.HasForeignCells);
            SetFlags(false, Flags.HasRealCells);

            _formatCellCount = 0;
            _columnCount     = 0;

            int firstAvailableIndex;
            int firstOccupiedIndex;

            rowSpanVector.GetFirstAvailableRange(out firstAvailableIndex, out firstOccupiedIndex);
            for (int i = 0; i < _cells.Count; ++i)
            {
                TableCell cell = _cells[i];

                // Get cloumn span and row span. Row span is limited to the number of rows in the row group.
                // Since we do not know the number of columns in the table at this point, column span is limited only
                // by internal constants
                int columnSpan = cell.ColumnSpan;
                int rowSpan    = cell.RowSpan;

                while (firstAvailableIndex + columnSpan > firstOccupiedIndex)
                {
                    rowSpanVector.GetNextAvailableRange(out firstAvailableIndex, out firstOccupiedIndex);
                }

                Debug.Assert(i <= firstAvailableIndex);

                cell.ValidateStructure(firstAvailableIndex);

                if (rowSpan > 1)
                {
                    rowSpanVector.Register(cell);
                }
                else
                {
                    _formatCellCount++;
                }

                firstAvailableIndex += columnSpan;
            }

            _columnCount = firstAvailableIndex;

            bool isLastRowOfAnySpan = false;

            rowSpanVector.GetSpanCells(out _spannedCells, out isLastRowOfAnySpan);
            Debug.Assert(_spannedCells != null);

            if ((_formatCellCount > 0) ||
                isLastRowOfAnySpan == true)
            {
                SetFlags(true, Flags.HasRealCells);
            }

            _formatCellCount += _spannedCells.Length;

            Debug.Assert(_cells.Count <= _formatCellCount);
        }