Index: /CKEditor/trunk/_source/plugins/indent/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/indent/plugin.js	(revision 6285)
+++ /CKEditor/trunk/_source/plugins/indent/plugin.js	(revision 6286)
@@ -1,3 +1,3 @@
-﻿/*
+/*
 Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
 For licensing, see LICENSE.html or http://ckeditor.com/license
@@ -10,13 +10,7 @@
 (function()
 {
-	var listNodeNames = { ol : 1, ul : 1 };
-
-	var isNotWhitespaces = CKEDITOR.dom.walker.whitespaces( true ),
+	var listNodeNames = { ol : 1, ul : 1 },
+		isNotWhitespaces = CKEDITOR.dom.walker.whitespaces( true ),
 		isNotBookmark = CKEDITOR.dom.walker.bookmark( false, true );
-
-	function setState( editor, state )
-	{
-		editor.getCommand( this.name ).setState( state );
-	}
 
 	function onSelectionChange( evt )
@@ -28,13 +22,13 @@
 
 		if ( list )
-				return setState.call( this, editor, CKEDITOR.TRISTATE_OFF );
+				return this.setState( CKEDITOR.TRISTATE_OFF );
 
 		if ( !this.useIndentClasses && this.name == 'indent' )
-			return setState.call( this, editor, CKEDITOR.TRISTATE_OFF );
+			return this.setState( CKEDITOR.TRISTATE_OFF );
 
 		var path = evt.data.path,
 			firstBlock = path.block || path.blockLimit;
 		if ( !firstBlock )
-			return setState.call( this, editor, CKEDITOR.TRISTATE_DISABLED );
+			return this.setState( CKEDITOR.TRISTATE_DISABLED );
 
 		if ( this.useIndentClasses )
@@ -49,6 +43,6 @@
 			if ( ( this.name == 'outdent' && !indentStep ) ||
 					( this.name == 'indent' && indentStep == editor.config.indentClasses.length ) )
-				return setState.call( this, editor, CKEDITOR.TRISTATE_DISABLED );
-			return setState.call( this, editor, CKEDITOR.TRISTATE_OFF );
+				return this.setState( CKEDITOR.TRISTATE_DISABLED );
+			return this.setState( CKEDITOR.TRISTATE_OFF );
 		}
 		else
@@ -58,6 +52,6 @@
 				indent = 0;
 			if ( indent <= 0 )
-				return setState.call( this, editor, CKEDITOR.TRISTATE_DISABLED );
-			return setState.call( this, editor, CKEDITOR.TRISTATE_OFF );
+				return this.setState( CKEDITOR.TRISTATE_DISABLED );
+			return this.setState( CKEDITOR.TRISTATE_OFF );
 		}
 	}
@@ -355,8 +349,6 @@
 		{
 			// Register commands.
-			var indent = new indentCommand( editor, 'indent' ),
-				outdent = new indentCommand( editor, 'outdent' );
-			editor.addCommand( 'indent', indent );
-			editor.addCommand( 'outdent', outdent );
+			var indent = editor.addCommand( 'indent', new indentCommand( editor, 'indent' ) ),
+				outdent = editor.addCommand( 'outdent', new indentCommand( editor, 'outdent' ) );
 
 			// Register the toolbar buttons.
Index: /CKEditor/trunk/_source/plugins/list/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/list/plugin.js	(revision 6285)
+++ /CKEditor/trunk/_source/plugins/list/plugin.js	(revision 6286)
@@ -204,9 +204,4 @@
 	};
 
-	function setState( editor, state )
-	{
-		editor.getCommand( this.name ).setState( state );
-	}
-
 	function onSelectionChange( evt )
 	{
@@ -214,18 +209,16 @@
 			blockLimit = path.blockLimit,
 			elements = path.elements,
-			element;
+			element,
+			i;
 
 		// Grouping should only happen under blockLimit.(#3940).
-		for ( var i = 0 ; i < elements.length && ( element = elements[ i ] )
+		for ( i = 0 ; i < elements.length && ( element = elements[ i ] )
 			  && !element.equals( blockLimit ); i++ )
 		{
 			if ( listNodeNames[ elements[i].getName() ] )
-			{
-				return setState.call( this, evt.editor,
-						this.type == elements[i].getName() ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF );
-			}
-		}
-
-		return setState.call( this, evt.editor, CKEDITOR.TRISTATE_OFF );
+				return this.setState( this.type == elements[i].getName() ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF );
+		}
+
+		return this.setState( CKEDITOR.TRISTATE_OFF );
 	}
 
@@ -493,5 +486,5 @@
 					if ( enclosedNode && enclosedNode.is
 						&& this.type == enclosedNode.getName() )
-							setState.call( this, editor, CKEDITOR.TRISTATE_ON );
+							this.setState( CKEDITOR.TRISTATE_ON );
 				}
 			}
@@ -694,8 +687,6 @@
 		{
 			// Register commands.
-			var numberedListCommand = new listCommand( 'numberedlist', 'ol' ),
-				bulletedListCommand = new listCommand( 'bulletedlist', 'ul' );
-			editor.addCommand( 'numberedlist', numberedListCommand );
-			editor.addCommand( 'bulletedlist', bulletedListCommand );
+			var numberedListCommand = editor.addCommand( 'numberedlist', new listCommand( 'numberedlist', 'ol' ) ),
+				bulletedListCommand = editor.addCommand( 'bulletedlist', new listCommand( 'bulletedlist', 'ul' ) );
 
 			// Register the toolbar button.
