summaryrefslogtreecommitdiff
path: root/sc/source/ui/miscdlgs
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2014-03-24 03:09:23 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2014-03-24 03:10:18 +0900
commitf516cff220895391c861adf1f4e93e280e1c3a17 (patch)
tree090c2c32ab91b27a49fb8de162e5c95faea5e6f2 /sc/source/ui/miscdlgs
parent970517af3e02e6c05e4d2b44d63745e8a414bb43 (diff)
Avoid possible resource leaks by boost::scoped_array
Change-Id: I7b72c5680d5665b3f1f720f50a2d3ea6fc0c3e39
Diffstat (limited to 'sc/source/ui/miscdlgs')
-rw-r--r--sc/source/ui/miscdlgs/crnrdlg.cxx12
1 files changed, 5 insertions, 7 deletions
diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx b/sc/source/ui/miscdlgs/crnrdlg.cxx
index 974063a049ab..93538409e5b6 100644
--- a/sc/source/ui/miscdlgs/crnrdlg.cxx
+++ b/sc/source/ui/miscdlgs/crnrdlg.cxx
@@ -27,7 +27,7 @@
#include "crnrdlg.hxx"
#undef _CRNRDLG_CXX
#include <vcl/msgbox.hxx>
-
+#include <boost/scoped_array.hpp>
@@ -505,8 +505,8 @@ void ScColRowNameRangesDlg::UpdateNames()
pLbRange->SetEntryData( nPos, (void*)nEntryDataDelim );
if ( (nCount = xColNameRanges->size()) > 0 )
{
- ScRangePair** ppSortArray = xColNameRanges->CreateNameSortedArray(
- nCount, pDoc );
+ boost::scoped_array<ScRangePair*> ppSortArray(xColNameRanges->CreateNameSortedArray(
+ nCount, pDoc ));
for ( j=0; j < nCount; j++ )
{
const ScRange aRange(ppSortArray[j]->GetRange(0));
@@ -543,7 +543,6 @@ void ScColRowNameRangesDlg::UpdateNames()
aRangeMap.insert( NameRangeMap::value_type(aInsStr, aRange) );
pLbRange->SetEntryData( nPos, (void*)nEntryDataCol );
}
- delete [] ppSortArray;
}
aString = strDelim;
aString += ScGlobal::GetRscString( STR_ROW );
@@ -552,8 +551,8 @@ void ScColRowNameRangesDlg::UpdateNames()
pLbRange->SetEntryData( nPos, (void*)nEntryDataDelim );
if ( (nCount = xRowNameRanges->size()) > 0 )
{
- ScRangePair** ppSortArray = xRowNameRanges->CreateNameSortedArray(
- nCount, pDoc );
+ boost::scoped_array<ScRangePair*> ppSortArray(xRowNameRanges->CreateNameSortedArray(
+ nCount, pDoc ));
for ( j=0; j < nCount; j++ )
{
const ScRange aRange(ppSortArray[j]->GetRange(0));
@@ -588,7 +587,6 @@ void ScColRowNameRangesDlg::UpdateNames()
aRangeMap.insert( NameRangeMap::value_type(aInsStr, aRange) );
pLbRange->SetEntryData( nPos, (void*)nEntryDataRow );
}
- delete [] ppSortArray;
}
pLbRange->SetUpdateMode( true );