Ticket #4945: 4945.patch

File 4945.patch, 1.7 KB (added by Paweł Horzela, 14 years ago)

Patch

  • _source/plugins/pastefromword/filter/default.js

     
    325325                                                child = children[ i ];
    326326                                                var attributes = child.attributes;
    327327
     328                                                // #4945: Paste: Outline Numbered list do not copy correctly v2
     329                                                if ( attributes )
     330                                                {
     331                                                        attributes.style = CKEDITOR.plugins.pastefromword.filters.stylesFilter(
     332                                                                [
     333                                                                        // Resolve indent level from 'tab-stops' value.
     334                                                                        [ ( /^tab-stops$/ ), null, function( margin )
     335                                                                        {
     336                                                                                // Be able to deal with component/short-hand form style.
     337                                                                                var values = margin.split( ' ' );
     338                                                                                margin = values[ 3 ] || values[ 1 ] || values [ 0 ];
     339                                                                                margin = parseInt( margin, 10 );
     340
     341                                                                                // Figure out the indent unit by looking at the first increament.
     342                                                                                if ( !listBaseIndent && previousListItemMargin && margin > previousListItemMargin )
     343                                                                                        listBaseIndent = margin - previousListItemMargin;
     344
     345                                                                                attributes[ 'cke:margin' ] = previousListItemMargin = margin;
     346                                                                        } ]
     347                                                        ] )( attributes.style, element ) || '' ;
     348                                                }
     349
    328350                                                if ( child.name in CKEDITOR.dtd.$listItem )
    329351                                                {
    330352                                                        var listItemChildren = child.children,
     
    344366
    345367                                                        child.name = 'cke:li';
    346368                                                        attributes[ 'cke:indent' ] = indentLevel;
    347                                                         previousListItemMargin = 0;
    348369                                                        attributes[ 'cke:listtype' ] = element.name;
    349370                                                        listStyleType && child.addStyle( 'list-style-type', listStyleType, true );
    350371                                                }
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy