Ticket #6662: 6662_5.patch

File 6662_5.patch, 2.6 KB (added by Garry Yao, 13 years ago)
  • _source/plugins/pastefromword/filter/default.js

     
    228228                                                                                margin = parseInt( margin, 10 );
    229229
    230230                                                                                // Figure out the indent unit by looking at the first increament.
    231                                                                                 if ( !listBaseIndent && previousListItemMargin && margin > previousListItemMargin )
     231                                                                                if ( !listBaseIndent && previousListItemMargin != undefined && margin > previousListItemMargin )
    232232                                                                                        listBaseIndent = margin - previousListItemMargin;
    233233
    234234                                                                                attrs[ 'cke:margin' ] = previousListItemMargin = margin;
     
    236236                                                        ] )( attrs.style, element ) || '' ;
    237237                                        }
    238238
     239                                        // First level list item are always presented without a margin.
     240                                        !attrs[ 'cke:margin' ] && ( attrs[ 'cke:margin' ] = previousListItemMargin = 0 );
     241
    239242                                        // Inherit list-type-style from bullet.
    240243                                        var listBulletAttrs = listMarker.attributes,
    241244                                                listBulletStyle = listBulletAttrs.style;
     
    392395                                                        // been resolved from a pseudo list item's margin value, even get
    393396                                                        // no indentation at all.
    394397                                                        listItemIndent = parseInt( listItemAttrs[ 'cke:indent' ], 10 )
    395                                                                                                         || listBaseIndent && ( Math.ceil( listItemAttrs[ 'cke:margin' ] / listBaseIndent ) )
     398                                                                                                        || listBaseIndent && ( Math.ceil( listItemAttrs[ 'cke:margin' ] / listBaseIndent ) + 1 )
    396399                                                                                                        || 1;
    397400
    398401                                                        // Ignore the 'list-style-type' attribute if it's matched with
     
    755758
    756759                                        'p' : function( element )
    757760                                        {
     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
    758772                                                element.filterChildren();
    759773
    760774                                                // Is the paragraph actually a list item?
     
    11151129                // Allow extending data filter rules.
    11161130                editor.fire( 'beforeCleanWord', { filter : dataFilter } );
    11171131
     1132                data = dataProcessor.toHtml( data, false );
    11181133                try
    11191134                {
    1120                         data = dataProcessor.toHtml( data, false );
    11211135                }
    11221136                catch ( e )
    11231137                {
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy