Revert r53710 "* Allow suppressing "line 1" from the diffs, which can get quite annoy...
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 21 Aug 2009 22:01:16 +0000 (22:01 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 21 Aug 2009 22:01:16 +0000 (22:01 +0000)
Use of static variable here means that running multiple diffs during one request may mess things up. It should rather check if it's been added in $wgOut already.

includes/diff/DifferenceEngine.php

index 2bb3759..50391a1 100644 (file)
@@ -30,10 +30,6 @@ class DifferenceEngine {
        var $mCacheHit = false; // Was the diff fetched from cache?
        var $htmldiff;
 
-       // If true, line X is not displayed when X is 1, for example to increase
-       // readability and conserve space with many small diffs.
-       protected $mReducedLineNumbers = false;
-
        protected $unhide = false;
        /**#@-*/
 
@@ -84,10 +80,6 @@ class DifferenceEngine {
                $this->unhide = $unhide;
        }
 
-       function setReducedLineNumbers( $value = true ) {
-               $this->mReducedLineNumbers = $value;
-       }
-
        function getTitle() {
                return $this->mTitle;
        }
@@ -645,16 +637,10 @@ CONTROL;
         */
        function showDiffStyle() {
                global $wgStylePath, $wgStyleVersion, $wgOut;
-
-               static $styleDone = false;
-               if ( $styleDone === $wgOut ) return;
-
                $wgOut->addStyle( 'common/diff.css' );
 
                // JS is needed to detect old versions of Mozilla to work around an annoyance bug.
                $wgOut->addScript( "<script type=\"text/javascript\" src=\"$wgStylePath/common/diff.js?$wgStyleVersion\"></script>" );
-
-               $styleDone = $wgOut;
        }
 
        /**
@@ -856,7 +842,6 @@ CONTROL;
 
        function localiseLineNumbersCb( $matches ) {
                global $wgLang;
-               if ( $matches[1] === '1' && $this->mReducedLineNumbers ) return '';
                return wfMsgExt( 'lineno', 'escape', $wgLang->formatNum( $matches[1] ) );
        }