• Michael Stahl's avatar
    tdf#96480: ODF import: eliminate duplicate cross reference heading bookmarks · 774fb6d2
    Michael Stahl yazdı
    7c3c3006 is apparently worse than it
    appeared at first glance since there are numerous assumptions about
    bookmarks, such as that if they were inserted successfully they may be
    copied successfully, which isn't the case for duplicate cross reference
    bookmarks.
    
    So fix this differently, by eliminating the duplicates and mapping all
    reference fields to refer to the surviving bookmark.
    
    It was not possible to do this in SwXBookmark by checking the makeMark()
    return as that would raise interesting problems such as it's currently
    guaranteed to have 1:1 SwXBoomarks to core Marks so we can't just
    connect 2 SwXBookmarks to the same core Mark, and we also can't leave
    the SwXBookmark unconnected after attach.
    
    Another alternative would be to temporarily allow inserting the
    duplicate bookmarks and then eliminate them after the import, but what
    is implemented now is to check from xmloff for duplicates, which is
    reasonably simple.
    
    Change-Id: I7ee4854d1c9d8bf74201089cbb7287b1bd8ee3b9
    774fb6d2
IDocumentMarkAccess.hxx 9.55 KB