sw/inc/unotextbodyhf.hxx | 7 +------ sw/source/core/unocore/unotext.cxx | 27 --------------------------- 2 files changed, 1 insertion(+), 33 deletions(-)
New commits: commit 3816e7b85716db56617667789ae67fab96b3a349 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Fri Jan 20 13:42:15 2023 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Fri Jan 20 14:39:30 2023 +0000 Base SwXBodyText on WeakImplHepler ...rather than on the deprecated WeakAggImplHelper2. It was found that that class was implementing queryInterface in a way that is incompatible with the XAggregation protocol inherited via WeakAggImplHelper2. It looks like no code actually made use of the XAggregation offered by this class, so the easiest fix for this queryInterface implementation appears to switch from WeakAggImplHelper2 to WeakImplHelper (thereby dropping XAggregation, and thus rendering the existing queryInterface implementation OK). Change-Id: Ia66e1d8f89740752d8ed69f0e17b75fa2c470f41 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145893 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/sw/inc/unotextbodyhf.hxx b/sw/inc/unotextbodyhf.hxx index 390adaead265..3debaf4796cf 100644 --- a/sw/inc/unotextbodyhf.hxx +++ b/sw/inc/unotextbodyhf.hxx @@ -24,7 +24,6 @@ #include <com/sun/star/container/XEnumerationAccess.hpp> #include <cppuhelper/implbase.hxx> -#include <cppuhelper/implbase2.hxx> #include "unotext.hxx" @@ -33,7 +32,7 @@ class SwFrameFormat; class SwXTextCursor; struct SwXParagraphEnumeration; -typedef ::cppu::WeakAggImplHelper2 +typedef ::cppu::WeakImplHelper < css::lang::XServiceInfo , css::container::XEnumerationAccess > SwXBodyText_Base; @@ -57,10 +56,6 @@ public: virtual void SAL_CALL acquire() noexcept override { OWeakObject::acquire(); } virtual void SAL_CALL release() noexcept override { OWeakObject::release(); } - // XAggregation - virtual css::uno::Any SAL_CALL queryAggregation( - const css::uno::Type& rType) override; - // XTypeProvider virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 2e8587b80e38..d6c75f01efea 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -2393,33 +2393,6 @@ SwXBodyText::getSupportedServiceNames() return { "com.sun.star.text.Text" }; } -uno::Any SAL_CALL -SwXBodyText::queryAggregation(const uno::Type& rType) -{ - uno::Any aRet; - if (rType == cppu::UnoType<container::XEnumerationAccess>::get()) - { - aRet <<= uno::Reference< container::XEnumerationAccess >(this); - } - else if (rType == cppu::UnoType<container::XElementAccess>::get()) - { - aRet <<= uno::Reference< container::XElementAccess >(this); - } - else if (rType == cppu::UnoType<lang::XServiceInfo>::get()) - { - aRet <<= uno::Reference< lang::XServiceInfo >(this); - } - else - { - aRet = SwXText::queryInterface( rType ); - } - if(aRet.getValueType() == cppu::UnoType<void>::get()) - { - aRet = OWeakAggObject::queryAggregation( rType ); - } - return aRet; -} - uno::Sequence< uno::Type > SAL_CALL SwXBodyText::getTypes() {