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

Noel Grandin noel.grandin at collabora.co.uk
Thu Jun 28 06:31:07 UTC 2018


 sc/source/ui/Accessibility/AccessiblePreviewCell.cxx |    7 +++----
 sc/source/ui/inc/AccessiblePreviewCell.hxx           |    2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit b1b490ee356cf542e47065eb6795ed0b5e2f531b
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Jun 27 10:19:45 2018 +0200

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

diff --git a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
index e493257ea5c9..864db6d539d3 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
@@ -74,8 +74,7 @@ void SAL_CALL ScAccessiblePreviewCell::disposing()
         mpViewShell = nullptr;
     }
 
-    if (mpTextHelper)
-        DELETEZ(mpTextHelper);
+    mpTextHelper.reset();
 
     ScAccessibleCellBase::disposing();
 }
@@ -271,10 +270,10 @@ void ScAccessiblePreviewCell::CreateTextHelper()
 {
     if (!mpTextHelper)
     {
-        mpTextHelper = new ::accessibility::AccessibleTextHelper(
+        mpTextHelper.reset( new ::accessibility::AccessibleTextHelper(
             o3tl::make_unique<ScAccessibilityEditSource>(
                 o3tl::make_unique<ScAccessiblePreviewCellTextData>(
-                    mpViewShell, maCellAddress)));
+                    mpViewShell, maCellAddress))) );
         mpTextHelper->SetEventSource( this );
 
         // paragraphs in preview are transient
diff --git a/sc/source/ui/inc/AccessiblePreviewCell.hxx b/sc/source/ui/inc/AccessiblePreviewCell.hxx
index 2e9702f15e36..0a60751d2255 100644
--- a/sc/source/ui/inc/AccessiblePreviewCell.hxx
+++ b/sc/source/ui/inc/AccessiblePreviewCell.hxx
@@ -85,7 +85,7 @@ protected:
 private:
     ScPreviewShell* mpViewShell;
 
-    accessibility::AccessibleTextHelper* mpTextHelper;
+    std::unique_ptr<accessibility::AccessibleTextHelper> mpTextHelper;
 
     bool IsDefunc(
         const css::uno::Reference<css::accessibility::XAccessibleStateSet>& rxParentStates);


More information about the Libreoffice-commits mailing list