[Libreoffice-commits] core.git: sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Jul 25 06:45:43 UTC 2018


 sw/source/uibase/docvw/SidebarTxtControlAcc.cxx |   14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

New commits:
commit 003b2956d872ac19a1c84fefcc773ecefa008220
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Jul 24 10:20:22 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Jul 25 08:45:18 2018 +0200

    loplugin:useuniqueptr in SidebarTextControlAccessibleContext
    
    Change-Id: Ie1506b90f541d3ccdc93c8234b393471fef0118d
    Reviewed-on: https://gerrit.libreoffice.org/57935
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx b/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx
index 7529bdbfe027..f6fc2e693271 100644
--- a/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx
+++ b/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx
@@ -128,7 +128,6 @@ class SidebarTextControlAccessibleContext : public VCLXAccessibleComponent
 {
     public:
         explicit SidebarTextControlAccessibleContext( SidebarTextControl& rSidebarTextControl );
-        virtual ~SidebarTextControlAccessibleContext() override;
 
         virtual sal_Int32 SAL_CALL
                 getAccessibleChildCount() override;
@@ -146,7 +145,7 @@ class SidebarTextControlAccessibleContext : public VCLXAccessibleComponent
         virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override;
 
     private:
-        ::accessibility::AccessibleTextHelper* mpAccessibleTextHelper;
+        std::unique_ptr<::accessibility::AccessibleTextHelper> mpAccessibleTextHelper;
 
         ::osl::Mutex maMutex;
 
@@ -155,22 +154,15 @@ class SidebarTextControlAccessibleContext : public VCLXAccessibleComponent
 
 SidebarTextControlAccessibleContext::SidebarTextControlAccessibleContext( SidebarTextControl& rSidebarTextControl )
     : VCLXAccessibleComponent( rSidebarTextControl.GetWindowPeer() )
-    , mpAccessibleTextHelper( nullptr )
     , maMutex()
 {
-    mpAccessibleTextHelper = new ::accessibility::AccessibleTextHelper( o3tl::make_unique<SidebarTextEditSource>(rSidebarTextControl) );
+    mpAccessibleTextHelper.reset(new ::accessibility::AccessibleTextHelper( o3tl::make_unique<SidebarTextEditSource>(rSidebarTextControl) ));
     mpAccessibleTextHelper->SetEventSource( rSidebarTextControl.GetWindowPeer() );
 }
 
-SidebarTextControlAccessibleContext::~SidebarTextControlAccessibleContext()
-{
-    defunc();
-}
-
 void SidebarTextControlAccessibleContext::defunc()
 {
-    delete mpAccessibleTextHelper;
-    mpAccessibleTextHelper = nullptr;
+    mpAccessibleTextHelper.reset();
 }
 
 sal_Int32 SAL_CALL SidebarTextControlAccessibleContext::getAccessibleChildCount()


More information about the Libreoffice-commits mailing list