Ticket #4944: 4944.patch

File 4944.patch, 1.5 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/pastefromword/filter/default.js

     
    228228                                                                                !listBaseIndent && ( listBaseIndent = value );
    229229
    230230                                                                                // Indent level start with one.
    231                                                                                 attrs[ 'cke:indent' ] = Math.floor( value / listBaseIndent ) + 1;
     231                                                                                attrs[ 'cke:indent' ] = Math.floor( value / listBaseIndent );
     232
    232233                                                                        } ]
    233234                                                        ] )( attrs.style, element ) || '' ;
    234235                                        }
     
    400401
    401402                                                        if ( !list )
    402403                                                        {
    403                                                                 parentList = list = new CKEDITOR.htmlParser.element( listType );
     404                                                                list = new CKEDITOR.htmlParser.element( listType );
    404405                                                                list.add( listItem );
    405406                                                                children[ i ] = list;
    406407                                                        }
     
    408409                                                        {
    409410                                                                if ( listItemIndent > indent )
    410411                                                                {
    411                                                                         parentList = list;
    412412                                                                        list = new CKEDITOR.htmlParser.element( listType );
    413413                                                                        list.add( listItem );
    414414                                                                        lastListItem.add( list );
    415415                                                                }
    416416                                                                else if ( listItemIndent < indent )
    417417                                                                {
    418                                                                         list = parentList;
    419                                                                         parentList = list.parent ? list.parent.parent : list;
     418                                                                        // There might be a negative gap between two list levels. (#4944)
     419                                                                        var diff = indent - listItemIndent;
     420                                                                        while( diff-- )
     421                                                                                list = list.parent.parent;
     422
    420423                                                                        list.add( listItem );
    421424                                                                }
    422425                                                                else
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy