예제 #1
0
 function closing()
 {
     wfProfileIn(__METHOD__);
     $closing = new _HWLDF_WordAccumulator();
     foreach ($this->edits as $edit) {
         if ($edit->type == 'copy') {
             $closing->addWords($edit->closing);
         } elseif ($edit->closing) {
             $closing->addWords($edit->closing, 'ins');
         }
     }
     $lines = $closing->getLines();
     wfProfileOut(__METHOD__);
     return $lines;
 }
예제 #2
0
파일: Diff.php 프로젝트: pombredanne/tuleap
 function _final()
 {
     $final = new _HWLDF_WordAccumulator();
     foreach ($this->edits as $edit) {
         if ($edit->type == 'copy') {
             $final->addWords($edit->final);
         } elseif ($edit->final) {
             $final->addWords($edit->final, 'ins');
         }
     }
     return $final->getLines();
 }
 public function closing()
 {
     $closing = new _HWLDF_WordAccumulator();
     foreach ($this->edits as $edit) {
         if ($edit->type == 'copy') {
             $closing->addWords($edit->closing);
         } elseif ($edit->closing) {
             $closing->addWords($edit->closing, 'mark');
         }
     }
     return $closing->getLines();
 }
예제 #4
0
 function inline()
 {
     $orig = new _HWLDF_WordAccumulator();
     foreach ($this->edits as $edit) {
         if ($edit->type == 'copy') {
             $orig->addWords($edit->closing);
         } elseif ($edit->type == 'change') {
             $orig->addWords($edit->orig, 'del');
             $orig->addWords($edit->closing, 'add');
         } elseif ($edit->type == 'delete') {
             $orig->addWords($edit->orig, 'del');
         } elseif ($edit->type == 'add') {
             $orig->addWords($edit->closing, 'add');
         } elseif ($edit->orig) {
             $orig->addWords($edit->orig, 'del');
         }
     }
     return $orig->getLines();
 }
예제 #5
0
 function closing()
 {
     $fname = 'WordLevelDiff::closing';
     wfProfileIn($fname);
     $closing = new _HWLDF_WordAccumulator();
     foreach ($this->edits as $edit) {
         if ($edit->type == 'copy') {
             $closing->addWords($edit->closing);
         } elseif ($edit->closing) {
             $closing->addWords($edit->closing, 'ins');
         }
     }
     $lines = $closing->getLines();
     wfProfileOut($fname);
     return $lines;
 }
예제 #6
0
 function all($tags = array(), $nbsp = '', $html = null)
 {
     $text = new _HWLDF_WordAccumulator($tags, $nbsp, $html);
     foreach ($this->edits as $edit) {
         if (is_a($edit, '_DiffOp_Copy')) {
             $text->addWords($edit->orig);
         } else {
             if ($edit->orig) {
                 $text->addWords($edit->orig, 'del');
             }
             if ($edit->_final) {
                 $text->addWords($edit->_final, 'ins');
             }
         }
     }
     return $text->getLines();
 }