diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2021-01-13 14:35:24 +0100 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2021-01-20 17:24:42 +0100 |
commit | 8ba16d77881fe199a3c2ea40fb9c18741e17af5f (patch) | |
tree | 3c18ca6194ac94eefd991aac1c4b0e09981c40a9 /sw | |
parent | 00d5eb31363cc4abd5b3d0f828256ff4e2f48303 (diff) |
tdf#135014 sw_fieldmarkhide: allow section overlap with fieldmark
In this bugdoc it happens that the field with instruction
"\aINDEX \\c \"2\"\\h \"A\" \\e \"\t\"\003\063 "
result end is on a node following the start of a section,
so sw::mark::FindFieldSep() asserts.
In this case it looks like the section was wrongly set by the import,
but experimenting with Word reveals that it will respect sectPr on a
paragraph inside a field, so i guess we need to cope with that.
Also adapt InsertCnt_() to skip the section end node.
Change-Id: I5517d463de43b04bf773528a28de12123e534069
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109305
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit 359deaee45fd4a2bfe7aae255e6da38a9e1931ff)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109344
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/crsr/bookmrk.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/layout/frmtool.cxx | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx index 89352072ac70..d76b43cebf2a 100644 --- a/sw/source/core/crsr/bookmrk.cxx +++ b/sw/source/core/crsr/bookmrk.cxx @@ -104,15 +104,15 @@ namespace sw::mark } } } - else if (pNode->IsEndNode()) + else if (pNode->IsEndNode() && !pNode->StartOfSectionNode()->IsSectionNode()) { assert(nStartNode <= pNode->StartOfSectionIndex()); - // fieldmark cannot overlap node section + // fieldmark cannot overlap node section, unless it's a section n = pNode->StartOfSectionIndex(); } else { - assert(pNode->IsNoTextNode()); + assert(pNode->IsNoTextNode() || pNode->IsSectionNode()); } } assert(ret); // must have found it diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 8590af6aa2a4..9228b4a8b68e 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -1811,6 +1811,11 @@ void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc, assert(pNd->GetRedlineMergeFlag() == SwNode::Merge::Hidden); continue; // skip it } + if (pLayout->HasMergedParas() && !pNd->StartOfSectionNode()->IsCreateFrameWhenHidingRedlines()) + { // tdf#135014 section break in fieldmark (start inside, end outside) + assert(pNd->StartOfSectionNode()->GetRedlineMergeFlag() == SwNode::Merge::Hidden); + continue; // skip it + } assert(pActualSection && "Section end without section start?"); assert(pActualSection->GetSectionNode() == pNd->StartOfSectionNode()); |