sw/source/core/crsr/bookmrk.cxx   |    6 +++---
 sw/source/core/layout/frmtool.cxx |    5 +++++
 sw/source/core/text/redlnitr.cxx  |    2 +-
 3 files changed, 9 insertions(+), 4 deletions(-)

New commits:
commit 8ba16d77881fe199a3c2ea40fb9c18741e17af5f
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Wed Jan 13 14:35:24 2021 +0100
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Wed Jan 20 17:24:42 2021 +0100

    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.st...@allotropia.de>
    (cherry picked from commit 359deaee45fd4a2bfe7aae255e6da38a9e1931ff)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109344
    Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de>

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());
 
commit 00d5eb31363cc4abd5b3d0f828256ff4e2f48303
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Wed Jan 13 11:58:36 2021 +0100
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Wed Jan 20 17:24:34 2021 +0100

    tdf#135014 sw_fieldmarkhide: fix bogus assert on loading the bugdoc
    
    The == case was omitted, iirc because of changing the first compare at
    the last minute.
    
    (regression from aacaa2aa91f705d64b929b5cff2872f160021b9f)
    
    Change-Id: I03602917def8248150139d788c880d93cab18bf1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109304
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit 0771b84e4c5002338275da0d061f966e2fc47505)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109343
    Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de>

diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index 2e3d1f55a06e..a56142dff8f1 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -182,7 +182,7 @@ public:
         }
         else if (m_oNextFieldmarkHide)
         {
-            assert(!pNextRedlineHide || *m_oNextFieldmarkHide < 
*pNextRedlineHide);
+            assert(!pNextRedlineHide || *m_oNextFieldmarkHide <= 
*pNextRedlineHide);
             m_pStartPos = &*m_oNextFieldmarkHide;
             m_pEndPos = m_Fieldmark.second.get();
             return true;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to