X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fpastefromword%2Ffilter%2Fdefault.js;h=2eb948dab82c44128aaf54e19ff49485f7cd361c;hp=dce3649ab778a1a2c2d38014908a1c04dc4d050b;hb=f0610347140239143439a511ee2bd48cb784f470;hpb=4e70ea24db840898be8cc21c950363a52a2a6aba diff --git a/_source/plugins/pastefromword/filter/default.js b/_source/plugins/pastefromword/filter/default.js index dce3649..2eb948d 100644 --- a/_source/plugins/pastefromword/filter/default.js +++ b/_source/plugins/pastefromword/filter/default.js @@ -261,8 +261,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { // Deal with component/short-hand form. var values = margin.split( ' ' ); - margin = plugin.utils.convertToPx( values[ 3 ] || values[ 1 ] || values [ 0 ] ); - margin = parseInt( margin, 10 ); + margin = CKEDITOR.tools.convertToPx( values[ 3 ] || values[ 1 ] || values [ 0 ] ); // Figure out the indent unit by checking the first time of incrementation. if ( !listBaseIndent && previousListItemMargin !== null && margin > previousListItemMargin ) @@ -279,8 +278,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var listId = Number( val[ 0 ].match( /\d+/ ) ), indent = Number( val[ 1 ].match( /\d+/ ) ); - listId !== previousListId && ( attrs[ 'cke:reset' ] = 1 ); - previousListId = listId; + if ( indent == 1 ) + { + listId !== previousListId && ( attrs[ 'cke:reset' ] = 1 ); + previousListId = listId; + } attrs[ 'cke:indent' ] = indent; } ] ] )( attrs.style, element ) || ''; @@ -307,27 +309,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license return false; }, - // Convert various length units to 'px' in ignorance of DPI. - convertToPx : ( function () - { - var calculator = CKEDITOR.dom.element.createFromHtml( - '
', CKEDITOR.document ); - CKEDITOR.document.getBody().append( calculator ); - - return function( cssLength ) - { - if ( cssLengthRelativeUnit.test( cssLength ) ) - { - calculator.setStyle( 'width', cssLength ); - return calculator.$.clientWidth + 'px'; - } - - return cssLength; - }; - } )(), - // Providing a shorthand style then retrieve one or more style component values. getStyleComponents : ( function() { @@ -357,20 +338,12 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // E.g.