Index: /FCKeditor/branches/features/div_container/editor/_source/classes/fckdomrange.js
===================================================================
--- /FCKeditor/branches/features/div_container/editor/_source/classes/fckdomrange.js	(revision 2205)
+++ /FCKeditor/branches/features/div_container/editor/_source/classes/fckdomrange.js	(revision 2206)
@@ -67,5 +67,10 @@
 			}
 			else if ( eEndNode.nodeType == 1 )
-				eEndNode = eEndNode.childNodes[ innerRange.endOffset - 1 ] ;
+			{
+				if ( innerRange.endContainer != innerRange.startContainer || innerRange.endOffset != innerRange.startOffset )
+					eEndNode = eEndNode.childNodes[ innerRange.endOffset - 1 ] ;
+				else
+					eEndNode = eEndNode.childNodes[ innerRange.endOffset ] ;
+			}
 
 			this.EndNode			= eEndNode ;
Index: /FCKeditor/branches/features/div_container/editor/_source/internals/fckdomtools.js
===================================================================
--- /FCKeditor/branches/features/div_container/editor/_source/internals/fckdomtools.js	(revision 2205)
+++ /FCKeditor/branches/features/div_container/editor/_source/internals/fckdomtools.js	(revision 2206)
@@ -1032,17 +1032,17 @@
 		var endNode = range.EndNode ;
 		var currentNode = startNode ;
-		
+
 		if ( startNode == endNode )
 		{
-			while ( endNode.lastChild )
+			while ( endNode.nodeType == 1 && endNode.lastChild )
 				endNode = endNode.lastChild ;
 			endNode = FCKDomTools.GetNextSourceElement( endNode ) ;
 		}
 
-		while ( currentNode != endNode && currentNode != endNode.parentNode )
+		while ( currentNode && currentNode != endNode && currentNode != endNode.parentNode )
 		{
 			var path = new FCKElementPath( currentNode ) ;
 			var blockLimit = path.BlockLimit ;
-			if ( blockLimit && blockLimit.nodeName.IEquals( 'div' ) && currentBlocks.indexOf( blockLimit ) == -1 )
+			if ( blockLimit && blockLimit.nodeName.IEquals( 'div' ) && currentBlocks.IndexOf( blockLimit ) == -1 )
 				currentBlocks.push( blockLimit ) ;
 
Index: /FCKeditor/branches/features/div_container/editor/dialog/fck_div.html
===================================================================
--- /FCKeditor/branches/features/div_container/editor/dialog/fck_div.html	(revision 2205)
+++ /FCKeditor/branches/features/div_container/editor/dialog/fck_div.html	(revision 2206)
@@ -138,5 +138,5 @@
 			GetE( 'txtId' ).value = target.id ;
 			GetE( 'txtLang' ).value = target.lang ;
-			GetE( 'txtInlineStyle').value = target.getAttribute( 'style' ) ;
+			GetE( 'txtInlineStyle').value = target.style.cssText ;
 			GetE( 'txtTitle' ).value = target.title ;
 			GetE( 'selLangDir').value = target.dir || GetNearestAncestorDirection( target ) ;
