diff options
-rw-r--r-- | sc/inc/table.hxx | 4 | ||||
-rw-r--r-- | sc/source/core/data/table3.cxx | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 54d11db8599c..e9aee6b689a5 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -1153,8 +1153,8 @@ private: ScRefCellValue& rCell2, SCCOL nCell2Col, SCROW nCell2Row ) const; short Compare(SCCOLROW nIndex1, SCCOLROW nIndex2) const; short Compare( ScSortInfoArray*, SCCOLROW nIndex1, SCCOLROW nIndex2) const; - ScSortInfoArray* CreateSortInfoArray( const sc::ReorderParam& rParam ); - ScSortInfoArray* CreateSortInfoArray( + std::unique_ptr<ScSortInfoArray> CreateSortInfoArray( const sc::ReorderParam& rParam ); + std::unique_ptr<ScSortInfoArray> CreateSortInfoArray( const ScSortParam& rSortParam, SCCOLROW nInd1, SCCOLROW nInd2, bool bKeepQuery, bool bUpdateRefs ); void QuickSort( ScSortInfoArray*, SCCOLROW nLo, SCCOLROW nHi); diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index 816851e8c9a0..94c86f5eb8c2 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -446,9 +446,9 @@ void initDataRows( } -ScSortInfoArray* ScTable::CreateSortInfoArray( const sc::ReorderParam& rParam ) +std::unique_ptr<ScSortInfoArray> ScTable::CreateSortInfoArray( const sc::ReorderParam& rParam ) { - ScSortInfoArray* pArray = nullptr; + std::unique_ptr<ScSortInfoArray> pArray; if (rParam.mbByRow) { @@ -458,7 +458,7 @@ ScSortInfoArray* ScTable::CreateSortInfoArray( const sc::ReorderParam& rParam ) SCCOL nCol1 = rParam.maSortRange.aStart.Col(); SCCOL nCol2 = rParam.maSortRange.aEnd.Col(); - pArray = new ScSortInfoArray(0, nRow1, nRow2); + pArray.reset(new ScSortInfoArray(0, nRow1, nRow2)); pArray->SetKeepQuery(rParam.mbHiddenFiltered); pArray->SetUpdateRefs(rParam.mbUpdateRefs); @@ -471,7 +471,7 @@ ScSortInfoArray* ScTable::CreateSortInfoArray( const sc::ReorderParam& rParam ) SCCOLROW nCol1 = rParam.maSortRange.aStart.Col(); SCCOLROW nCol2 = rParam.maSortRange.aEnd.Col(); - pArray = new ScSortInfoArray(0, nCol1, nCol2); + pArray.reset(new ScSortInfoArray(0, nCol1, nCol2)); pArray->SetKeepQuery(rParam.mbHiddenFiltered); pArray->SetUpdateRefs(rParam.mbUpdateRefs); } @@ -479,14 +479,14 @@ ScSortInfoArray* ScTable::CreateSortInfoArray( const sc::ReorderParam& rParam ) return pArray; } -ScSortInfoArray* ScTable::CreateSortInfoArray( +std::unique_ptr<ScSortInfoArray> ScTable::CreateSortInfoArray( const ScSortParam& rSortParam, SCCOLROW nInd1, SCCOLROW nInd2, bool bKeepQuery, bool bUpdateRefs ) { sal_uInt16 nUsedSorts = 1; while ( nUsedSorts < rSortParam.GetSortKeyCount() && rSortParam.maKeyState[nUsedSorts].bDoSort ) nUsedSorts++; - ScSortInfoArray* pArray = new ScSortInfoArray( nUsedSorts, nInd1, nInd2 ); + std::unique_ptr<ScSortInfoArray> pArray(new ScSortInfoArray( nUsedSorts, nInd1, nInd2 )); pArray->SetKeepQuery(bKeepQuery); pArray->SetUpdateRefs(bUpdateRefs); |