Version 3.1.4
This commit is contained in:
1 parent
1d4720f3e2
commit
ae5c01cc78
2563 files changed
+283048
-240689
No files matched your search
@@ -5,9 +5,9 @@
|
||||
* This class renders the diff in classic diff format. It is intended that
|
||||
* this class be customized via inheritance, to obtain fancier outputs.
|
||||
*
|
||||
* $Horde: framework/Text_Diff/Diff/Renderer.php,v 1.5.10.10 2008/01/04 10:37:27 jan Exp $
|
||||
* $Horde: framework/Text_Diff/Diff/Renderer.php,v 1.5.10.12 2009/07/24 13:26:40 jan Exp $
|
||||
*
|
||||
* Copyright 2004-2008 The Horde Project (http://www.horde.org/)
|
||||
* Copyright 2004-2009 The Horde Project (http://www.horde.org/)
|
||||
*
|
||||
* See the enclosed file COPYING for license information (LGPL). If you did
|
||||
* not receive this file, see http://opensource.org/licenses/lgpl-license.php.
|
||||
@@ -81,6 +81,7 @@ class Text_Diff_Renderer {
|
||||
$output = $this->_startDiff();
|
||||
|
||||
$diffs = $diff->getDiff();
|
||||
|
||||
foreach ($diffs as $i => $edit) {
|
||||
/* If these are unchanged (copied) lines, and we want to keep
|
||||
* leading or trailing context lines, extract them from the copy
|
||||
@@ -100,9 +101,10 @@ class Text_Diff_Renderer {
|
||||
/* Create a new block with as many lines as we need
|
||||
* for the trailing context. */
|
||||
$context = array_slice($edit->orig, 0, $ntrail);
|
||||
|
||||
$block[] = new Text_Diff_Op_copy($context);
|
||||
}
|
||||
/* @todo */
|
||||
|
||||
$output .= $this->_block($x0, $ntrail + $xi - $x0,
|
||||
$y0, $ntrail + $yi - $y0,
|
||||
$block);
|
||||
@@ -148,6 +150,7 @@ class Text_Diff_Renderer {
|
||||
$output = $this->_startBlock($this->_blockHeader($xbeg, $xlen, $ybeg, $ylen));
|
||||
|
||||
foreach ($edits as $edit) {
|
||||
|
||||
switch (strtolower(get_class($edit))) {
|
||||
case 'text_diff_op_copy':
|
||||
$output .= $this->_context($edit->orig);
|
||||
@@ -201,7 +204,7 @@ class Text_Diff_Renderer {
|
||||
|
||||
function _startBlock($header)
|
||||
{
|
||||
return $header . "\n";
|
||||
return ( $header ) ? $header . "\n" : '';
|
||||
}
|
||||
|
||||
function _endBlock()
|
||||
|
||||
Reference in new issue
Block a user