sc/inc/fielduno.hxx | 13 ++++--------- sc/source/ui/unoobj/fielduno.cxx | 23 ++--------------------- sw/inc/unotxdoc.hxx | 6 ++---- sw/source/uibase/uno/unotxdoc.cxx | 7 +------ 4 files changed, 9 insertions(+), 40 deletions(-)
New commits: commit faf3da0a9676a82fd5dcb9e931480935cb985bc0 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Jul 13 15:49:20 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Jul 13 18:51:45 2021 +0200 use ImplInheritanceHelper in SwXTextDocument so we avoid having two copies of OWeakObject in it Change-Id: Ia592f1d67a730da35c5d73c81c689d9da02fce1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118853 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index 5e2619819095..79044005530a 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -90,8 +90,9 @@ namespace com::sun::star::uno { class XAggregation; } namespace com::sun::star::util { class XReplaceDescriptor; } -typedef cppu::WeakImplHelper +typedef cppu::ImplInheritanceHelper < + SfxBaseModel, css::text::XTextDocument, css::text::XLineNumberingProperties, css::text::XChapterNumberingSupplier, @@ -131,7 +132,6 @@ SwXTextDocumentBaseClass; class SW_DLLPUBLIC SwXTextDocument final : public SwXTextDocumentBaseClass, public SvxFmMSFactory, - public SfxBaseModel, public vcl::ITiledRenderable, public css::tiledrendering::XTiledRenderable { @@ -216,8 +216,6 @@ public: virtual void SAL_CALL release( ) noexcept override; //XWeak - virtual css::uno::Reference< css::uno::XAdapter > SAL_CALL queryAdapter( ) override; - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId(); diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 890ccdd8fcc3..c8c11e93da39 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -341,11 +341,6 @@ void SAL_CALL SwXTextDocument::release()noexcept SfxBaseModel::release(); } -Reference< XAdapter > SwXTextDocument::queryAdapter( ) -{ - return SfxBaseModel::queryAdapter(); -} - Sequence< uno::Type > SAL_CALL SwXTextDocument::getTypes() { Sequence< uno::Type > aNumTypes; @@ -370,7 +365,7 @@ Sequence< uno::Type > SAL_CALL SwXTextDocument::getTypes() } SwXTextDocument::SwXTextDocument(SwDocShell* pShell) - : SfxBaseModel(pShell) + : SwXTextDocumentBaseClass(pShell) , m_pImpl(new Impl) , m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_DOCUMENT)), commit eb3fb2ea717f591e75b04ff828415cb9ad452dcd Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Jul 13 15:48:49 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Jul 13 18:51:35 2021 +0200 use WeakComponentImplHelper for ScEditFieldObj so we avoid having two copies of OWeakObject in it Change-Id: I1dd789ced5552d8de4e164cd572c29022f662b74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118852 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sc/inc/fielduno.hxx b/sc/inc/fielduno.hxx index 23759a3c19f3..4394d5931581 100644 --- a/sc/inc/fielduno.hxx +++ b/sc/inc/fielduno.hxx @@ -36,6 +36,7 @@ #include <comphelper/servicehelper.hxx> #include <cppuhelper/component.hxx> #include <cppuhelper/implbase.hxx> +#include <cppuhelper/compbase.hxx> #include <osl/mutex.hxx> #include <memory> @@ -159,13 +160,12 @@ public: * Generic UNO wrapper for edit engine's field item in cells, headers, and * footers. */ -class ScEditFieldObj final : public cppu::WeakImplHelper< +typedef cppu::WeakComponentImplHelper< css::text::XTextField, css::beans::XPropertySet, css::lang::XUnoTunnel, - css::lang::XServiceInfo>, - public ScMutexHelper, - public ::cppu::OComponentHelper + css::lang::XServiceInfo> ScEditFieldObj_Base; +class ScEditFieldObj final : public ScMutexHelper, public ScEditFieldObj_Base { ScEditFieldObj() = delete; ScEditFieldObj(const ScEditFieldObj&) = delete; @@ -220,11 +220,6 @@ public: virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override; - // XComponent - virtual void SAL_CALL dispose() override; - virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override; - virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override; - // XPropertySet virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override; diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx index f537eaf94977..29f1d02e0a11 100644 --- a/sc/source/ui/unoobj/fielduno.cxx +++ b/sc/source/ui/unoobj/fielduno.cxx @@ -1041,7 +1041,7 @@ void ScEditFieldObj::setPropertyValueSheet(const OUString& rName, const uno::Any ScEditFieldObj::ScEditFieldObj( const uno::Reference<text::XTextRange>& rContent, std::unique_ptr<ScEditSource> pEditSrc, sal_Int32 eType, const ESelection& rSel) : - OComponentHelper(getMutex()), + ScEditFieldObj_Base(getMutex()), pPropSet(nullptr), mpEditSource(std::move(pEditSrc)), aSelection(rSel), @@ -1174,25 +1174,6 @@ uno::Reference<text::XTextRange> SAL_CALL ScEditFieldObj::getAnchor() return mpContent; } -// XComponent - -void SAL_CALL ScEditFieldObj::dispose() -{ - OComponentHelper::dispose(); -} - -void SAL_CALL ScEditFieldObj::addEventListener( - const uno::Reference<lang::XEventListener>& xListener ) -{ - OComponentHelper::addEventListener( xListener ); -} - -void SAL_CALL ScEditFieldObj::removeEventListener( - const uno::Reference<lang::XEventListener>& xListener ) -{ - OComponentHelper::removeEventListener( xListener ); -} - // XPropertySet uno::Reference<beans::XPropertySetInfo> SAL_CALL ScEditFieldObj::getPropertySetInfo() @@ -1306,7 +1287,7 @@ uno::Sequence<OUString> SAL_CALL ScEditFieldObj::getSupportedServiceNames() uno::Sequence<uno::Type> SAL_CALL ScEditFieldObj::getTypes() { return comphelper::concatSequences( - OComponentHelper::getTypes(), + ScEditFieldObj_Base::getTypes(), uno::Sequence<uno::Type> { cppu::UnoType<text::XTextField>::get(), _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits