diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-27 15:58:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-28 10:13:06 +0200 |
commit | 6100ef45d8c90f141d68011bba9d9745dd319174 (patch) | |
tree | fcb3d07106f936dca2670572920294e050938c50 /sc | |
parent | b7239a1271d5af51163b4fcd93608b72db2616a4 (diff) |
return ScMemChart by std::unique_ptr
Change-Id: I5a5b54872ce6ae351c6550a1ec0b2f7c52c35e13
Reviewed-on: https://gerrit.libreoffice.org/59683
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/cellsuno.hxx | 2 | ||||
-rw-r--r-- | sc/inc/chartarr.hxx | 6 | ||||
-rw-r--r-- | sc/source/core/tool/chartarr.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/unoobj/cellsuno.cxx | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/sc/inc/cellsuno.hxx b/sc/inc/cellsuno.hxx index 625818ce5cfb..3bdb5e357fc4 100644 --- a/sc/inc/cellsuno.hxx +++ b/sc/inc/cellsuno.hxx @@ -202,7 +202,7 @@ private: void PaintGridRanges_Impl(); ScRangeListRef GetLimitedChartRanges_Impl( long nDataColumns, long nDataRows ) const; void ForceChartListener_Impl(); - ScMemChart* CreateMemChart_Impl() const; + std::unique_ptr<ScMemChart> CreateMemChart_Impl() const; const ScPatternAttr* GetCurrentAttrsFlat(); const ScPatternAttr* GetCurrentAttrsDeep(); diff --git a/sc/inc/chartarr.hxx b/sc/inc/chartarr.hxx index b24745bc7388..b342be84f7ac 100644 --- a/sc/inc/chartarr.hxx +++ b/sc/inc/chartarr.hxx @@ -61,8 +61,8 @@ class SC_DLLPUBLIC ScChartArray // only parameter-struct ScChartPositioner aPositioner; private: - ScMemChart* CreateMemChartSingle(); - ScMemChart* CreateMemChartMulti(); + std::unique_ptr<ScMemChart> CreateMemChartSingle(); + std::unique_ptr<ScMemChart> CreateMemChartMulti(); public: ScChartArray( ScDocument* pDoc, const ScRangeListRef& rRangeList ); @@ -73,7 +73,7 @@ public: bool HasColHeaders() const { return aPositioner.HasColHeaders(); } bool HasRowHeaders() const { return aPositioner.HasRowHeaders(); } - ScMemChart* CreateMemChart(); + std::unique_ptr<ScMemChart> CreateMemChart(); }; #endif diff --git a/sc/source/core/tool/chartarr.cxx b/sc/source/core/tool/chartarr.cxx index ba632ba1a386..76fcc2645839 100644 --- a/sc/source/core/tool/chartarr.cxx +++ b/sc/source/core/tool/chartarr.cxx @@ -60,7 +60,7 @@ ScChartArray::ScChartArray( pDocument( pDoc ), aPositioner(pDoc, rRangeList) {} -ScMemChart* ScChartArray::CreateMemChart() +std::unique_ptr<ScMemChart> ScChartArray::CreateMemChart() { ScRangeListRef aRangeListRef(GetRangeList()); size_t nCount = aRangeListRef->size(); @@ -112,7 +112,7 @@ double getCellValue( ScDocument& rDoc, const ScAddress& rPos, double fDefault, b } -ScMemChart* ScChartArray::CreateMemChartSingle() +std::unique_ptr<ScMemChart> ScChartArray::CreateMemChartSingle() { SCSIZE nCol; SCSIZE nRow; @@ -207,7 +207,7 @@ ScMemChart* ScChartArray::CreateMemChartSingle() } // Data - ScMemChart* pMemChart = new ScMemChart( nColCount, nRowCount ); + std::unique_ptr<ScMemChart> pMemChart(new ScMemChart( nColCount, nRowCount )); if ( bValidData ) { @@ -275,7 +275,7 @@ ScMemChart* ScChartArray::CreateMemChartSingle() return pMemChart; } -ScMemChart* ScChartArray::CreateMemChartMulti() +std::unique_ptr<ScMemChart> ScChartArray::CreateMemChartMulti() { SCSIZE nColCount = GetPositionMap()->GetColCount(); SCSIZE nRowCount = GetPositionMap()->GetRowCount(); @@ -300,7 +300,7 @@ ScMemChart* ScChartArray::CreateMemChartMulti() } // Data - ScMemChart* pMemChart = new ScMemChart( nColCount, nRowCount ); + std::unique_ptr<ScMemChart> pMemChart(new ScMemChart( nColCount, nRowCount )); SCSIZE nCol = 0; SCSIZE nRow = 0; diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index e957cb22faef..4d31248c34e9 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -2995,7 +2995,7 @@ void SAL_CALL ScCellRangesBase::incrementIndent() // XChartData -ScMemChart* ScCellRangesBase::CreateMemChart_Impl() const +std::unique_ptr<ScMemChart> ScCellRangesBase::CreateMemChart_Impl() const { if ( pDocShell && !aRanges.empty() ) { |