private static void FillXArray(RPLItemMeasurement[] reportItemCol, float parentWidth, List <float> leftPosition)
        {
            int                num                = 0;
            int                num2               = 0;
            RoundedFloat       roundedFloat       = new RoundedFloat(0f);
            RPLItemMeasurement rPLItemMeasurement = null;
            int                num3               = 0;

            if (reportItemCol != null && leftPosition != null)
            {
                leftPosition.Add(roundedFloat.Value);
                while (num3 < reportItemCol.Length)
                {
                    rPLItemMeasurement = reportItemCol[num3];
                    if (PageTableLayout.SkipReportItem(rPLItemMeasurement))
                    {
                        num3++;
                    }
                    else
                    {
                        RoundedFloat x = new RoundedFloat(rPLItemMeasurement.Left);
                        while (num > 0 && x < leftPosition[num])
                        {
                            num--;
                        }
                        if (num < 0 || x != leftPosition[num])
                        {
                            leftPosition.Insert(num + 1, rPLItemMeasurement.Left);
                            num2++;
                        }
                        num = num2;
                        roundedFloat.Value = PageTableLayout.ReportItemRightValue(rPLItemMeasurement);
                        while (num > 0 && roundedFloat < leftPosition[num])
                        {
                            num--;
                        }
                        if (num < 0 || roundedFloat != leftPosition[num])
                        {
                            leftPosition.Insert(num + 1, roundedFloat.Value);
                            num2++;
                        }
                        num = num2;
                        num3++;
                    }
                }
                RoundedFloat x2 = new RoundedFloat(parentWidth);
                if (!(x2 > leftPosition[num]) && 1 != leftPosition.Count)
                {
                    return;
                }
                leftPosition.Insert(num + 1, parentWidth);
            }
        }
        private static void FillYArray(RPLItemMeasurement[] repItemColl, float parentHeight, List <float> topPosition, float delta)
        {
            int                num                = 0;
            int                num2               = 0;
            RoundedFloat       roundedFloat       = new RoundedFloat(0f);
            int                num3               = 0;
            RPLItemMeasurement rPLItemMeasurement = null;

            if (repItemColl != null && topPosition != null)
            {
                topPosition.Add(roundedFloat.Value);
                while (num3 < repItemColl.Length)
                {
                    rPLItemMeasurement = repItemColl[num3];
                    if (PageTableLayout.SkipReportItem(rPLItemMeasurement))
                    {
                        num3++;
                    }
                    else
                    {
                        RoundedFloat roundedFloat2 = new RoundedFloat(rPLItemMeasurement.Top - delta);
                        while (num > 0 && roundedFloat2 < topPosition[num])
                        {
                            num--;
                        }
                        if (num < 0 || roundedFloat2 != topPosition[num])
                        {
                            topPosition.Insert(num + 1, roundedFloat2.Value - delta);
                            num2++;
                        }
                        num = num2;
                        roundedFloat.Value = PageTableLayout.ReportItemBottomValue(rPLItemMeasurement) - delta;
                        while (num > 0 && roundedFloat < topPosition[num])
                        {
                            num--;
                        }
                        if (num < 0 || roundedFloat != topPosition[num])
                        {
                            topPosition.Insert(num + 1, roundedFloat.Value);
                            num2++;
                        }
                        num = num2;
                        num3++;
                    }
                }
                RoundedFloat x = new RoundedFloat(parentHeight - delta);
                if (!(x > topPosition[num]) && 1 != topPosition.Count)
                {
                    return;
                }
                topPosition.Insert(num + 1, parentHeight - delta);
            }
        }
        public static void GenerateTableLayout(RPLItemMeasurement[] repItemCollection, float ownerWidth, float ownerHeight, float delta, out PageTableLayout tableLayout, bool expandLayout, bool consumeContainerWhiteSpace)
        {
            List <float> list  = new List <float>();
            List <float> list2 = new List <float>();
            int          num   = 0;
            int          num2  = 0;

            tableLayout = null;
            if (repItemCollection != null)
            {
                PageTableLayout.FillXArray(repItemCollection, ownerWidth, list);
                PageTableLayout.FillYArray(repItemCollection, ownerHeight, list2, delta);
                num  = list.Count - 1;
                num2 = list2.Count - 1;
                if (num > 0 && num2 > 0)
                {
                    tableLayout = new PageTableLayout(num, num2);
                    for (int i = 0; i <= num2 - 1; i++)
                    {
                        for (int j = 0; j <= num - 1; j++)
                        {
                            tableLayout.AddCell(list[j], list2[i], list[j + 1] - list[j], list2[i + 1] - list2[i]);
                        }
                    }
                    tableLayout.AttachReportItems(repItemCollection, (double)delta, consumeContainerWhiteSpace);
                    num  = tableLayout.NrCols;
                    num2 = tableLayout.NrRows;
                    if (num <= 0 || num2 <= 0)
                    {
                        tableLayout = null;
                    }
                    else if (num == 1 && num2 == repItemCollection.Length)
                    {
                        int k;
                        for (k = 0; k < num2 && tableLayout.GetCell(k).InUse; k++)
                        {
                        }
                        tableLayout.BandTable = ((byte)((k >= num2) ? 1 : 0) != 0);
                    }
                }
            }
        }
 public static void GenerateTableLayout(RPLItemMeasurement[] repItemCollection, float ownerWidth, float ownerHeight, float delta, out PageTableLayout tableLayout)
 {
     PageTableLayout.GenerateTableLayout(repItemCollection, ownerWidth, ownerHeight, delta, out tableLayout, false, false);
 }
        private void FillAndFindOverlap(RPLItemMeasurement[] repItemCollection, double delta)
        {
            bool               flag               = false;
            int                num                = -1;
            int                num2               = -1;
            int                colSpan            = 0;
            int                rowSpan            = 0;
            int                num3               = 0;
            PageTableCell      pageTableCell      = null;
            int                num4               = 0;
            RPLItemMeasurement rPLItemMeasurement = null;
            RPLElement         rPLElement         = null;

            while (num4 < repItemCollection.Length)
            {
                num  = -1;
                num2 = -1;
                flag = false;
                rPLItemMeasurement = repItemCollection[num4];
                if (PageTableLayout.SkipReportItem(rPLItemMeasurement))
                {
                    num4++;
                }
                else
                {
                    rPLElement = rPLItemMeasurement.Element;
                    flag       = this.FindRItemCell(rPLItemMeasurement, ref num, ref num2, delta);
                    if (!flag && !(rPLElement is RPLLine))
                    {
                        num4++;
                    }
                    else
                    {
                        RPLLine rPLLine = rPLElement as RPLLine;
                        if (rPLLine != null)
                        {
                            RPLElementPropsDef elementPropsDef = rPLLine.ElementPropsDef;
                            float width = rPLItemMeasurement.Width;
                            if (width >= 0.0 && width < 0.0099999997764825821)
                            {
                                goto IL_00b8;
                            }
                            if (width < 0.0 && width > -0.0099999997764825821)
                            {
                                goto IL_00b8;
                            }
                            width = rPLItemMeasurement.Height;
                            if (width >= 0.0 && width < 0.0099999997764825821)
                            {
                                goto IL_0176;
                            }
                            if (width < 0.0 && width > -0.0099999997764825821)
                            {
                                goto IL_0176;
                            }
                        }
                        num3          = num + this.m_nrCols * num2;
                        pageTableCell = this.m_tableGrid[num3];
                        if ((pageTableCell.InUse || pageTableCell.Eaten) && rPLElement is RPLLine && rPLItemMeasurement.Width != 0.0 && rPLItemMeasurement.Height != 0.0)
                        {
                            num4++;
                            continue;
                        }
                        this.ComputeColRowSpan(rPLItemMeasurement, num, num2, ref colSpan, ref rowSpan);
                        this.AttachRItem(num, num2, colSpan, rowSpan, rPLItemMeasurement);
                        num4++;
                    }
                }
                continue;
IL_00b8:
                if (!flag)
                {
                    int  num5  = 0;
                    bool flag2 = true;
                    while (flag2 && num5 < this.m_nrRows)
                    {
                        if (this.m_tableGrid[num5 * this.m_nrCols].YValue == (float)((double)rPLItemMeasurement.Top - delta))
                        {
                            num2  = num5;
                            flag2 = false;
                        }
                        num5++;
                    }
                    num = this.m_nrCols - 1;
                    if (!flag2)
                    {
                        this.AttachVerticalBorder(num, num2, rPLItemMeasurement, (RPLLine)rPLElement, false);
                    }
                }
                else
                {
                    this.AttachVerticalBorder(num, num2, rPLItemMeasurement, (RPLLine)rPLElement, true);
                }
                num4++;
                continue;
IL_0176:
                if (!flag)
                {
                    int  num6  = 0;
                    bool flag3 = true;
                    while (flag3 && num6 < this.m_nrCols)
                    {
                        if (this.m_tableGrid[num6].XValue == rPLItemMeasurement.Left)
                        {
                            num   = num6;
                            flag3 = false;
                        }
                        num6++;
                    }
                    num2 = this.m_nrRows - 1;
                    this.AttachHorizontalBorder(num, num2, rPLItemMeasurement, (RPLLine)rPLElement, false);
                }
                else
                {
                    this.AttachHorizontalBorder(num, num2, rPLItemMeasurement, (RPLLine)rPLElement, true);
                }
                num4++;
            }
        }