| Index: trunk/phase3/includes/diff/HTMLDiff.php |
| — | — | @@ -252,21 +252,21 @@ |
| 253 | 253 | $result = $acthis->getResult($acother); |
| 254 | 254 | unset($acthis, $acother); |
| 255 | 255 | |
| 256 | | - if ($result->changed) { |
| | 256 | + if ( $result ) { |
| 257 | 257 | $mod = new Modification(Modification::CHANGED); |
| 258 | 258 | |
| 259 | 259 | if (!$this->changedIDUsed) { |
| 260 | 260 | $mod->firstOfID = true; |
| 261 | | - } else if (!is_null($result->changes) && $result->changes !== $this->changes) { |
| | 261 | + } else if (!is_null( $result ) && $result !== $this->changes) { |
| 262 | 262 | ++$this->changedID; |
| 263 | 263 | $mod->firstOfID = true; |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | | - $mod->changes = $result->changes; |
| | 266 | + $mod->changes = $result; |
| 267 | 267 | $mod->id = $this->changedID; |
| 268 | 268 | |
| 269 | 269 | $this->textNodes[$i]->modification = $mod; |
| 270 | | - $this->changes = $result->changes; |
| | 270 | + $this->changes = $result; |
| 271 | 271 | $this->changedIDUsed = true; |
| 272 | 272 | } else if ($this->changedIDUsed) { |
| 273 | 273 | ++$this->changedID; |
| — | — | @@ -588,13 +588,6 @@ |
| 589 | 589 | } |
| 590 | 590 | } |
| 591 | 591 | |
| 592 | | -class AncestorComparatorResult { |
| 593 | | - |
| 594 | | - public $changed = false; |
| 595 | | - |
| 596 | | - public $changes = ""; |
| 597 | | -} |
| 598 | | - |
| 599 | 592 | /** |
| 600 | 593 | * A comparator used when calculating the difference in ancestry of two Nodes. |
| 601 | 594 | */ |
| — | — | @@ -611,20 +604,16 @@ |
| 612 | 605 | public $compareTxt = ""; |
| 613 | 606 | |
| 614 | 607 | public function getResult(AncestorComparator $other) { |
| 615 | | - $result = new AncestorComparatorResult(); |
| 616 | 608 | |
| 617 | 609 | $diffengine = new WikiDiff3(10000, 1.35); |
| 618 | 610 | $differences = $diffengine->diff_range($other->ancestorsText,$this->ancestorsText); |
| 619 | 611 | |
| 620 | 612 | if (count($differences) == 0){ |
| 621 | | - return $result; |
| | 613 | + return null; |
| 622 | 614 | } |
| 623 | 615 | $changeTxt = new ChangeTextGenerator($this, $other); |
| 624 | 616 | |
| 625 | | - $result->changed = true; |
| 626 | | - $result->changes = $changeTxt->getChanged($differences)->toString(); |
| 627 | | - |
| 628 | | - return $result; |
| | 617 | + return $changeTxt->getChanged($differences)->toString();; |
| 629 | 618 | } |
| 630 | 619 | } |
| 631 | 620 | |
| — | — | @@ -990,26 +979,6 @@ |
| 991 | 980 | } |
| 992 | 981 | } |
| 993 | 982 | |
| 994 | | -class EchoingContentHandler { |
| 995 | | - |
| 996 | | - function startElement($qname, /*array*/ $arguments) { |
| 997 | | - echo Xml::openElement($qname, $arguments); |
| 998 | | - } |
| 999 | | - |
| 1000 | | - function endElement($qname){ |
| 1001 | | - echo Xml::closeElement($qname); |
| 1002 | | - } |
| 1003 | | - |
| 1004 | | - function characters($chars){ |
| 1005 | | - echo htmlspecialchars($chars); |
| 1006 | | - } |
| 1007 | | - |
| 1008 | | - function html($html){ |
| 1009 | | - echo $html; |
| 1010 | | - } |
| 1011 | | - |
| 1012 | | -} |
| 1013 | | - |
| 1014 | 983 | class DelegatingContentHandler { |
| 1015 | 984 | |
| 1016 | 985 | private $delegate; |
| Index: trunk/phase3/includes/AutoLoader.php |
| — | — | @@ -316,7 +316,6 @@ |
| 317 | 317 | |
| 318 | 318 | # includes/diff |
| 319 | 319 | 'AncestorComparator' => 'includes/diff/HTMLDiff.php', |
| 320 | | - 'AncestorComparatorResult' => 'includes/diff/HTMLDiff.php', |
| 321 | 320 | 'AnchorToString' => 'includes/diff/HTMLDiff.php', |
| 322 | 321 | 'ArrayDiffFormatter' => 'includes/diff/DifferenceEngine.php', |
| 323 | 322 | 'BodyNode' => 'includes/diff/Nodes.php', |
| — | — | @@ -334,7 +333,6 @@ |
| 335 | 334 | '_DiffOp' => 'includes/diff/DifferenceEngine.php', |
| 336 | 335 | 'DomTreeBuilder' => 'includes/diff/HTMLDiff.php', |
| 337 | 336 | 'DummyNode' => 'includes/diff/Nodes.php', |
| 338 | | - 'EchoingContentHandler' => 'includes/diff/HTMLDiff.php', |
| 339 | 337 | 'HTMLDiffer' => 'includes/diff/HTMLDiff.php', |
| 340 | 338 | 'HTMLOutput' => 'includes/diff/HTMLDiff.php', |
| 341 | 339 | '_HWLDF_WordAccumulator' => 'includes/diff/DifferenceEngine.php', |