Index: /CKEditor/tests/tt/6461/1.html
===================================================================
--- /CKEditor/tests/tt/6461/1.html	(revision 6503)
+++ /CKEditor/tests/tt/6461/1.html	(revision 6503)
@@ -0,0 +1,124 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+	"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+	<title>Ticket: #6461 - BIDI switching between list and paragraph on selection</title>
+	<meta name="tags" content="editor,unit,all">
+	<script type="text/javascript" src="../../cktester/cell.js"></script>
+	<script>
+( function()
+{
+	var ts, tc, assert = CKEDITOR.test.assert, test = CKEDITOR.test, selector = YAHOO.util.Selector;
+
+	YAHOO.tool.TestRunner.add( ts = new CKEDITOR.test.suites.editorTestSuite(
+		{
+				editorName : 'test_editor_1',
+				name :document.title
+		} ) );
+
+	ts.add( tc = new YAHOO.tool.TestCase(
+		{
+			setUp : function ()
+			{
+				// Force result data un-formatted.
+				ts.editor.dataProcessor.writer._.rules = {};
+				ts.editor.focus();
+
+			},
+
+			test_set_numberedlist: function()
+			{
+				var editor = ts.editor,
+					contentWithSelection = test.getValueAsHtml( 'input_1' ),
+					output = '<p>paragraph 1</p><p style="text-align: center; ">paragraph 2</p><p style="text-align: right; ">paragraph 3</p>',
+					outputOpera ='<p>paragraph 1</p><p style="text-align:center;">paragraph 2</p><p style="text-align:right;">paragraph 3</p>';
+				test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection );
+				
+				editor.execCommand( 'selectAll' );
+				editor.execCommand( 'numberedlist' );
+				
+				this.wait( function ()
+				{
+					editor.execCommand( 'numberedlist' );
+				
+					assert.areSame( CKEDITOR.env.opera? outputOpera : output, editor.getData() );
+					
+				}, 1000 );
+			},
+			
+			test_set_bulletedlist: function()
+			{
+				var editor = ts.editor,
+					contentWithSelection = test.getValueAsHtml( 'input_1' ),
+					outputOpera ='<p>paragraph 1</p><p style="text-align:center;">paragraph 2</p><p style="text-align:right;">paragraph 3</p>',
+					output = '<p>paragraph 1</p><p style="text-align: center; ">paragraph 2</p><p style="text-align: right; ">paragraph 3</p>';
+				
+				test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection );
+				
+				editor.execCommand( 'selectAll' );
+				editor.execCommand( 'bulletedlist' );
+				
+				this.wait( function ()
+				{
+					editor.execCommand( 'bulletedlist' );
+				
+					assert.areSame( CKEDITOR.env.opera? outputOpera : output, editor.getData() );
+					
+				}, 1000 );
+			},
+			test_set_numberedlist_bidi: function()
+			{
+				var editor = ts.editor,
+					contentWithSelection = test.getValueAsHtml( 'input_1' ),
+					outputOpera = '<p dir="rtl">paragraph 1</p><p dir="rtl" style="text-align:center;">paragraph 2</p><p dir="rtl" style="text-align: left">paragraph 3</p>',
+					output = '<p dir="rtl">paragraph 1</p><p dir="rtl" style="text-align: center; ">paragraph 2</p><p dir="rtl" style="text-align: left; ">paragraph 3</p>';
+				
+				test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection );
+				
+				editor.execCommand( 'selectAll' );
+				editor.execCommand( 'bidirtl' );
+				editor.execCommand( 'numberedlist' );
+				
+				this.wait( function ()
+				{
+					editor.execCommand( 'numberedlist' );
+				
+					assert.areSame( CKEDITOR.env.opera? outputOpera : output, editor.getData() );
+					
+				}, 1000 );
+			},
+			
+			test_set_bulletedlist_bidi: function()
+			{
+				var editor = ts.editor,
+					contentWithSelection = test.getValueAsHtml( 'input_1' ),
+					outputOpera = '<p dir="rtl">paragraph 1</p><p dir="rtl" style="text-align:center;">paragraph 2</p><p dir="rtl" style="text-align: left">paragraph 3</p>',
+					output = '<p dir="rtl">paragraph 1</p><p dir="rtl" style="text-align: center; ">paragraph 2</p><p dir="rtl" style="text-align: left; ">paragraph 3</p>';
+				
+				test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection );
+				
+				editor.execCommand( 'selectAll' );
+				editor.execCommand( 'bidirtl' );
+				editor.execCommand( 'bulletedlist' );
+				
+				this.wait( function ()
+				{
+					editor.execCommand( 'bulletedlist' );
+				
+					assert.areSame( CKEDITOR.env.opera? outputOpera : output, editor.getData() );
+					
+				}, 1000 );
+			}
+			
+		} ) );
+} )();
+	</script>
+</head>
+<body>
+<textarea id='input_1'>
+	<p>Paragraph 1</p>
+	<p style="text-align: center;">Paragraph 2</p>
+	<p style="text-align: right;">Paragraph 3</p>
+</textarea>
+</body>
+</html>
