Kaydet (Commit) 76a5c713 authored tarafından Michael Stahl's avatar Michael Stahl

sw: fix assert in MarkManager::deleteMarks()

On loading tdf89405-1.odt there is a "DdeLink" bookmark and a range
annotation at the same position:

info:sw.core:17729:1:sw/source/core/doc/docbm.cxx:290: N2sw4mark8BookmarkE __DdeLink__30_388680695 11,11 11,52
info:sw.core:17729:1:sw/source/core/doc/docbm.cxx:290: N2sw4mark7UnoMarkE __UnoMark__16_673019520 11,11 11,11
info:sw.core:17729:1:sw/source/core/doc/docbm.cxx:290: N2sw4mark7UnoMarkE __UnoMark__19_673019520 11,12 11,12

While deleting the annotation's field character at 11,11-11,12 the
DdeLink one is moved but the UnoMarks are special-cased and remain where
they are, so just do some more sorting in this case.

Change-Id: If077329bf675cdf8dd788cc145252a078aba3750
üst 92664a81
......@@ -674,6 +674,8 @@ namespace sw { namespace mark
// boolean indicating, if at least one mark has been moved while collecting marks for deletion
bool bMarksMoved = false;
// have marks in the range been skipped instead of deleted
bool bMarksSkipDeletion = false;
// copy all bookmarks in the move area to a vector storing all position data as offset
// reassignment is performed after the move
......@@ -748,6 +750,10 @@ namespace sw { namespace mark
}
vMarksToDelete.push_back(ppMark);
}
else
{
bMarksSkipDeletion = true;
}
}
else if ( bIsPosInRange != bIsOtherPosInRange )
{
......@@ -826,7 +832,9 @@ namespace sw { namespace mark
}
} // scope to kill vDelay
if ( bIsSortingNeeded )
// also need to sort if both marks were moved and not-deleted because
// the not-deleted marks could be in wrong order vs. the moved ones
if (bIsSortingNeeded || (bMarksMoved && bMarksSkipDeletion))
{
sortMarks();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment