Index: /CKEditor/branches/versions/3.4.x/CHANGES.html
===================================================================
--- /CKEditor/branches/versions/3.4.x/CHANGES.html	(revision 5762)
+++ /CKEditor/branches/versions/3.4.x/CHANGES.html	(revision 5763)
@@ -61,4 +61,5 @@
 		<li><a href="http://dev.fckeditor.net/ticket/5689">#5689</a> : Make it possible to run CKEditor inside of Firefox chrome.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/5531">#5531</a> : Not all IDs had the "cke_" prefix.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/6042">#6042</a> : It wasn't possible to align a paragarph with the dir attribute to the opposite direction.</li>		
 	</ul>
 	<h3>
Index: /CKEditor/branches/versions/3.4.x/_source/plugins/justify/plugin.js
===================================================================
--- /CKEditor/branches/versions/3.4.x/_source/plugins/justify/plugin.js	(revision 5762)
+++ /CKEditor/branches/versions/3.4.x/_source/plugins/justify/plugin.js	(revision 5763)
@@ -20,5 +20,5 @@
 
 		var currentAlign = firstBlock.getComputedStyle( 'text-align' ).replace( alignRemoveRegex, '' );
-		if ( ( !currentAlign && this.isDefaultAlign ) || currentAlign == this.value )
+		if ( ( !currentAlign && isDefaultAlign( this, firstBlock ) ) || currentAlign == this.value )
 			return CKEDITOR.TRISTATE_ON;
 		return CKEDITOR.TRISTATE_OFF;
@@ -32,12 +32,16 @@
 	}
 
+	function isDefaultAlign( command, element )
+	{
+		var direction = element.getComputedStyle( 'direction' ),
+			val = command.value;
+		return ( direction == 'rtl' && val == 'right' ) || ( direction == 'ltr' && val == 'left' );
+		
+	}
+
 	function justifyCommand( editor, name, value )
 	{
 		this.name = name;
 		this.value = value;
-
-		var contentDir = editor.config.contentsLangDirection;
-		this.isDefaultAlign = ( value == 'left' && contentDir == 'ltr' ) ||
-			( value == 'right' && contentDir == 'rtl' );
 
 		var classes = editor.config.justifyClasses;
@@ -89,4 +93,6 @@
 					block.removeAttribute( 'align' );
 
+					var isDefault = isDefaultAlign( this, block );
+
 					if ( cssClassName )
 					{
@@ -96,5 +102,5 @@
 
 						// Append the desired class name.
-						if ( this.state == CKEDITOR.TRISTATE_OFF && !this.isDefaultAlign )
+						if ( this.state == CKEDITOR.TRISTATE_OFF && !isDefault )
 							block.addClass( cssClassName );
 						else if ( !className )
@@ -103,5 +109,5 @@
 					else
 					{
-						if ( this.state == CKEDITOR.TRISTATE_OFF && !this.isDefaultAlign )
+						if ( this.state == CKEDITOR.TRISTATE_OFF && !isDefault )
 							block.setStyle( 'text-align', this.value );
 						else
