sw/source/core/unocore/unoobj2.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 64aa51cb2fcfb6cfb325ffdc2567b0a2f0661007
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Mar 20 19:34:42 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Mar 22 12:35:07 2024 +0100

    remove unnecessary code
    
    SwTextFootnote has a start node member, no need to search for it again
    
    Add an assert in case I'm wrong.
    
    Looks like it has been this way since
        commit 6bff13645223e2a2701acc1b6f7d579671c97e06
        Author: Oliver Specht <o...@openoffice.org>
        Date:   Fri Jan 12 15:15:41 2001 +0000
        new: Redline container
    
    Change-Id: Ic9e48d051c9da14be860907cceaf38aee5a0c794
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165153
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/core/unocore/unoobj2.cxx 
b/sw/source/core/unocore/unoobj2.cxx
index 9e67f927db54..f343bd9c3e75 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -1327,9 +1327,10 @@ CreateParentXText(SwDoc & rDoc, const SwPosition& rPos)
                 const SwTextFootnote* pTextFootnote = rDoc.GetFootnoteIdxs()[ 
n ];
                 const SwFormatFootnote& rFormatFootnote = 
pTextFootnote->GetFootnote();
                 assert(pTextFootnote == rFormatFootnote.GetTextFootnote());
+                assert(&pTextFootnote->GetStartNode()->GetNode() == 
pTextFootnote->GetStartNode()->GetNode().
+                                    FindSttNodeByType(SwFootnoteStartNode));
 
-                if (pSttNode == pTextFootnote->GetStartNode()->GetNode().
-                                    FindSttNodeByType(SwFootnoteStartNode))
+                if (pSttNode == &pTextFootnote->GetStartNode()->GetNode())
                 {
                     xParentText = SwXFootnote::CreateXFootnote(rDoc,
                             &const_cast<SwFormatFootnote&>(rFormatFootnote));

Reply via email to