Kaydet (Commit) 1dad03a8 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Use boost::scoped_ptr for this.

Change-Id: I5acdb7e55cb3dfeff880f1f361fed4a8cc4acd3c
üst 853a514d
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
#include "svl/sharedstringpool.hxx" #include "svl/sharedstringpool.hxx"
#include <vector> #include <vector>
#include <boost/scoped_ptr.hpp>
#include <boost/scoped_array.hpp> #include <boost/scoped_array.hpp>
#include <boost/unordered_set.hpp> #include <boost/unordered_set.hpp>
...@@ -663,12 +664,15 @@ void ScTable::Sort(const ScSortParam& rSortParam, bool bKeepQuery, ScProgress* p ...@@ -663,12 +664,15 @@ void ScTable::Sort(const ScSortParam& rSortParam, bool bKeepQuery, ScProgress* p
{ {
if(pProgress) if(pProgress)
pProgress->SetState( 0, nLastRow-nRow1 ); pProgress->SetState( 0, nLastRow-nRow1 );
ScSortInfoArray* pArray = CreateSortInfoArray( nRow1, nLastRow );
boost::scoped_ptr<ScSortInfoArray> pArray(CreateSortInfoArray(nRow1, nLastRow));
if ( nLastRow - nRow1 > 255 ) if ( nLastRow - nRow1 > 255 )
DecoladeRow( pArray, nRow1, nLastRow ); DecoladeRow(pArray.get(), nRow1, nLastRow);
QuickSort( pArray, nRow1, nLastRow );
SortReorder( pArray, pProgress ); QuickSort(pArray.get(), nRow1, nLastRow);
delete pArray; SortReorder(pArray.get(), pProgress);
// #i59745# update position of caption objects of cell notes --> reported at (SortReorder) ScColumn::SwapCellNotes level // #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 ...@@ -685,10 +689,12 @@ void ScTable::Sort(const ScSortParam& rSortParam, bool bKeepQuery, ScProgress* p
{ {
if(pProgress) if(pProgress)
pProgress->SetState( 0, nLastCol-nCol1 ); pProgress->SetState( 0, nLastCol-nCol1 );
ScSortInfoArray* pArray = CreateSortInfoArray( nCol1, nLastCol );
QuickSort( pArray, nCol1, nLastCol ); boost::scoped_ptr<ScSortInfoArray> pArray(CreateSortInfoArray(nCol1, nLastCol));
SortReorder( pArray, pProgress );
delete pArray; QuickSort(pArray.get(), nCol1, nLastCol);
SortReorder(pArray.get(), pProgress);
// #i59745# update position of caption objects of cell notes --> reported at (SortReorder) ScColumn::SwapCellNotes level // #i59745# update position of caption objects of cell notes --> reported at (SortReorder) ScColumn::SwapCellNotes level
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment