Ticket #4945: 4945_2.patch
File 4945_2.patch, 2.9 KB (added by , 13 years ago) |
---|
-
_source/plugins/pastefromword/filter/default.js
226 226 if ( !listBaseIndent && previousListItemMargin && margin > previousListItemMargin ) 227 227 listBaseIndent = margin - previousListItemMargin; 228 228 229 attrs[ 'cke:margin' ] = previousListItemMargin = margin; 229 previousListItemMargin = margin; 230 attrs[ 'cke:indent' ] = listBaseIndent && Math.ceil( margin / listBaseIndent ) || 1; 230 231 } ] 231 232 ] )( attrs.style, element ) || '' ; 232 233 } … … 323 324 for ( var i = 0; i < children.length; i++ ) 324 325 { 325 326 child = children[ i ]; 326 var attributes = child.attributes;327 327 328 328 if ( child.name in CKEDITOR.dtd.$listItem ) 329 329 { 330 330 var listItemChildren = child.children, 331 attributes = child.attributes, 331 332 count = listItemChildren.length, 332 333 last = listItemChildren[ count - 1 ]; 333 334 … … 342 343 children.splice( i, 1 ); 343 344 } 344 345 346 // #4945: list presentation might be mixed with <li> and <p>, also analysis the 347 // the 'tab-stops' to figure out base indent unit. 348 attributes.style = CKEDITOR.plugins.pastefromword.filters.stylesFilter( 349 [ 350 // Resolve indent level from 'tab-stops' value. 351 [ ( /^tab-stops$/ ), null, function( margin ) 352 { 353 // Be able to deal with component/short-hand form style. 354 var values = margin.split( ' ' ); 355 margin = values[ 3 ] || values[ 1 ] || values [ 0 ]; 356 margin = parseInt( margin, 10 ); 357 358 // Figure out the 359 if ( !listBaseIndent && previousListItemMargin && margin > previousListItemMargin ) 360 listBaseIndent = margin - previousListItemMargin; 361 362 previousListItemMargin = margin; 363 } ] 364 ] )( attributes.style, element ) || '' ; 365 345 366 child.name = 'cke:li'; 346 367 attributes[ 'cke:indent' ] = indentLevel; 347 previousListItemMargin = 0;348 368 attributes[ 'cke:listtype' ] = element.name; 349 369 listStyleType && child.addStyle( 'list-style-type', listStyleType, true ); 350 370 } … … 386 406 // List item indent level might come from a real list indentation or 387 407 // been resolved from a pseudo list item's margin value, even get 388 408 // no indentation at all. 389 listItemIndent = parseInt( listItemAttrs[ 'cke:indent' ], 10 ) 390 || listBaseIndent && ( Math.ceil( listItemAttrs[ 'cke:margin' ] / listBaseIndent ) ) 391 || 1; 409 listItemIndent = parseInt( listItemAttrs[ 'cke:indent' ], 10 ); 392 410 393 411 // Ignore the 'list-style-type' attribute if it's matched with 394 412 // the list root element's default style type.