solenv/clang-format/excludelist | 4 ++-- sw/inc/unoidx.hxx | 6 +++--- sw/inc/unoidxcoll.hxx | 3 +++ sw/inc/unosection.hxx | 4 ++-- sw/source/core/inc/unoport.hxx | 2 +- sw/source/core/unocore/unoidx.cxx | 15 ++++++++++----- sw/source/ui/index/cntex.cxx | 5 ++--- 7 files changed, 23 insertions(+), 16 deletions(-)
New commits: commit b420013afd434029a6e1b4e7191d1125b812881f Author: Noel Grandin <[email protected]> AuthorDate: Sun Nov 30 12:54:20 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Sun Nov 30 16:43:28 2025 +0100 use more concrete UNO in SwMultiTOXTabDialog Change-Id: I46da6ed2656250be356c932279c24c73ded46e49 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194837 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist index 1d2e18c0e165..38b28af52641 100644 --- a/solenv/clang-format/excludelist +++ b/solenv/clang-format/excludelist @@ -11866,12 +11866,14 @@ sw/inc/unocrsrhelper.hxx sw/inc/unodraw.hxx sw/inc/unofieldcoll.hxx sw/inc/unoframe.hxx +sw/inc/unoidx.hxx sw/inc/unoidxcoll.hxx sw/inc/unomap.hxx sw/inc/unomid.h sw/inc/unoparagraph.hxx sw/inc/unoredline.hxx sw/inc/unoredlines.hxx +sw/inc/unosection.hxx sw/inc/unosett.hxx sw/inc/unosrch.hxx sw/inc/unostyle.hxx @@ -12264,12 +12266,10 @@ sw/source/core/inc/unofield.hxx sw/source/core/inc/unoflatpara.hxx sw/source/core/inc/unofldmid.h sw/source/core/inc/unofootnote.hxx -sw/source/core/inc/unoidx.hxx sw/source/core/inc/unometa.hxx sw/source/core/inc/unoparaframeenum.hxx sw/source/core/inc/unoport.hxx sw/source/core/inc/unorefmark.hxx -sw/source/core/inc/unosection.hxx sw/source/core/inc/unotextmarkup.hxx sw/source/core/inc/viewimp.hxx sw/source/core/inc/wrong.hxx diff --git a/sw/source/core/inc/unoidx.hxx b/sw/inc/unoidx.hxx similarity index 99% rename from sw/source/core/inc/unoidx.hxx rename to sw/inc/unoidx.hxx index 6d5f2f9eb393..5fd024f3d8a3 100644 --- a/sw/source/core/inc/unoidx.hxx +++ b/sw/inc/unoidx.hxx @@ -30,10 +30,10 @@ #include <sfx2/Metadatable.hxx> -#include <toxe.hxx> -#include <unobaseclass.hxx> +#include "toxe.hxx" +#include "unobaseclass.hxx" #include "unosection.hxx" -#include <swdllapi.h> +#include "swdllapi.h" class SwDoc; class SwTOXBaseSection; diff --git a/sw/inc/unoidxcoll.hxx b/sw/inc/unoidxcoll.hxx index 92d275ca9a79..95b6bc97867c 100644 --- a/sw/inc/unoidxcoll.hxx +++ b/sw/inc/unoidxcoll.hxx @@ -21,6 +21,8 @@ #include "unocoll.hxx" +class SwXDocumentIndex; + class SW_DLLPUBLIC SwXDocumentIndexes final : public SwCollectionBaseClass , public SwUnoCollection @@ -56,6 +58,7 @@ public: getElementNames() override; virtual sal_Bool SAL_CALL hasByName(const OUString& rName) override; + rtl::Reference< SwXDocumentIndex > getDocumentIndexByIndex(sal_Int32 nIndex); }; #endif diff --git a/sw/source/core/inc/unosection.hxx b/sw/inc/unosection.hxx similarity index 99% rename from sw/source/core/inc/unosection.hxx rename to sw/inc/unosection.hxx index 2f33556212ee..3915a091c437 100644 --- a/sw/source/core/inc/unosection.hxx +++ b/sw/inc/unosection.hxx @@ -19,7 +19,7 @@ #pragma once -#include <swdllapi.h> +#include "swdllapi.h" #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertyState.hpp> @@ -31,7 +31,7 @@ #include <sfx2/Metadatable.hxx> -#include <unobaseclass.hxx> +#include "unobaseclass.hxx" class SwSectionFormat; diff --git a/sw/source/core/inc/unoport.hxx b/sw/source/core/inc/unoport.hxx index 6ad52296dd68..dd642c85e681 100644 --- a/sw/source/core/inc/unoport.hxx +++ b/sw/source/core/inc/unoport.hxx @@ -38,7 +38,7 @@ #include <unocrsr.hxx> #include "unorefmark.hxx" -#include "unoidx.hxx" +#include <unoidx.hxx> #include "unofootnote.hxx" #include "unometa.hxx" #include "unocontentcontrol.hxx" diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 2c4709e95991..c30f1aad145c 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -2352,6 +2352,15 @@ SwXDocumentIndexes::getCount() uno::Any SAL_CALL SwXDocumentIndexes::getByIndex(sal_Int32 nIndex) +{ + rtl::Reference< SwXDocumentIndex > xTmp = getDocumentIndexByIndex(nIndex); + uno::Any aRet; + aRet <<= uno::Reference< text::XDocumentIndex >(xTmp); + return aRet; +} + +rtl::Reference< SwXDocumentIndex > +SwXDocumentIndexes::getDocumentIndexByIndex(sal_Int32 nIndex) { SolarMutexGuard aGuard; @@ -2366,12 +2375,8 @@ SwXDocumentIndexes::getByIndex(sal_Int32 nIndex) pSect->GetFormat()->GetSectionNode() && nIdx++ == nIndex ) { - const rtl::Reference< SwXDocumentIndex > xTmp = - SwXDocumentIndex::CreateXDocumentIndex( + return SwXDocumentIndex::CreateXDocumentIndex( rDoc, static_cast<SwTOXBaseSection *>(pSect)); - uno::Any aRet; - aRet <<= uno::Reference< text::XDocumentIndex >(xTmp); - return aRet; } } diff --git a/sw/source/ui/index/cntex.cxx b/sw/source/ui/index/cntex.cxx index 74c4339e8811..a10084d16d51 100644 --- a/sw/source/ui/index/cntex.cxx +++ b/sw/source/ui/index/cntex.cxx @@ -40,6 +40,7 @@ #include <SwStyleNameMapper.hxx> #include <swuicnttab.hxx> #include <unoidxcoll.hxx> +#include <unoidx.hxx> #include <names.hxx> using namespace ::com::sun::star; @@ -107,9 +108,7 @@ IMPL_LINK_NOARG(SwMultiTOXTabDialog, CreateExample_Hdl, SwOneExampleFrame&, void while(n) { n--; - uno::Any aIdx = xIdxs->getByIndex(n); - uno::Reference< text::XDocumentIndex > xIdx; - aIdx >>= xIdx; + rtl::Reference< SwXDocumentIndex > xIdx = xIdxs->getDocumentIndexByIndex(n); xIdx->dispose(); } CreateOrUpdateExample(m_eCurrentTOXType.eType);
