summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-04-16 22:04:55 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-04-23 21:08:19 -0400
commit1dad03a80a1236aa643974ab49a3f4cc75ceec1f (patch)
treeadcd717b9106fb9252d95cae41cbd77890536581 /sc/source
parent853a514d366cf5706ea259be5d0f58055c89d821 (diff)
Use boost::scoped_ptr for this.
Change-Id: I5acdb7e55cb3dfeff880f1f361fed4a8cc4acd3c
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/table3.cxx24
1 files changed, 15 insertions, 9 deletions
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 7cbc9d7a3bf9..a9dcd0311c9e 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -60,6 +60,7 @@
#include "svl/sharedstringpool.hxx"
#include <vector>
+#include <boost/scoped_ptr.hpp>
#include <boost/scoped_array.hpp>
#include <boost/unordered_set.hpp>
@@ -663,12 +664,15 @@ void ScTable::Sort(const ScSortParam& rSortParam, bool bKeepQuery, ScProgress* p
{
if(pProgress)
pProgress->SetState( 0, nLastRow-nRow1 );
- ScSortInfoArray* pArray = CreateSortInfoArray( nRow1, nLastRow );
+
+ boost::scoped_ptr<ScSortInfoArray> pArray(CreateSortInfoArray(nRow1, nLastRow));
+
if ( nLastRow - nRow1 > 255 )
- DecoladeRow( pArray, nRow1, nLastRow );
- QuickSort( pArray, nRow1, nLastRow );
- SortReorder( pArray, pProgress );
- delete pArray;
+ DecoladeRow(pArray.get(), nRow1, nLastRow);
+
+ QuickSort(pArray.get(), nRow1, nLastRow);
+ SortReorder(pArray.get(), pProgress);
+
// #i59745# update position of caption objects of cell notes --> reported at (SortReorder) ScColumn::SwapCellNotes level
}
}
@@ -685,10 +689,12 @@ void ScTable::Sort(const ScSortParam& rSortParam, bool bKeepQuery, ScProgress* p
{
if(pProgress)
pProgress->SetState( 0, nLastCol-nCol1 );
- ScSortInfoArray* pArray = CreateSortInfoArray( nCol1, nLastCol );
- QuickSort( pArray, nCol1, nLastCol );
- SortReorder( pArray, pProgress );
- delete pArray;
+
+ boost::scoped_ptr<ScSortInfoArray> pArray(CreateSortInfoArray(nCol1, nLastCol));
+
+ QuickSort(pArray.get(), nCol1, nLastCol);
+ SortReorder(pArray.get(), pProgress);
+
// #i59745# update position of caption objects of cell notes --> reported at (SortReorder) ScColumn::SwapCellNotes level
}
}