Ejemplo n.º 1
0
        private void prepareCalculate()
        {
            cellList.clear();
            cellIdMap.Clear();
            for (int i = 0; i < RowSize; i++)
            {
                for (int k = 0; k < ColSize; k++)
                {
                    CellExt o = getCell(i, k);
                    if (!isMerged(i, k))
                    {
                        object obj2 = o;
                        cellIdMap[getId(i, k)] = obj2;
                        if (o != null)
                        {
                            cellList.put(o);
                        }
                    }
                }
            }
            for (int j = 0; j < RowSize; j++)
            {
                for (int m = 0; m < ColSize; m++)
                {
                    if ((j != 0) || (m != 0))
                    {
                        CellExt ext3 = getCell(j, m);
                        if ((ext3 != null) && !isMerged(j, m))
                        {
                            ext3.setLeftHead(method_2(ext3));
                            ext3.setTopHead(method_3(ext3));
                            ext3.prepareCalculate();
                        }
                    }
                }
            }
            CellExt   ext2     = getCell(0, 0);
            ArrayList subCells = ext2.SubCells;

            if (subCells != null)
            {
                subCells.Clear();
                IEnumerator enumerator = cellIdMap.Values.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    CellExt ext = (CellExt)enumerator.Current;
                    if (((ext != null) && (ext.getLeftHead() == ext2)) && (ext.getTopHead() == ext2))
                    {
                        subCells.Add(ext);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public virtual void extendRow(CellExt cell, int count)
        {
            int num  = getBeginRow(cell);
            int num2 = getEndRow(cell);
            int num3 = num2 - num;

            CellExt[] extArray = new CellExt[count];
            extArray[0]   = cell;
            cell.ExtCells = extArray;
            vmethod_0(num2, num3 * (count - 1));
            for (int i = num; i < num2; i++)
            {
                CellExt ext7 = getCell(i, 0);
                if (ext7 != null)
                {
                    for (int m = 1; m < count; m++)
                    {
                        vmethod_3(i + (num3 * m), 0, (CellExt)ext7.Clone());
                    }
                }
            }
            cell.expandLeftHead(num3 * (count - 1));
            for (int j = num; j < num2; j++)
            {
                for (int n = 1; n < ColSize; n++)
                {
                    CellExt sub = getCell(j, n);
                    if ((sub != null) && cell.isLeftHeadOf(sub))
                    {
                        for (int num10 = 1; num10 < count; num10++)
                        {
                            CellExt ext6 = (CellExt)sub.Clone();
                            vmethod_3(j + (num10 * num3), n, ext6);
                            if (sub != cell)
                            {
                                cellList.put(ext6);
                            }
                            else
                            {
                                extArray[num10] = ext6;
                                ext6.ExtCells   = extArray;
                            }
                        }
                    }
                }
            }
            for (int k = num; k < num2; k++)
            {
                for (int num6 = 1; num6 < ColSize; num6++)
                {
                    CellExt ext = getCell(k, num6);
                    if ((ext != null) && cell.isLeftHeadOf(ext))
                    {
                        CellExt ext3 = ext.getLeftHead();
                        for (int num7 = 1; num7 < count; num7++)
                        {
                            CellExt ext2 = getCell(k + (num3 * num7), num6);
                            if (ext != cell)
                            {
                                CellExt head = getCell(ext3.Row + (num3 * num7), ext3.Col);
                                ext2.setLeftHead(head);
                            }
                            if (ext.getTopHead() != getCell(0, 0))
                            {
                                ext2.setTopHead(ext.getTopHead());
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public virtual void extendCol(CellExt cell, int count)
        {
            if (!method_5(cell.Row))
            {
                throw new ReportError("非数据区单元格不能横向扩展");
            }
            int num8 = getBeginCol(cell);
            int num3 = getEndCol(cell);
            int num5 = num3 - num8;

            CellExt[] extArray = new CellExt[count];
            extArray[0]   = cell;
            cell.ExtCells = extArray;
            vmethod_1(num3, num5 * (count - 1));
            for (int i = num8; i < num3; i++)
            {
                CellExt ext7 = getCell(0, i);
                if (ext7 != null)
                {
                    for (int m = 1; m < count; m++)
                    {
                        vmethod_3(0, i + (m * num5), (CellExt)ext7.Clone());
                    }
                }
            }
            cell.expandTopHead(num5 * (count - 1));
            for (int j = num8; j < num3; j++)
            {
                for (int n = 1; n < RowSize; n++)
                {
                    CellExt sub = getCell(n, j);
                    if ((sub != null) && cell.isTopHeadOf(sub))
                    {
                        for (int num9 = 1; num9 < count; num9++)
                        {
                            CellExt ext6 = (CellExt)sub.Clone();
                            vmethod_3(n, j + (num9 * num5), ext6);
                            if (sub == cell)
                            {
                                extArray[num9] = ext6;
                                ext6.ExtCells  = extArray;
                            }
                            else
                            {
                                cellList.put(ext6);
                            }
                        }
                    }
                }
            }
            for (int k = num8; k < num3; k++)
            {
                for (int num = 1; num < RowSize; num++)
                {
                    CellExt ext = getCell(num, k);
                    if ((ext != null) && cell.isTopHeadOf(ext))
                    {
                        CellExt ext3 = ext.getTopHead();
                        for (int num4 = 1; num4 < count; num4++)
                        {
                            CellExt ext2 = getCell(num, k + (num5 * num4));
                            if (ext != cell)
                            {
                                CellExt head = getCell(ext3.Row, ext3.Col + (num5 * num4));
                                ext2.setTopHead(head);
                            }
                            if (ext.getLeftHead() != getCell(0, 0))
                            {
                                ext2.setLeftHead(ext.getLeftHead());
                            }
                        }
                    }
                }
            }
        }