Example #1
0
File: Class3.cs Project: ikvm/test
        public static CellExt1 transfer(CellSet cs, CellExt1 ecs)
        {
            if (ecs == null)
            {
                return(null);
            }
            Parser parser = new Parser(cs);

            ecs.RowSize = cs.Row;
            ecs.ColSize = cs.Column;
            for (int i = 0; i < cs.Row; i++)
            {
                for (int j = 0; j < cs.Column; j++)
                {
                    if (parser.isMergedFirstCell(i, j))
                    {
                        int row    = parser.getMergedEndRow(i, j);
                        int column = parser.getMergedEndCol(i, j);
                        cs.setPropertyValue(i, j, 706, cs.getPropertyValue(i, column, 706));
                        cs.setPropertyValue(i, j, 704, cs.getPropertyValue(i, column, 704));
                        cs.setPropertyValue(i, j, 705, cs.getPropertyValue(i, column, 705));
                        cs.setPropertyValue(i, j, 712, cs.getPropertyValue(row, j, 712));
                        cs.setPropertyValue(i, j, 710, cs.getPropertyValue(row, j, 710));
                        cs.setPropertyValue(i, j, 711, cs.getPropertyValue(row, j, 711));
                    }
                    Cell    cell = cs.getCell(i, j);
                    CellExt ext2 = ecs.getCell(i, j);
                    if (cell != null)
                    {
                        if ((i == 0) && (j == 0))
                        {
                            object obj2 = null;
                            obj2 = cell.getValue(101);
                            if (obj2 != null)
                            {
                                ecs.object_0 = obj2;
                            }
                            obj2 = cell.getValue(109);
                            if (obj2 != null)
                            {
                                ecs.bool_0 = true.Equals(obj2);
                            }
                        }
                        if (ext2 == null)
                        {
                            ext2 = ecs.newCell(i, j);
                        }
                        ext2.PropValueTable = cell.getValuesMap();
                        ext2.PropExpTable   = cell.getExpressionsMap();
                        if (ecs.isMerged(i, j))
                        {
                            ecs.remove(i, j);
                        }
                    }
                }
            }
            ecs.addMergedCells();
            ecs.NewInput = cs.NewInputVersion;
            return(ecs);
        }
Example #2
0
File: Class3.cs Project: ikvm/test
 public static CellSet transfer(CellExt1 ecs, CellSet cs, bool only)
 {
     if (cs == null)
     {
         cs = new CellSet(ecs.RowSize, ecs.ColSize);
     }
     for (int i = 0; i < ecs.RowSize; i++)
     {
         for (int j = 0; j < ecs.ColSize; j++)
         {
             CellExt ext = ecs.getCell(i, j);
             if (ext != null)
             {
                 if (ecs.isMerged(i, j))
                 {
                     Cell cell = cs.getCell(ext.Row, ext.Col);
                     if (cell != null)
                     {
                         cell = (Cell)cell.Clone();
                     }
                     cs.setCell(i, j, cell);
                     if (((i <= 1) || (ecs.getCell(i - 1, j) == null)) || ecs.isMerged(i - 1, j))
                     {
                         cs.setPropertyValue(i, j, 707, ext.getPropValue(707));
                         cs.setPropertyValue(i, j, 709, ext.getPropValue(709));
                         cs.setPropertyValue(i, j, 708, ext.getPropValue(708));
                     }
                     if (((j <= 1) || (ecs.getCell(i, j - 1) == null)) || ecs.isMerged(i, j - 1))
                     {
                         cs.setPropertyValue(i, j, 701, ext.getPropValue(701));
                         cs.setPropertyValue(i, j, 703, ext.getPropValue(703));
                         cs.setPropertyValue(i, j, 702, ext.getPropValue(702));
                     }
                     if (((i + 1) == ecs.RowSize) || (ecs.getCell(i + 1, j) == null))
                     {
                         cs.setPropertyValue(i, j, 710, ext.getPropValue(710));
                         cs.setPropertyValue(i, j, 712, ext.getPropValue(712));
                         cs.setPropertyValue(i, j, 711, ext.getPropValue(711));
                     }
                     if (((j + 1) == ecs.ColSize) || (ecs.getCell(i, j + 1) == null))
                     {
                         cs.setPropertyValue(i, j, 704, ext.getPropValue(704));
                         cs.setPropertyValue(i, j, 706, ext.getPropValue(706));
                         cs.setPropertyValue(i, j, 705, ext.getPropValue(705));
                     }
                 }
                 else
                 {
                     Cell cell2 = new Cell();
                     cell2.setValuesMap(ext.PropTable);
                     cs.setCell(i, j, cell2);
                 }
             }
             if (only)
             {
                 ecs.vmethod_3(i, j, null);
             }
         }
     }
     return(cs);
 }