Remove two useless classes from HTMLDiff. One was entirely unused and useless, and...
authorChad Horohoe <demon@users.mediawiki.org>
Tue, 16 Sep 2008 19:19:12 +0000 (19:19 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Tue, 16 Sep 2008 19:19:12 +0000 (19:19 +0000)
includes/AutoLoader.php
includes/diff/HTMLDiff.php

index 38bed46..f138638 100644 (file)
@@ -316,7 +316,6 @@ $wgAutoloadLocalClasses = array(
 
        # includes/diff
        'AncestorComparator' => 'includes/diff/HTMLDiff.php',
-       'AncestorComparatorResult' => 'includes/diff/HTMLDiff.php',
        'AnchorToString' => 'includes/diff/HTMLDiff.php',
        'ArrayDiffFormatter' => 'includes/diff/DifferenceEngine.php',
        'BodyNode' => 'includes/diff/Nodes.php',
@@ -334,7 +333,6 @@ $wgAutoloadLocalClasses = array(
        '_DiffOp' => 'includes/diff/DifferenceEngine.php',
        'DomTreeBuilder' => 'includes/diff/HTMLDiff.php',
        'DummyNode' => 'includes/diff/Nodes.php',
-       'EchoingContentHandler' => 'includes/diff/HTMLDiff.php',
        'HTMLDiffer' => 'includes/diff/HTMLDiff.php',
        'HTMLOutput' => 'includes/diff/HTMLDiff.php',
        '_HWLDF_WordAccumulator' => 'includes/diff/DifferenceEngine.php',
index 8af4a27..cb169aa 100644 (file)
@@ -252,21 +252,21 @@ class TextNodeDiffer {
                        $result = $acthis->getResult($acother);
                        unset($acthis, $acother);
 
-                       if ($result->changed) {
+                       if ( $result ) {
                                $mod = new Modification(Modification::CHANGED);
 
                                if (!$this->changedIDUsed) {
                                        $mod->firstOfID = true;
-                               } else if (!is_null($result->changes) && $result->changes !== $this->changes) {
+                               } else if (!is_null( $result ) && $result !== $this->changes) {
                                        ++$this->changedID;
                                        $mod->firstOfID = true;
                                }
 
-                               $mod->changes = $result->changes;
+                               $mod->changes = $result;
                                $mod->id = $this->changedID;
 
                                $this->textNodes[$i]->modification = $mod;
-                               $this->changes = $result->changes;
+                               $this->changes = $result;
                                $this->changedIDUsed = true;
                        } else if ($this->changedIDUsed) {
                                ++$this->changedID;
@@ -588,13 +588,6 @@ class TextOnlyComparator {
        }
 }
 
-class AncestorComparatorResult {
-
-       public $changed = false;
-
-       public $changes = "";
-}
-
 /**
  * A comparator used when calculating the difference in ancestry of two Nodes.
  */
@@ -611,20 +604,16 @@ class AncestorComparator {
        public $compareTxt = "";
 
        public function getResult(AncestorComparator $other) {
-               $result = new AncestorComparatorResult();
 
                $diffengine = new WikiDiff3(10000, 1.35);
                $differences = $diffengine->diff_range($other->ancestorsText,$this->ancestorsText);
 
                if (count($differences) == 0){
-                       return $result;
+                       return null;
                }
                $changeTxt = new ChangeTextGenerator($this, $other);
 
-               $result->changed = true;
-               $result->changes = $changeTxt->getChanged($differences)->toString();
-
-               return $result;
+               return $changeTxt->getChanged($differences)->toString();;
        }
 }
 
@@ -990,26 +979,6 @@ class HTMLOutput{
        }
 }
 
-class EchoingContentHandler {
-
-       function startElement($qname, /*array*/ $arguments) {
-               echo Xml::openElement($qname, $arguments);
-       }
-
-       function endElement($qname){
-               echo Xml::closeElement($qname);
-       }
-
-       function characters($chars){
-               echo htmlspecialchars($chars);
-       }
-
-       function html($html){
-               echo $html;
-       }
-
-}
-
 class DelegatingContentHandler {
 
        private $delegate;