Ticket #6662: 6662_5.patch
File 6662_5.patch, 2.6 KB (added by , 13 years ago) |
---|
-
_source/plugins/pastefromword/filter/default.js
228 228 margin = parseInt( margin, 10 ); 229 229 230 230 // Figure out the indent unit by looking at the first increament. 231 if ( !listBaseIndent && previousListItemMargin && margin > previousListItemMargin )231 if ( !listBaseIndent && previousListItemMargin != undefined && margin > previousListItemMargin ) 232 232 listBaseIndent = margin - previousListItemMargin; 233 233 234 234 attrs[ 'cke:margin' ] = previousListItemMargin = margin; … … 236 236 ] )( attrs.style, element ) || '' ; 237 237 } 238 238 239 // First level list item are always presented without a margin. 240 !attrs[ 'cke:margin' ] && ( attrs[ 'cke:margin' ] = previousListItemMargin = 0 ); 241 239 242 // Inherit list-type-style from bullet. 240 243 var listBulletAttrs = listMarker.attributes, 241 244 listBulletStyle = listBulletAttrs.style; … … 392 395 // been resolved from a pseudo list item's margin value, even get 393 396 // no indentation at all. 394 397 listItemIndent = parseInt( listItemAttrs[ 'cke:indent' ], 10 ) 395 || listBaseIndent && ( Math.ceil( listItemAttrs[ 'cke:margin' ] / listBaseIndent ) )398 || listBaseIndent && ( Math.ceil( listItemAttrs[ 'cke:margin' ] / listBaseIndent ) + 1 ) 396 399 || 1; 397 400 398 401 // Ignore the 'list-style-type' attribute if it's matched with … … 755 758 756 759 'p' : function( element ) 757 760 { 761 // This's a fall-back approach to recognize list item in FF3.6, 762 // as it's not perfect as not all list style (e.g. "heading list") is shipped 763 // with this pattern. (#6662) 764 if ( /MsoListParagraph/.exec( element.attributes[ 'class' ] ) ) 765 { 766 var bulletText = element.firstChild( function( node ) { return node.type == CKEDITOR.NODE_TEXT; } ); 767 var bullet = bulletText && bulletText.parent, 768 bulletAttrs = bullet && bullet.attributes; 769 bulletAttrs && !bulletAttrs.style && ( bulletAttrs.style = 'mso-list: Ignore;' ); 770 } 771 758 772 element.filterChildren(); 759 773 760 774 // Is the paragraph actually a list item? … … 1115 1129 // Allow extending data filter rules. 1116 1130 editor.fire( 'beforeCleanWord', { filter : dataFilter } ); 1117 1131 1132 data = dataProcessor.toHtml( data, false ); 1118 1133 try 1119 1134 { 1120 data = dataProcessor.toHtml( data, false );1121 1135 } 1122 1136 catch ( e ) 1123 1137 {