Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html	(revision 5976)
+++ /CKEditor/trunk/CHANGES.html	(revision 5977)
@@ -82,5 +82,6 @@
 		<li><a href="http://dev.ckeditor.com/ticket/6099">#6099</a> : BIDI: when we apply explicit language direction to Numbered/Bulleted List the corresponding BIDI Tool bar icon is not highlighted in the Toolbar.</li>
 		<li><a href="http://dev.ckeditor.com/ticket/6100">#6100</a> : BIDI: when we change Table language direction indentation of text in Table cells is not applied correctly.</li>
-		<li><a href="http://dev.ckeditor.com/ticket/6376">#6376</a> : BIDI: BIDI buttons should not toggle the base language direction.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6376">#6376</a> : BIDI: buttons should not toggle the base language direction.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6235">#6235</a> : BIDI: Applying direction to multi-paragraph selection within a div.</li>
 		<li>Updated the following language files:<ul>
 			<li><a href="http://dev.ckeditor.com/ticket/6427">#6427</a> : Ukrainian;</li>
Index: /CKEditor/trunk/_source/plugins/bidi/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/bidi/plugin.js	(revision 5976)
+++ /CKEditor/trunk/_source/plugins/bidi/plugin.js	(revision 5977)
@@ -133,14 +133,30 @@
 	function getFullySelected( selection, elements )
 	{
-		var selectedElement = selection.getCommonAncestor();
-		while( selectedElement.type == CKEDITOR.NODE_ELEMENT
-				&& !( selectedElement.getName() in elements )
-				&& selectedElement.getParent().getChildCount() == 1
-			)
-			selectedElement = selectedElement.getParent();
-
-		return selectedElement.type == CKEDITOR.NODE_ELEMENT
-			&& ( selectedElement.getName() in elements )
-			&& selectedElement;
+		var ancestor = selection.getCommonAncestor();
+		if ( ancestor.type != CKEDITOR.NODE_ELEMENT )
+			return;
+
+		var ranges = selection.getRanges();
+
+		// Join multiple ranges.
+		var range = new CKEDITOR.dom.range( selection.document );
+		range.setStart( ranges[ 0 ].startContainer, ranges[ 0 ].startOffset );
+		range.setEnd( ranges[ ranges.length - 1 ].endContainer, ranges[ ranges.length - 1 ].endOffset );
+
+		range.enlarge( CKEDITOR.ENLARGE_BLOCK_CONTENTS );
+
+		if ( range.checkBoundaryOfElement( ancestor, CKEDITOR.START )
+				&& range.checkBoundaryOfElement( ancestor, CKEDITOR.END ) )
+		{
+			while ( ancestor.type == CKEDITOR.NODE_ELEMENT
+					&& !( ancestor.getName() in elements )
+					&& ancestor.getParent().getChildCount() == 1
+					)
+				ancestor = ancestor.getParent();
+
+			return ancestor.type == CKEDITOR.NODE_ELEMENT
+					&& ( ancestor.getName() in elements )
+					&& ancestor;
+		}
 	}
 
