public function finishRows()
 {
     if ($this->useMetaForRowChanges()) {
         return;
     }
     if ($this->source->get_width() === 0) {
         if ($this->source->get_height() !== 0) {
             $this->source->resize(0, 0);
         }
         return;
     }
     $fate = new _hx_array(array());
     $this->permuteRows();
     if ($this->rowPermutation->length > 0) {
         $_g = 0;
         $_g1 = $this->mods;
         while ($_g < $_g1->length) {
             $mod = $_g1[$_g];
             ++$_g;
             if ($mod->sourceRow >= 0) {
                 $mod->sourceRow = $this->rowPermutation[$mod->sourceRow];
             }
             unset($mod);
         }
     }
     if ($this->rowPermutation->length > 0) {
         $this->source->insertOrDeleteRows($this->rowPermutation, $this->rowPermutation->length);
     }
     $len = $this->processMods($this->mods, $fate, $this->source->get_height());
     $this->source->insertOrDeleteRows($fate, $len);
     $this->needDestColumns();
     $_g2 = 0;
     $_g11 = $this->mods;
     while ($_g2 < $_g11->length) {
         $mod1 = $_g11[$_g2];
         ++$_g2;
         if (!$mod1->rem) {
             if ($mod1->add) {
                 if (null == $this->headerPost) {
                     throw new HException('null iterable');
                 }
                 $__hx__it = $this->headerPost->iterator();
                 while ($__hx__it->hasNext()) {
                     unset($c);
                     $c = $__hx__it->next();
                     $offset = $this->patchInDestCol->get($c);
                     if ($offset !== null && $offset >= 0) {
                         $this->source->setCell($offset, $mod1->destRow, $this->patch->getCell($c, $mod1->patchRow));
                     }
                     unset($offset);
                 }
             } else {
                 if ($mod1->update) {
                     $this->currentRow = $mod1->patchRow;
                     $this->checkAct();
                     if (!$this->rowInfo->updated) {
                         continue;
                     }
                     if (null == $this->headerPre) {
                         throw new HException('null iterable');
                     }
                     $__hx__it = $this->headerPre->iterator();
                     while ($__hx__it->hasNext()) {
                         unset($c1);
                         $c1 = $__hx__it->next();
                         $txt = $this->view->toString($this->patch->getCell($c1, $mod1->patchRow));
                         coopy_DiffRender::examineCell(0, 0, $this->view, $txt, "", $this->rowInfo->value, "", $this->cellInfo, null);
                         if (!$this->cellInfo->updated) {
                             continue;
                         }
                         if ($this->cellInfo->conflicted) {
                             continue;
                         }
                         $d = $this->view->toDatum($this->csv->parseCell($this->cellInfo->rvalue));
                         $offset1 = $this->patchInDestCol->get($c1);
                         if ($offset1 !== null && $offset1 >= 0) {
                             $this->source->setCell($this->patchInDestCol->get($c1), $mod1->destRow, $d);
                         }
                         unset($txt, $offset1, $d);
                     }
                 }
             }
         }
         unset($mod1);
     }
     $this->fillInNewColumns();
     $_g12 = 0;
     $_g3 = $this->source->get_width();
     while ($_g12 < $_g3) {
         $i = $_g12++;
         $name = $this->view->toString($this->source->getCell($i, 0));
         $next_name = $this->headerRename->get($name);
         if ($next_name === null) {
             continue;
         }
         $this->source->setCell($i, 0, $this->view->toDatum($next_name));
         unset($next_name, $name, $i);
     }
 }
Example #2
0
 static function renderCell($tab, $view, $x, $y)
 {
     $cell = new coopy_CellInfo();
     $corner = $view->toString($tab->getCell(0, 0));
     $off = null;
     if ($corner === "@:@") {
         $off = 1;
     } else {
         $off = 0;
     }
     coopy_DiffRender::examineCell($x, $y, $view, $tab->getCell($x, $y), $view->toString($tab->getCell($x, $off)), $view->toString($tab->getCell($off, $y)), $corner, $cell, $off);
     return $cell;
 }