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

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


 sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx |    7 +++----
 sc/source/ui/cctrl/checklistmenu.cxx                       |    4 ++--
 sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx           |    2 +-
 sc/source/ui/inc/checklistmenu.hxx                         |    4 ++--
 4 files changed, 8 insertions(+), 9 deletions(-)

New commits:
commit 4dbfc74325130fe272007cf572a56634f9894deb
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Jun 27 10:23:04 2018 +0200

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

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index fb727e812a8c..15fdb0df0777 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -1632,8 +1632,8 @@ SvTreeListEntry* ScCheckListBox::FindEntry( SvTreeListEntry* pParent, const OUSt
 
 void ScCheckListBox::Init()
 {
-    mpCheckButton = new SvLBoxButtonData( this );
-    EnableCheckButton( mpCheckButton );
+    mpCheckButton.reset( new SvLBoxButtonData( this ) );
+    EnableCheckButton( mpCheckButton.get() );
     SetNodeDefaultImages();
 }
 
diff --git a/sc/source/ui/inc/checklistmenu.hxx b/sc/source/ui/inc/checklistmenu.hxx
index 5f58e8015a6c..076ad2414afa 100644
--- a/sc/source/ui/inc/checklistmenu.hxx
+++ b/sc/source/ui/inc/checklistmenu.hxx
@@ -226,7 +226,7 @@ struct ScCheckListMember;
 
 class ScCheckListBox : public SvTreeListBox
 {
-    SvLBoxButtonData*   mpCheckButton;
+    std::unique_ptr<SvLBoxButtonData> mpCheckButton;
     ScTabStops*         mpTabStops;
     bool                mbSeenMouseButtonDown;
     void            CountCheckedEntries( SvTreeListEntry* pParent, sal_uLong& nCount ) const;
@@ -236,7 +236,7 @@ class ScCheckListBox : public SvTreeListBox
 
     ScCheckListBox( vcl::Window* pParent );
     virtual ~ScCheckListBox() override { disposeOnce(); }
-    virtual void dispose() override { delete mpCheckButton; SvTreeListBox::dispose(); }
+    virtual void dispose() override { mpCheckButton.reset(); SvTreeListBox::dispose(); }
     void Init();
     void CheckEntry( const OUString& sName, SvTreeListEntry* pParent, bool bCheck );
     void CheckEntry( SvTreeListEntry* pEntry, bool bCheck );
commit 1156f2ed90ddea4036f08155a83248cc4eab7f27
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Jun 27 10:22:54 2018 +0200

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

diff --git a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
index b909933d2f39..e1a8d942edff 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
@@ -87,8 +87,7 @@ void SAL_CALL ScAccessiblePreviewHeaderCell::disposing()
         mpViewShell = nullptr;
     }
 
-       if (mpTableInfo)
-        DELETEZ (mpTableInfo);
+    mpTableInfo.reset();
 
     ScAccessibleContextBase::disposing();
 }
@@ -107,7 +106,7 @@ void ScAccessiblePreviewHeaderCell::Notify( SfxBroadcaster& rBC, const SfxHint&
     {
         //  column / row layout may change with any document change,
         //  so it must be invalidated
-        DELETEZ( mpTableInfo );
+        mpTableInfo.reset();
     }
 
     ScAccessibleContextBase::Notify(rBC, rHint);
@@ -404,7 +403,7 @@ void ScAccessiblePreviewHeaderCell::FillTableInfo() const
             aOutputSize = pWindow->GetOutputSizePixel();
         tools::Rectangle aVisRect( Point(), aOutputSize );
 
-        mpTableInfo = new ScPreviewTableInfo;
+        mpTableInfo.reset( new ScPreviewTableInfo );
         mpViewShell->GetLocationData().GetTableInfo( aVisRect, *mpTableInfo );
     }
 }
diff --git a/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx b/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx
index 8413411d2a99..e579dd7a1b33 100644
--- a/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx
+++ b/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx
@@ -119,7 +119,7 @@ private:
     ScAddress           maCellPos;
     bool                mbColumnHeader;
     bool                mbRowHeader;
-    mutable ScPreviewTableInfo* mpTableInfo;
+    mutable std::unique_ptr<ScPreviewTableInfo> mpTableInfo;
 
     bool IsDefunc(
         const css::uno::Reference<css::accessibility::XAccessibleStateSet>& rxParentStates);


More information about the Libreoffice-commits mailing list