From 7b649f835cc00ed76927c6821a135605609bed4e Mon Sep 17 00:00:00 2001 From: Noel Date: Fri, 19 Feb 2021 08:40:18 +0200 Subject: loplugin:refcounting in vcl Change-Id: Ieca3dd33a7ae40c3f7b8ba30f763d71a548cd144 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111171 Tested-by: Jenkins Reviewed-by: Noel Grandin --- vcl/inc/graphic/UnoGraphic.hxx | 4 +- vcl/inc/graphic/UnoGraphicDescriptor.hxx | 3 +- vcl/inc/unx/gtk/gtkdata.hxx | 63 +++++++++++++++++++++++++++++++- 3 files changed, 63 insertions(+), 7 deletions(-) (limited to 'vcl/inc') diff --git a/vcl/inc/graphic/UnoGraphic.hxx b/vcl/inc/graphic/UnoGraphic.hxx index 33f97df5b183..be2991eb6a5d 100644 --- a/vcl/inc/graphic/UnoGraphic.hxx +++ b/vcl/inc/graphic/UnoGraphic.hxx @@ -44,14 +44,12 @@ public: using ::unographic::GraphicDescriptor::init; void init(const ::Graphic& rGraphic); -private: - // XInterface virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override; virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; virtual void SAL_CALL acquire() throw() override; virtual void SAL_CALL release() throw() override; - +private: // XServiceInfo virtual OUString SAL_CALL getImplementationName() override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; diff --git a/vcl/inc/graphic/UnoGraphicDescriptor.hxx b/vcl/inc/graphic/UnoGraphicDescriptor.hxx index ad46952ce925..db39c070deda 100644 --- a/vcl/inc/graphic/UnoGraphicDescriptor.hxx +++ b/vcl/inc/graphic/UnoGraphicDescriptor.hxx @@ -74,8 +74,6 @@ public: void init( const OUString& rURL ); void init( const css::uno::Reference< css::io::XInputStream >& rxIStm, const OUString& rURL ); -protected: - static rtl::Reference<::comphelper::PropertySetInfo> createPropertySetInfo(); // XInterface @@ -84,6 +82,7 @@ protected: virtual void SAL_CALL acquire() throw() override; virtual void SAL_CALL release() throw() override; +protected: // XServiceInfo virtual OUString SAL_CALL getImplementationName() override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx index 2f88ffe8b309..976412cfb6d5 100644 --- a/vcl/inc/unx/gtk/gtkdata.hxx +++ b/vcl/inc/unx/gtk/gtkdata.hxx @@ -25,6 +25,8 @@ #include #include +#include +#include #include #include #include @@ -58,6 +60,64 @@ public: sal_uLong m_nTimeoutMS; }; +class DocumentFocusListener : + public ::cppu::WeakImplHelper< css::accessibility::XAccessibleEventListener > +{ + + o3tl::sorted_vector< css::uno::Reference< css::uno::XInterface > > m_aRefList; + +public: + /// @throws lang::IndexOutOfBoundsException + /// @throws uno::RuntimeException + void attachRecursive( + const css::uno::Reference< css::accessibility::XAccessible >& xAccessible + ); + + /// @throws lang::IndexOutOfBoundsException + /// @throws uno::RuntimeException + void attachRecursive( + const css::uno::Reference< css::accessibility::XAccessible >& xAccessible, + const css::uno::Reference< css::accessibility::XAccessibleContext >& xContext + ); + + /// @throws lang::IndexOutOfBoundsException + /// @throws uno::RuntimeException + void attachRecursive( + const css::uno::Reference< css::accessibility::XAccessible >& xAccessible, + const css::uno::Reference< css::accessibility::XAccessibleContext >& xContext, + const css::uno::Reference< css::accessibility::XAccessibleStateSet >& xStateSet + ); + + /// @throws lang::IndexOutOfBoundsException + /// @throws uno::RuntimeException + void detachRecursive( + const css::uno::Reference< css::accessibility::XAccessible >& xAccessible + ); + + /// @throws lang::IndexOutOfBoundsException + /// @throws uno::RuntimeException + void detachRecursive( + const css::uno::Reference< css::accessibility::XAccessibleContext >& xContext + ); + + /// @throws lang::IndexOutOfBoundsException + /// @throws uno::RuntimeException + void detachRecursive( + const css::uno::Reference< css::accessibility::XAccessibleContext >& xContext, + const css::uno::Reference< css::accessibility::XAccessibleStateSet >& xStateSet + ); + + /// @throws lang::IndexOutOfBoundsException + /// @throws uno::RuntimeException + static css::uno::Reference< css::accessibility::XAccessible > getAccessible(const css::lang::EventObject& aEvent ); + + // XEventListener + virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; + + // XAccessibleEventListener + virtual void SAL_CALL notifyEvent( const css::accessibility::AccessibleEventObject& aEvent ) override; +}; + class GtkSalData final : public GenericUnixSalData { GSource* m_pUserEvent; @@ -65,8 +125,7 @@ class GtkSalData final : public GenericUnixSalData osl::Condition m_aDispatchCondition; std::exception_ptr m_aException; - css::uno::Reference m_xDocumentFocusListener; - DocumentFocusListener * m_pDocumentFocusListener; + rtl::Reference m_xDocumentFocusListener; public: GtkSalData( SalInstance *pInstance ); -- cgit