Index: /FCKeditor/trunk/_whatsnew.html
===================================================================
--- /FCKeditor/trunk/_whatsnew.html	(revision 64)
+++ /FCKeditor/trunk/_whatsnew.html	(revision 65)
@@ -68,4 +68,10 @@
 		<li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1577202&group_id=75348&atid=543655">SF
 			PATCH-1577202</a>] The links created with the popup option now are accesible even if the user has javascript disabled.</li>
+		<li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1443472&group_id=75348&atid=543655">SF
+			PATCH-1443472</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1576488&group_id=75348&atid=543653">SF
+			BUG-1576488</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1334305&group_id=75348&atid=543653">SF
+			BUG-1334305</a>] [<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1578312&group_id=75348&atid=543653">SF
+			BUG-1578312</a>] The Paste from Word clean up function can be configured with FCKConfig.CleanWordKeepStructure to preserve 
+			the markup as much as possible. Thanks Jean-Charles ROGEZ. </li>
 	</ul>
 
@@ -151,6 +157,10 @@
 		<li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1610790&group_id=75348">SF BUG-1610790</a>] On some specific situations, the call to form.submit(), in form were FCKeditor has
 			been unloaded by code, was throwing the "Can't execute code from a freed script" error.</li>
+		<li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1613167&group_id=75348&atid=543653">SF BUG-1613167</a>] If the
+			configuration was missing the FCKConfig.AdditionalNumericEntities entry an error appeared.</li>
 		<li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1590848&group_id=75348&atid=543653">SF BUG-1590848</a>] 
 			Cleaning of Javascript strict warnings in Firefox.</li>
+		<li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1559466&group_id=75348&atid=543653">SF BUG-1559466</a>] 
+			The ol/ul list property window always searched first for a UL element.</li>
 		<li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&aid=1516008&group_id=75348&atid=543653">SF BUG-1516008</a>] 
 			Class attribute in IE wasn't loaded in the image dialog.</li>
Index: /FCKeditor/trunk/editor/_source/classes/fcktoolbarspecialcombo.js
===================================================================
--- /FCKeditor/trunk/editor/_source/classes/fcktoolbarspecialcombo.js	(revision 64)
+++ /FCKeditor/trunk/editor/_source/classes/fcktoolbarspecialcombo.js	(revision 65)
Index: /FCKeditor/trunk/editor/_source/internals/fckcommands.js
===================================================================
--- /FCKeditor/trunk/editor/_source/internals/fckcommands.js	(revision 64)
+++ /FCKeditor/trunk/editor/_source/internals/fckcommands.js	(revision 65)
@@ -28,6 +28,6 @@
 		case 'Unlink'		: oCommand = new FCKUnlinkCommand() ; break ;
 		case 'Anchor'		: oCommand = new FCKDialogCommand( 'Anchor'		, FCKLang.DlgAnchorTitle		, 'dialog/fck_anchor.html'		, 370, 170 ) ; break ;
-		case 'BulletedList'	: oCommand = new FCKDialogCommand( 'BulletedList', FCKLang.BulletedListProp		, 'dialog/fck_listprop.html'	, 370, 170 ) ; break ;
-		case 'NumberedList'	: oCommand = new FCKDialogCommand( 'NumberedList', FCKLang.NumberedListProp		, 'dialog/fck_listprop.html'	, 370, 170 ) ; break ;
+		case 'BulletedList'	: oCommand = new FCKDialogCommand( 'BulletedList', FCKLang.BulletedListProp		, 'dialog/fck_listprop.html?UL'	, 370, 170 ) ; break ;
+		case 'NumberedList'	: oCommand = new FCKDialogCommand( 'NumberedList', FCKLang.NumberedListProp		, 'dialog/fck_listprop.html?OL'	, 370, 170 ) ; break ;
 		case 'About'		: oCommand = new FCKDialogCommand( 'About'		, FCKLang.About					, 'dialog/fck_about.html'		, 400, 330 ) ; break ;
 
Index: /FCKeditor/trunk/editor/dialog/fck_listprop.html
===================================================================
--- /FCKeditor/trunk/editor/dialog/fck_listprop.html	(revision 64)
+++ /FCKeditor/trunk/editor/dialog/fck_listprop.html	(revision 65)
@@ -19,6 +19,7 @@
 // Gets the document DOM
 var oDOM = oEditor.FCK.EditorDocument ;
+var sListType = ( location.search == '?OL' ? 'OL' : 'UL' ) ;
 
-var oActiveEl = oEditor.FCKSelection.MoveToAncestorNode( 'UL' ) ;
+var oActiveEl = oEditor.FCKSelection.MoveToAncestorNode( sListType ) ;
 var oActiveSel ;
 
@@ -28,9 +29,8 @@
 	oEditor.FCKLanguageManager.TranslatePage(document) ;
 
-	if ( oActiveEl )
+	if ( sListType == 'UL' )
 		oActiveSel = GetE('selBulleted') ;
 	else
 	{
-		oActiveEl = oEditor.FCKSelection.MoveToAncestorNode( 'OL' ) ;
 		if ( oActiveEl )
 		{
Index: /FCKeditor/trunk/editor/dialog/fck_paste.html
===================================================================
--- /FCKeditor/trunk/editor/dialog/fck_paste.html	(revision 64)
+++ /FCKeditor/trunk/editor/dialog/fck_paste.html	(revision 65)
@@ -15,4 +15,7 @@
 	<script type="text/javascript">
 var oEditor = window.parent.InnerDialogLoaded() ;
+var FCK = oEditor.FCK;
+var FCKTools	= oEditor.FCKTools ;
+var FCKConfig	= oEditor.FCKConfig ;
 
 window.onload = function ()
@@ -48,11 +51,21 @@
 	{
 		var oFrame = document.getElementById('frmData') ;
-		
+		var oBody ;
+
 		if ( oFrame.contentDocument ) 
-			sHtml = oFrame.contentDocument.body.innerHTML ;
+			oBody = oFrame.contentDocument.body ;
 		else
-			sHtml = oFrame.contentWindow.document.body.innerHTML ;
-
-		sHtml = CleanWord( sHtml ) ;
+			oBody = oFrame.contentWindow.document.body ;
+
+		// If a plugin creates a FCK.CustomCleanWord function it will be called instead of the default one
+		if ( typeof( FCKTools.CustomCleanWord ) == 'function' )
+			sHtml = FCK.CustomCleanWord( oBody, document.getElementById('chkRemoveFont').checked, document.getElementById('chkRemoveStyles').checked ) ;
+		else
+			sHtml = CleanWord( oBody, document.getElementById('chkRemoveFont').checked, document.getElementById('chkRemoveStyles').checked ) ;
+
+
+		// Fix relative anchor URLs (IE automatically adds the current page URL).
+		var re = new RegExp( window.location + "#", "g" ) ;
+		sHtml = sHtml.replace( re, '#') ;
 	}
 	else
@@ -77,20 +90,24 @@
 }
 
-function CleanWord( html )
-{
-	var bIgnoreFont = document.getElementById('chkRemoveFont').checked ;
-	var bRemoveStyles = document.getElementById('chkRemoveStyles').checked ;
-
-	html = html.replace(/<o:p>\s*<\/o:p>/g, "") ;
-	html = html.replace(/<o:p>.*?<\/o:p>/g, "&nbsp;") ;
+
+// This function will be called from the PasteFromWord dialog (fck_paste.html)
+// Input: oNode a DOM node that contains the raw paste from the clipboard 
+// bIgnoreFont, bRemoveStyles booleans according to the values set in the dialog
+// Output: the cleaned string
+function CleanWord( oNode, bIgnoreFont, bRemoveStyles )
+{
+	var html = oNode.innerHTML ;
+
+	html = html.replace(/<o:p>\s*<\/o:p>/g, '') ;
+	html = html.replace(/<o:p>.*?<\/o:p>/g, '&nbsp;') ;
 	
 	// Remove mso-xxx styles.
-	html = html.replace( /\s*mso-[^:]+:[^;"]+;?/gi, "" ) ;
+	html = html.replace( /\s*mso-[^:]+:[^;"]+;?/gi, '' ) ;
 
 	// Remove margin styles.
-	html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*;/gi, "" ) ;
+	html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*;/gi, '' ) ;
 	html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*"/gi, "\"" ) ;
 
-	html = html.replace( /\s*TEXT-INDENT: 0cm\s*;/gi, "" ) ;
+	html = html.replace( /\s*TEXT-INDENT: 0cm\s*;/gi, '' ) ;
 	html = html.replace( /\s*TEXT-INDENT: 0cm\s*"/gi, "\"" ) ;
 
@@ -101,14 +118,14 @@
 	html = html.replace( /\s*FONT-VARIANT: [^\s;]+;?"/gi, "\"" ) ;
 
-	html = html.replace( /\s*tab-stops:[^;"]*;?/gi, "" ) ;
-	html = html.replace( /\s*tab-stops:[^"]*/gi, "" ) ;
+	html = html.replace( /\s*tab-stops:[^;"]*;?/gi, '' ) ;
+	html = html.replace( /\s*tab-stops:[^"]*/gi, '' ) ;
 
 	// Remove FONT face attributes.
 	if ( bIgnoreFont )
 	{
-		html = html.replace( /\s*face="[^"]*"/gi, "" ) ;
-		html = html.replace( /\s*face=[^ >]*/gi, "" ) ;
-
-		html = html.replace( /\s*FONT-FAMILY:[^;"]*;?/gi, "" ) ;
+		html = html.replace( /\s*face="[^"]*"/gi, '' ) ;
+		html = html.replace( /\s*face=[^ >]*/gi, '' ) ;
+
+		html = html.replace( /\s*FONT-FAMILY:[^;"]*;?/gi, '' ) ;
 	}
 	
@@ -135,37 +152,46 @@
 
 	// Remove XML elements and declarations
-	html = html.replace(/<\\?\?xml[^>]*>/gi, "") ;
+	html = html.replace(/<\\?\?xml[^>]*>/gi, '' ) ;
 	
 	// Remove Tags with XML namespace declarations: <o:p><\/o:p>
-	html = html.replace(/<\/?\w+:[^>]*>/gi, "") ;
+	html = html.replace(/<\/?\w+:[^>]*>/gi, '' ) ;
 	
 	// Remove comments [SF BUG-1481861].
-	html = html.replace(/<\!--.*-->/g, "") ;
-	
+	html = html.replace(/<\!--.*-->/g, '' ) ;
+
+	html = html.replace( /<(U|I|STRIKE)>&nbsp;<\/\1>/g, '&nbsp;' ) ;
+
 	html = html.replace( /<H\d>\s*<\/H\d>/gi, '' ) ;
 
-	html = html.replace( /<H1([^>]*)>/gi, '<div$1><b><font size="6">' ) ;
-	html = html.replace( /<H2([^>]*)>/gi, '<div$1><b><font size="5">' ) ;
-	html = html.replace( /<H3([^>]*)>/gi, '<div$1><b><font size="4">' ) ;
-	html = html.replace( /<H4([^>]*)>/gi, '<div$1><b><font size="3">' ) ;
-	html = html.replace( /<H5([^>]*)>/gi, '<div$1><b><font size="2">' ) ;
-	html = html.replace( /<H6([^>]*)>/gi, '<div$1><b><font size="1">' ) ;
-
-	html = html.replace( /<\/H\d>/gi, '<\/font><\/b><\/div>' ) ;
-	
-	html = html.replace( /<(U|I|STRIKE)>&nbsp;<\/\1>/g, '&nbsp;' ) ;
-
-	// Remove empty tags (three times, just to be sure).
-	html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
-	html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
-	html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
-
-	// Transform <P> to <DIV>
-	var re = new RegExp( "(<P)([^>]*>.*?)(<\/P>)", "gi" ) ;	// Different because of a IE 5.0 error
-	html = html.replace( re, "<div$2<\/div>" ) ;
-	
-	// Fix relative anchor URLs (IE automatically adds the current page URL).
-	re = new RegExp( window.location + "#", "g" ) ;
-	html = html.replace( re, '#') ;
+	if ( FCKConfig.CleanWordKeepsStructure )
+	{
+		// The original <Hn> tag send from Word is something like this: <Hn style="margin-top:0px;margin-bottom:0px">
+		html = html.replace( /<H(\d)([^>]*)>/gi, '<h$1>' ) ;
+
+		// Word likes to insert extra <font> tags, when using MSIE. (Wierd).
+		html = html.replace( /<(H\d)><FONT[^>]*>(.*?)<\/FONT><\/\1>/gi, '<$1>$2</$1>' );
+		html = html.replace( /<(H\d)><EM>(.*?)<\/EM><\/\1>/gi, '<$1>$2</$1>' );
+	}
+	else
+	{
+		html = html.replace( /<H1([^>]*)>/gi, '<div$1><b><font size="6">' ) ;
+		html = html.replace( /<H2([^>]*)>/gi, '<div$1><b><font size="5">' ) ;
+		html = html.replace( /<H3([^>]*)>/gi, '<div$1><b><font size="4">' ) ;
+		html = html.replace( /<H4([^>]*)>/gi, '<div$1><b><font size="3">' ) ;
+		html = html.replace( /<H5([^>]*)>/gi, '<div$1><b><font size="2">' ) ;
+		html = html.replace( /<H6([^>]*)>/gi, '<div$1><b><font size="1">' ) ;
+
+		html = html.replace( /<\/H\d>/gi, '<\/font><\/b><\/div>' ) ;
+
+		// Transform <P> to <DIV>
+		var re = new RegExp( '(<P)([^>]*>.*?)(<\/P>)', 'gi' ) ;	// Different because of a IE 5.0 error
+		html = html.replace( re, '<div$2<\/div>' ) ;
+
+		// Remove empty tags (three times, just to be sure).
+		// This also removes any empty anchor
+		html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
+		html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
+		html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
+	}
 
 	return html ;
Index: /FCKeditor/trunk/fckconfig.js
===================================================================
--- /FCKeditor/trunk/fckconfig.js	(revision 64)
+++ /FCKeditor/trunk/fckconfig.js	(revision 65)
@@ -153,4 +153,8 @@
 FCKConfig.BodyClass = '' ;
 
+// The option switches between trying to keep the html structure or do the changes so the content looks like it was in Word
+FCKConfig.CleanWordKeepStructure = false ;
+
+
 // The following value defines which File Browser connector and Quick Upload 
 // "uploader" to use. It is valid for the default implementaion and it is here
