From 7f3df1a07dd55ebff1c9c572d3ec93e06dfe854b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 18 Apr 2023 21:25:30 +0200 Subject: [PATCH] use more concrete UNO type in SwXTextTableStyle Change-Id: I19b556a5fc2ee9f475478b16e228aa3670146551 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150587 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/inc/unostyle.hxx | 3 ++- sw/source/core/unocore/unostyle.cxx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx index 2c936486032e..bcd2c96aba6a 100644 --- a/sw/inc/unostyle.hxx +++ b/sw/inc/unostyle.hxx @@ -18,6 +18,7 @@ */ #pragma once +#include #include #include #include "unocoll.hxx" @@ -267,7 +268,7 @@ class SwXTextTableStyle final : public cppu::WeakImplHelper /// Fills m_aCellStyles with SwXTextCellStyles pointing to children of this style. void UpdateCellStylesMapping(); static const CellStyleNameMap& GetCellStyleNameMap(); - css::uno::Reference m_aCellStyles[STYLE_COUNT]; + rtl::Reference m_aCellStyles[STYLE_COUNT]; public: SwXTextTableStyle(SwDocShell* pDocShell, SwTableAutoFormat* pTableAutoFormat); /// Create non physical style diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index d6272e3a5f59..dfe82b61d858 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -4518,7 +4518,8 @@ uno::Any SAL_CALL SwXTextTableStyle::getByName(const OUString& rName) if(iter == rMap.end()) throw css::container::NoSuchElementException(); - return css::uno::Any(m_aCellStyles[(*iter).second]); + auto nIdx = (*iter).second; + return css::uno::Any(uno::Reference(static_cast(m_aCellStyles[nIdx].get()))); } css::uno::Sequence SAL_CALL SwXTextTableStyle::getElementNames()