summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-08-12 16:32:07 +0200
committerMichael Stahl <michael.stahl@cib.de>2020-08-13 16:58:09 +0200
commit5364c0815734d864e3c26090f1219d58a4022f8b (patch)
treefae322732c653ee9daa2e8bde8bf2f9cf4a75973 /sw
parent245470582c91e9ebb84e53a80afd86b7978e5650 (diff)
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/+/100660 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/undo/undobj.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 268e0ea5e3d6..9e043b1b1e23 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -1118,12 +1118,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;