diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-22 14:19:20 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-22 15:36:53 +0200 |
commit | b183b32383d40ebbd628771b1cd909e9a60a34ab (patch) | |
tree | 747765646473c8520d91cb9fe76b15c12ed60a04 /sc | |
parent | fe8b2398b2850f210c6d4fbcb5edd614194787f3 (diff) |
loplugin:useuniqueptr in ScChartListener
Change-Id: I0504bcd57a85b91ae2f4a5fa931f90f776f0fd46
Reviewed-on: https://gerrit.libreoffice.org/59446
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/chartlis.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/chartlis.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/excel/xichart.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/xml/XMLTableShapeResizer.cxx | 2 |
4 files changed, 5 insertions, 5 deletions
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 |