diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2020-08-12 16:32:07 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-08-17 10:30:43 +0200 |
commit | f54bcc07945a80dec20cf899caa2b1910a6eaa50 (patch) | |
tree | 3b53a95f8f5fa7bc3151ef32f2dbeb849112d902 | |
parent | Karasa Jaga: enlarge Insert Char/Symbol icons, update Ref Field icons (diff) | |
download | core-f54bcc07945a80dec20cf899caa2b1910a6eaa50.tar.gz core-f54bcc07945a80dec20cf899caa2b1910a6eaa50.zip |
sw: avoid assert when deletion starts at fieldmark end
This hit assert(bSavePos && bSaveOtherPos);
Tweak SwUndoSaveContent::DelContentIndex() for fieldmarks to only accept
an equal end position if the start position was in range as well.
(regression from 24fd14b387dca458a1b6e9415e936d26562ddb1e)
Change-Id: If6c9b049193bb7f1bc39ec66d1c965512f9d6ec1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100673
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/core/undo/undobj.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index c37cffbaf9f8..bfea81a886b6 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -1097,12 +1097,14 @@ void SwUndoSaveContent::DelContentIndex( const SwPosition& rMark, if( pBkmk->IsExpanded() && *pStt <= pBkmk->GetOtherMarkPos() && pBkmk->GetOtherMarkPos() <= *pEnd ) { - if ( bSavePos || bSaveOtherPos + assert(!bSaveOtherPos); + if ( bSavePos || (*pStt < pBkmk->GetOtherMarkPos() && pBkmk->GetOtherMarkPos() < *pEnd) - || type == IDocumentMarkAccess::MarkType::TEXT_FIELDMARK - || type == IDocumentMarkAccess::MarkType::CHECKBOX_FIELDMARK - || type == IDocumentMarkAccess::MarkType::DROPDOWN_FIELDMARK - || type == IDocumentMarkAccess::MarkType::DATE_FIELDMARK) + || (bMaybe + && ( type == IDocumentMarkAccess::MarkType::TEXT_FIELDMARK + || type == IDocumentMarkAccess::MarkType::CHECKBOX_FIELDMARK + || type == IDocumentMarkAccess::MarkType::DROPDOWN_FIELDMARK + || type == IDocumentMarkAccess::MarkType::DATE_FIELDMARK))) { if( bMaybe ) bSavePos = true; |