• Caolán McNamara's avatar
    Resolves: tdf#119259 reused in-use SdStyleSheet removed by undo · 27fb6f22
    Caolán McNamara yazdı
    since...
    
    commit a4cd8415
    Date:   Thu Feb 13 16:10:47 2014 +0530
    
        n#757432: Styles (rename &) copy to different decks.
    
        While copying slides to different slide decks,
        styles were not being copied if there is already one
        with the same name. This patch renames and copies those
        to keep the formatting intact.
    
    if a SdStyleSheet is not freshly created, but reused, it ends up in
    the rCreatedSheets list, and so when the copy is undone
    (via SdMoveStyleSheetsUndoAction), the SdStyleSheet is unconditionally
    remove from the StylePool and so its ref count hits 0 and is removed,
    even though there are still objects depending on it.
    
    the problem becames more common since...
    
    bash-4.4$ git show 57db6e24
    commit 57db6e24
    Date:   Tue Aug 15 02:51:07 2017 +0530
    
        Removing old SfxItemSet::getHash usage
    
    improves the SfxItemSet comparison.
    
    Assuming that its correct to leave SdStyleSheetPool::CopySheets
    with those reused SdStyleSheets in the list, change things so
    that a flag is passed around to indicate if the SdStyleSheet
    should be removed or not by undo
    
    Change-Id: I82b5bd93183fd1ff9e67957ccfb5babef81fd36d
    Reviewed-on: https://gerrit.libreoffice.org/59432
    Tested-by: Jenkins
    Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
    Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
    27fb6f22