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

Noel Grandin noel.grandin at collabora.co.uk
Wed Jul 4 09:23:09 UTC 2018


 sc/inc/chart2uno.hxx              |    2 +-
 sc/source/ui/unoobj/chart2uno.cxx |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit f91705bf48f4675838452c92f261867600f27bf7
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Jul 3 09:22:53 2018 +0200

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

diff --git a/sc/inc/chart2uno.hxx b/sc/inc/chart2uno.hxx
index 1083c084d2dd..254934c1d1c4 100644
--- a/sc/inc/chart2uno.hxx
+++ b/sc/inc/chart2uno.hxx
@@ -380,7 +380,7 @@ private:
 
     std::unique_ptr<HiddenRangeListener> m_pHiddenListener;
 
-    ScLinkListener*             m_pValueListener;
+    std::unique_ptr<ScLinkListener>      m_pValueListener;
     XModifyListenerArr_Impl     m_aValueListeners;
 
     bool                        m_bGotDataChangedHint;
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 83bb6ac39b2d..6231038418bb 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -2437,7 +2437,7 @@ ScChart2DataSequence::~ScChart2DataSequence()
         StopListeningToAllExternalRefs();
     }
 
-    delete m_pValueListener;
+    m_pValueListener.reset();
 }
 
 void ScChart2DataSequence::RefChanged()
@@ -2463,7 +2463,7 @@ void ScChart2DataSequence::RefChanged()
                 if (!ScRefTokenHelper::getRangeFromToken(aRange, *itr, ScAddress()))
                     continue;
 
-                m_pDocument->StartListeningArea(aRange, false, m_pValueListener);
+                m_pDocument->StartListeningArea(aRange, false, m_pValueListener.get());
                 if (pCLC)
                     pCLC->StartListeningHiddenRange(aRange, m_pHiddenListener.get());
             }
@@ -3220,7 +3220,7 @@ void SAL_CALL ScChart2DataSequence::addModifyListener( const uno::Reference< uti
     if ( m_aValueListeners.size() == 1 )
     {
         if (!m_pValueListener)
-            m_pValueListener = new ScLinkListener( LINK( this, ScChart2DataSequence, ValueListenerHdl ) );
+            m_pValueListener.reset(new ScLinkListener( LINK( this, ScChart2DataSequence, ValueListenerHdl ) ));
 
         if (!m_pHiddenListener.get())
             m_pHiddenListener.reset(new HiddenRangeListener(*this));
@@ -3235,7 +3235,7 @@ void SAL_CALL ScChart2DataSequence::addModifyListener( const uno::Reference< uti
                 if (!ScRefTokenHelper::getRangeFromToken(aRange, *itr, ScAddress()))
                     continue;
 
-                m_pDocument->StartListeningArea( aRange, false, m_pValueListener );
+                m_pDocument->StartListeningArea( aRange, false, m_pValueListener.get() );
                 if (pCLC)
                     pCLC->StartListeningHiddenRange(aRange, m_pHiddenListener.get());
             }


More information about the Libreoffice-commits mailing list