sw/inc/unocoll.hxx                       |    2 --
 sw/source/core/unocore/unocoll.cxx       |   10 +++-------
 sw/source/core/unocore/unocrsrhelper.cxx |    2 +-
 sw/source/core/unocore/unoredline.cxx    |    2 +-
 sw/source/core/unocore/unotbl.cxx        |    4 ++--
 5 files changed, 7 insertions(+), 13 deletions(-)

New commits:
commit 2e142f77f06b667fb506d72fbf0ac81a1fc807fb
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Sat Jun 14 23:42:41 2025 +0500
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sat Jun 14 22:38:47 2025 +0200

    Drop SwXTextSections::GetObject
    
    Unneeded inderection for another single static function call.
    
    Change-Id: I81187f0f9f2d11816884a8228a28e45c90fc6fd2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186505
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    Tested-by: Jenkins

diff --git a/sw/inc/unocoll.hxx b/sw/inc/unocoll.hxx
index 4f55106c8ab3..edc3777f4d12 100644
--- a/sw/inc/unocoll.hxx
+++ b/sw/inc/unocoll.hxx
@@ -397,8 +397,6 @@ public:
     virtual OUString SAL_CALL getImplementationName() override;
     virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) 
override;
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() 
override;
-
-    static rtl::Reference<SwXTextSection> GetObject( SwSectionFormat& rFormat 
);
 };
 
 class SwXBookmarks final : public SwCollectionBaseClass,
diff --git a/sw/source/core/unocore/unocoll.cxx 
b/sw/source/core/unocore/unocoll.cxx
index b5821654470a..b5f13a6fc9f1 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -1383,7 +1383,8 @@ uno::Any SwXTextSections::getByIndex(sal_Int32 nIndex)
         if( !rSectFormats[i]->IsInNodesArr())
             nIndex2++;
         else if (nIndex2 == i)
-            return Any(css::uno::Reference< 
css::text::XTextSection>(GetObject(*rSectFormats[i])));
+            return Any(css::uno::Reference<css::text::XTextSection>(
+                SwXTextSection::CreateXTextSection(rSectFormats[i])));
     }
     throw IndexOutOfBoundsException();
 }
@@ -1401,7 +1402,7 @@ uno::Any SwXTextSections::getByName(const OUString& rName)
         if (pFormat->IsInNodesArr()
             && (rName == pFormat->GetSection()->GetSectionName()))
         {
-            xSect = GetObject(*pFormat);
+            xSect = SwXTextSection::CreateXTextSection(pFormat);
             aRet <<= xSect;
             break;
         }
@@ -1483,11 +1484,6 @@ sal_Bool SwXTextSections::hasElements()
     return nCount > 0;
 }
 
-rtl::Reference< SwXTextSection >  SwXTextSections::GetObject( SwSectionFormat& 
rFormat )
-{
-    return SwXTextSection::CreateXTextSection(&rFormat);
-}
-
 OUString SwXBookmarks::getImplementationName()
 {
     return u"SwXBookmarks"_ustr;
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx 
b/sw/source/core/unocore/unocrsrhelper.cxx
index 25984b1744cf..71dcdea44d76 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -637,7 +637,7 @@ bool getCursorPropertyValue(const SfxItemPropertyMapEntry& 
rEntry
             {
                 if( pAny )
                 {
-                    rtl::Reference< SwXTextSection > xSect = 
SwXTextSections::GetObject( *pSect->GetFormat() );
+                    rtl::Reference<SwXTextSection> xSect = 
SwXTextSection::CreateXTextSection(pSect->GetFormat());
                     *pAny <<= uno::Reference< XTextSection >(xSect);
                 }
             }
diff --git a/sw/source/core/unocore/unoredline.cxx 
b/sw/source/core/unocore/unoredline.cxx
index a11551e04f2c..935b5c206773 100644
--- a/sw/source/core/unocore/unoredline.cxx
+++ b/sw/source/core/unocore/unoredline.cxx
@@ -451,7 +451,7 @@ uno::Any SwXRedline::getPropertyValue( const OUString& 
rPropertyName )
                 SwSectionNode* pSectNode = pPoint->GetNode().GetSectionNode();
                 assert(pSectNode);
                 SwSectionFormat* pSectionFormat = 
pSectNode->GetSection().GetFormat();
-                xRet = 
cppu::getXWeak(SwXTextSections::GetObject(*pSectionFormat).get());
+                xRet = 
cppu::getXWeak(SwXTextSection::CreateXTextSection(pSectionFormat).get());
             }
             break;
             case SwNodeType::Table :
diff --git a/sw/source/core/unocore/unotbl.cxx 
b/sw/source/core/unocore/unotbl.cxx
index ae89ef28394b..38f375b9f8f4 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -1040,7 +1040,7 @@ uno::Any SwXCell::getPropertyValue(const OUString& 
rPropertyName)
             if(!pSectionNode)
                 return uno::Any();
             SwSection& rSect = pSectionNode->GetSection();
-            rtl::Reference< SwXTextSection > xSect = 
SwXTextSections::GetObject(*rSect.GetFormat());
+            rtl::Reference<SwXTextSection> xSect = 
SwXTextSection::CreateXTextSection(rSect.GetFormat());
             return uno::Any(uno::Reference< text::XTextSection >(xSect));
         }
         break;
@@ -2942,7 +2942,7 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& 
rPropertyName)
                     {
                         SwSection& rSect = pSectionNode->GetSection();
                         rtl::Reference< SwXTextSection > xSect =
-                                        SwXTextSections::GetObject( 
*rSect.GetFormat() );
+                                        
SwXTextSection::CreateXTextSection(rSect.GetFormat());
                         aRet <<= uno::Reference< text::XTextSection >(xSect);
                     }
                 }

Reply via email to