XPTable.Models.Table.GetWholeLineFlags C# (CSharp) Method

GetWholeLineFlags() private method

Returns a set of flags, one per column, that indicate whether the column can have its RHS vertical gridline drawn as an unbroken line.
private GetWholeLineFlags ( int columns ) : List
columns int
return List
        private List<bool> GetWholeLineFlags(int columns)
        {
            // For each column, can we show the entire vertical gridline?
            List<bool> wholeLineFlags = CreateNewBoolList(columns);

            int topRow = TopIndex;
            if (topRow < 0)
            {
                topRow = 0;
            }

            int bottomRow = this.RowIndexAt(0, this.CellDataRect.Bottom);

            var maxRowIndex = this.TableModel.Rows.Count - 1;
            if (bottomRow > maxRowIndex)
            {
                bottomRow = maxRowIndex;
            }

            // Go through each row, and see if it has any colspans that mean we can't draw
            // the vertical gridline as one long line
            for (int irow = topRow; irow < bottomRow; irow++)
            {
                Row row = this.TableModel.Rows[irow];
                if (row == null)
                {
                    continue;
                }

                var flags = row.InternalGridLineFlags;
                if (flags == null)
                {
                    continue;
                }

                // Fix by schoetbi: [PATCH 3/6] Fixed index out of range exception
                int loopTo = Math.Min(flags.Length, columns);
                for (int col = 0; col < loopTo; col++)
                {
                    if (!flags[col])
                    {
                        wholeLineFlags[col] = false;
                    }
                }
            }
            return wholeLineFlags;
        }
Table