X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fpastefromword%2Ffilter%2Fdefault.js;h=353e4bfc5e1442a98e42d290f7ca3e5e429d6f51;hb=2f22c0c38f17e75be5541089076885442aaa2377;hp=dce3649ab778a1a2c2d38014908a1c04dc4d050b;hpb=4e90e78dc97789709ee7404359a5517540c27553;p=ckeditor.git diff --git a/_source/plugins/pastefromword/filter/default.js b/_source/plugins/pastefromword/filter/default.js index dce3649..353e4bf 100644 --- a/_source/plugins/pastefromword/filter/default.js +++ b/_source/plugins/pastefromword/filter/default.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -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.