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

New commits:
commit 6c7cec6525378aacf873f183b1e03eb959fc998d
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Mar 20 15:53:05 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Mar 21 21:41:58 2024 +0100

    remove unnecessary statement
    
    we already have the SwTextFootnote, no need to retrieve
    it again.
    Add an assert in case I'm wrong.
    
    Change-Id: I30d79de243dbd4aff587c0653c495150e21a755a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165063
    Tested-by: Noel Grandin <noel.gran...@collabora.co.uk>
    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 effb9d36c853..9e67f927db54 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -1325,14 +1325,14 @@ CreateParentXText(SwDoc & rDoc, const SwPosition& rPos)
             for (size_t n = 0; n < nFootnoteCnt; ++n )
             {
                 const SwTextFootnote* pTextFootnote = rDoc.GetFootnoteIdxs()[ 
n ];
-                const SwFormatFootnote& rFootnote = 
pTextFootnote->GetFootnote();
-                pTextFootnote = rFootnote.GetTextFootnote();
+                const SwFormatFootnote& rFormatFootnote = 
pTextFootnote->GetFootnote();
+                assert(pTextFootnote == rFormatFootnote.GetTextFootnote());
 
                 if (pSttNode == pTextFootnote->GetStartNode()->GetNode().
                                     FindSttNodeByType(SwFootnoteStartNode))
                 {
                     xParentText = SwXFootnote::CreateXFootnote(rDoc,
-                            &const_cast<SwFormatFootnote&>(rFootnote));
+                            &const_cast<SwFormatFootnote&>(rFormatFootnote));
                     break;
                 }
             }

Reply via email to