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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Aug 22 13:37:15 UTC 2018


 sc/inc/chartlis.hxx                           |    2 +-
 sc/source/core/tool/chartlis.cxx              |    4 ++--
 sc/source/filter/excel/xichart.cxx            |    2 +-
 sc/source/filter/xml/XMLTableShapeResizer.cxx |    2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit b183b32383d40ebbd628771b1cd909e9a60a34ab
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Aug 22 14:19:20 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Aug 22 15:36:53 2018 +0200

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

diff --git a/sc/inc/chartlis.hxx b/sc/inc/chartlis.hxx
index 2a49c368fa3b..a03fa57457ef 100644
--- a/sc/inc/chartlis.hxx
+++ b/sc/inc/chartlis.hxx
@@ -76,7 +76,7 @@ public:
     ScChartListener( const OUString& rName, ScDocument* pDoc,
                      const ScRangeListRef& rRangeListRef );
     ScChartListener( const OUString& rName, ScDocument* pDoc,
-                     ::std::vector<ScTokenRef>* pTokens );
+                     std::unique_ptr<::std::vector<ScTokenRef>> pTokens );
     ScChartListener( const ScChartListener& );
     virtual ~ScChartListener() override;
 
diff --git a/sc/source/core/tool/chartlis.cxx b/sc/source/core/tool/chartlis.cxx
index 06d1f36c0fe3..780862264a73 100644
--- a/sc/source/core/tool/chartlis.cxx
+++ b/sc/source/core/tool/chartlis.cxx
@@ -104,10 +104,10 @@ ScChartListener::ScChartListener( const OUString& rName, ScDocument* pDocP,
     ScRefTokenHelper::getTokensFromRangeList(*mpTokens, *rRangeList);
 }
 
-ScChartListener::ScChartListener( const OUString& rName, ScDocument* pDocP, vector<ScTokenRef>* pTokens ) :
+ScChartListener::ScChartListener( const OUString& rName, ScDocument* pDocP, std::unique_ptr<vector<ScTokenRef>> pTokens ) :
     SvtListener(),
     mpExtRefListener(nullptr),
-    mpTokens(pTokens),
+    mpTokens(std::move(pTokens)),
     maName(rName),
     mpDoc( pDocP ),
     bUsed( false ),
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index c2b08ac7c38e..975e6d534202 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -4032,7 +4032,7 @@ void XclImpChChart::Convert( const Reference<XChartDocument>& xChartDoc,
             (*aIt)->FillAllSourceLinks( *xRefTokens );
         if( !xRefTokens->empty() )
         {
-            ::std::unique_ptr< ScChartListener > xListener( new ScChartListener( rObjName, &rDoc, xRefTokens.release() ) );
+            ::std::unique_ptr< ScChartListener > xListener( new ScChartListener( rObjName, &rDoc, std::move(xRefTokens) ) );
             xListener->SetUsed( true );
             xListener->StartListeningTo();
             pChartCollection->insert( xListener.release() );
diff --git a/sc/source/filter/xml/XMLTableShapeResizer.cxx b/sc/source/filter/xml/XMLTableShapeResizer.cxx
index 92bcc9388f10..c1b2e27bc197 100644
--- a/sc/source/filter/xml/XMLTableShapeResizer.cxx
+++ b/sc/source/filter/xml/XMLTableShapeResizer.cxx
@@ -88,7 +88,7 @@ void ScMyOLEFixer::CreateChartListener(ScDocument* pDoc,
         *pRefTokens, aRangeStr, pDoc, cSep, pDoc->GetGrammar());
     if (!pRefTokens->empty())
     {
-        ScChartListener* pCL(new ScChartListener(rName, pDoc, pRefTokens.release()));
+        ScChartListener* pCL(new ScChartListener(rName, pDoc, std::move(pRefTokens)));
 
         //for loading binary files e.g.
         //if we have the flat filter we need to set the dirty flag thus the visible charts get repainted


More information about the Libreoffice-commits mailing list