Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html	(revision 5911)
+++ /CKEditor/trunk/CHANGES.html	(revision 5912)
@@ -52,4 +52,5 @@
 		<li><a href="http://dev.ckeditor.com/ticket/6170">#6170</a> : Dedicated class names are removed from floating panels when opening another panel.</li>
 		<li><a href="http://dev.ckeditor.com/ticket/6339">#6339</a> : Autogrow plugin now doesn't work on maximized editors.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6237">#6237</a> : BIDI: Applying same language direction to all paragraphs not working.</li>
 	</ul>
 	<h3>
Index: /CKEditor/trunk/_source/plugins/bidi/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/bidi/plugin.js	(revision 5911)
+++ /CKEditor/trunk/_source/plugins/bidi/plugin.js	(revision 5912)
@@ -53,14 +53,12 @@
 	}
 
-	function switchDir( element, dir, editor )
-	{
-		var dirBefore = element.getComputedStyle( 'direction' ),
-			currentDir = element.getStyle( 'direction' ) || element.getAttribute( 'dir' ) || '';
+	function switchDir( element, dir, editor, state )
+	{
+		var dirBefore = element.getComputedStyle( 'direction' );
 
 		element.removeStyle( 'direction' );
-
-		if ( currentDir.toLowerCase() == dir )
-			element.removeAttribute( 'dir' );
-		else
+		element.removeAttribute( 'dir' );
+
+		if ( state == CKEDITOR.TRISTATE_OFF && element.getComputedStyle( 'direction' ).toLowerCase() != dir )
 			element.setAttribute( 'dir', dir );
 
@@ -139,5 +137,5 @@
 				{
 					if ( !selectedElement.isReadOnly() )
-						switchDir( selectedElement, dir, editor );
+						switchDir( selectedElement, dir, editor, this.state );
 				}
 				else
@@ -166,5 +164,5 @@
 						while ( ( block = walker.next() ) )
 						{
-							switchDir( block, dir, editor );
+							switchDir( block, dir, editor, this.state );
 							processedElements.push( block );
 						}
@@ -202,5 +200,5 @@
 							if ( !_break )
 							{
-								switchDir( block, dir, editor );
+								switchDir( block, dir, editor, this.state );
 							}
 						}
