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

Kohei Yoshida kohei.yoshida at collabora.com
Thu Nov 17 02:49:45 UTC 2016


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

New commits:
commit 9008db0a8259551c292f94007afcac710b637b57
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed Nov 16 21:04:05 2016 -0500

    Use std::unique_ptr for mpTextHelper.
    
    Change-Id: I7cbb68a947232c6b3410815349cae306b384608c
    Reviewed-on: https://gerrit.libreoffice.org/30918
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Kohei Yoshida <libreoffice at kohei.us>

diff --git a/sc/source/ui/Accessibility/AccessibleEditObject.cxx b/sc/source/ui/Accessibility/AccessibleEditObject.cxx
index 6666284..664189b 100644
--- a/sc/source/ui/Accessibility/AccessibleEditObject.cxx
+++ b/sc/source/ui/Accessibility/AccessibleEditObject.cxx
@@ -103,8 +103,7 @@ ScAccessibleEditObject::~ScAccessibleEditObject()
 void SAL_CALL ScAccessibleEditObject::disposing()
 {
     SolarMutexGuard aGuard;
-    if (mpTextHelper)
-        DELETEZ(mpTextHelper);
+    mpTextHelper.reset();
 
     ScAccessibleContextBase::disposing();
 }
@@ -368,7 +367,11 @@ void ScAccessibleEditObject::CreateTextHelper()
             pAccessibleTextData.reset
                 (new ScAccessibleEditLineTextData(nullptr, mpWindow));
         }
-        mpTextHelper = new ::accessibility::AccessibleTextHelper(o3tl::make_unique<ScAccessibilityEditSource>(std::move(pAccessibleTextData)));
+
+        std::unique_ptr<ScAccessibilityEditSource> pEditSrc =
+            o3tl::make_unique<ScAccessibilityEditSource>(std::move(pAccessibleTextData));
+
+        mpTextHelper = o3tl::make_unique<::accessibility::AccessibleTextHelper>(std::move(pEditSrc));
         mpTextHelper->SetEventSource(this);
 
         const ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl();
diff --git a/sc/source/ui/inc/AccessibleEditObject.hxx b/sc/source/ui/inc/AccessibleEditObject.hxx
index e7d0b1a..1b35218 100644
--- a/sc/source/ui/inc/AccessibleEditObject.hxx
+++ b/sc/source/ui/inc/AccessibleEditObject.hxx
@@ -26,6 +26,8 @@
 #include "global.hxx"
 #include <vcl/window.hxx>
 
+#include <memory>
+
 namespace accessibility
 {
     class AccessibleTextHelper;
@@ -184,7 +186,7 @@ public:
         throw (css::uno::RuntimeException, std::exception) override;
 
 private:
-    accessibility::AccessibleTextHelper* mpTextHelper;
+    std::unique_ptr<accessibility::AccessibleTextHelper> mpTextHelper;
     EditView*      mpEditView;
     VclPtr<vcl::Window> mpWindow;
     EditObjectType meObjectType;


More information about the Libreoffice-commits mailing list