sw/inc/unocoll.hxx                     |    2 --
 sw/source/core/unocore/unocoll.cxx     |    5 -----
 sw/source/core/unocore/unoportenum.cxx |    2 +-
 3 files changed, 1 insertion(+), 8 deletions(-)

New commits:
commit 0bc7781a90af0eb474b5d9baa93da3f11b861cb7
Author:     Mike Kaganski <[email protected]>
AuthorDate: Sat Jun 14 23:56:04 2025 +0500
Commit:     Mike Kaganski <[email protected]>
CommitDate: Sun Jun 15 00:10:58 2025 +0200

    Drop SwXFootnotes::GetObject
    
    Unlike the two previous (SwXTextSections::GetObject and
    SwXTextTables::GetObject), this one encapsulates a const_cast.
    But it's used in a single place; no need for inconsistency.
    
    Change-Id: I8af0d49a073214bb584fd89627f71cacc59415a7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186506
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <[email protected]>

diff --git a/sw/inc/unocoll.hxx b/sw/inc/unocoll.hxx
index edc3777f4d12..0c72964d714e 100644
--- a/sw/inc/unocoll.hxx
+++ b/sw/inc/unocoll.hxx
@@ -477,8 +477,6 @@ public:
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() 
override;
 
     rtl::Reference<SwXFootnote> getFootnoteByIndex(sal_Int32 nIndex) ;
-
-    static rtl::Reference<SwXFootnote> GetObject( SwDoc& rDoc, const 
SwFormatFootnote& rFormat );
 };
 
 class SwXReferenceMarks final : public SwCollectionBaseClass,
diff --git a/sw/source/core/unocore/unocoll.cxx 
b/sw/source/core/unocore/unocoll.cxx
index b5f13a6fc9f1..27c82511680f 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -1737,11 +1737,6 @@ sal_Bool SwXFootnotes::hasElements()
     return !GetDoc().GetFootnoteIdxs().empty();
 }
 
-rtl::Reference<SwXFootnote> SwXFootnotes::GetObject( SwDoc& rDoc, const 
SwFormatFootnote& rFormat )
-{
-    return SwXFootnote::CreateXFootnote(rDoc, 
&const_cast<SwFormatFootnote&>(rFormat));
-}
-
 OUString SwXReferenceMarks::getImplementationName()
 {
     return u"SwXReferenceMarks"_ustr;
diff --git a/sw/source/core/unocore/unoportenum.cxx 
b/sw/source/core/unocore/unoportenum.cxx
index 13a50fde52f1..55a30b145ea1 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -948,7 +948,7 @@ lcl_ExportHints(
                             pPortion = new SwXTextPortion(
                                 pUnoCursor, xParent, PORTION_FOOTNOTE);
                             rtl::Reference<SwXFootnote> xContent =
-                                SwXFootnotes::GetObject(rDoc, 
pAttr->GetFootnote());
+                                SwXFootnote::CreateXFootnote(rDoc, 
&const_cast<SwFormatFootnote&>(pAttr->GetFootnote()));
                             pPortion->SetFootnote(xContent);
                         }
                     }

Reply via email to