Index: /FCKeditor/branches/features/style/editor/_source/classes/fckstyle.js
===================================================================
--- /FCKeditor/branches/features/style/editor/_source/classes/fckstyle.js	(revision 772)
+++ /FCKeditor/branches/features/style/editor/_source/classes/fckstyle.js	(revision 773)
@@ -1226,6 +1226,12 @@
 		var range = new FCKDomRange( targetWindow ) ;
 		range._Range = new FCKW3CRange( targetWindow.document ) ;
-		range._Range.setStart( startNode, 0 ) ;
-		range._Range.setEnd( endNode, endNode.nodeType == 1 ? endNode.childNodes.length : endNode.nodeValue.length ) ;
+		if ( startNode.nodeName.toLowerCase() == 'br' )
+			range._Range.setStartBefore( startNode ) ;
+		else
+			range._Range.setStart( startNode, 0 ) ;
+		if ( endNode.nodeName.toLowerCase() == 'br' )
+			range._Range.setEndBefore( endNode ) ;
+		else
+			range._Range.setEnd( endNode, endNode.nodeType == 1 ? endNode.childNodes.length : endNode.nodeValue.length ) ;
 		range._UpdateElementInfo() ;
 		paragraphList.push( range ) ;
@@ -1248,5 +1254,5 @@
 		// Get the starting point of the selection's paragraph.
 		var paragraphStartNode = startNode ;
-		while ( paragraphStartNode )
+		while ( paragraphStartNode && ! this._CheckIsParagraphBoundary( paragraphStartNode ) )
 		{
 			var candidate = null ;
@@ -1272,5 +1278,5 @@
 		// Get the ending point of the selection's paragraph.
 		var paragraphEndNode = endNode ;
-		while ( paragraphEndNode )
+		while ( paragraphEndNode && ! this._CheckIsParagraphBoundary( paragraphEndNode ) )
 		{
 			var candidate = null ;
@@ -1325,5 +1331,5 @@
 			{
 				// Ignore normal whitespaces (i.e. not including &nbsp; or other unicode whitespaces) after a block node.
-				if ( currentEnd.nodeValue.search( /^[\r\n\t ]*$/ ) == 0 )
+				if ( currentEnd.nodeValue.search( /^[\r\n\t ]+$/ ) == 0 )
 				{
 					var prevNode = currentEnd.previousSibling ;
@@ -1335,5 +1341,5 @@
 					}
 				}
-				else
+				else if ( currentEnd.nodeValue.length > 0 )
 					currentStart = currentEnd ;
 			}
