summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2014-03-28 19:17:53 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2014-03-28 19:20:53 +0900
commite3bd2ee4e00185d6e0e57aba7046634142d614b8 (patch)
tree02694526f8417518eabb5a2d2ddb22ed0faabb50 /cui
parent8b533d84f3ae211fdfafc2adc8d8567f366771d4 (diff)
Avoid possible resource leaks by boost::scoped_array
Change-Id: Ie20fc857f19f74aaccb546f9bfa11a7a657d3e8a
Diffstat (limited to 'cui')
-rw-r--r--cui/source/tabpages/numfmt.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index 837f18ce69d7..550711ed2803 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -41,6 +41,7 @@
#include "svx/flagsdef.hxx"
#include <vector>
#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <boost/scoped_array.hpp>
using ::com::sun::star::uno::Reference;
using ::com::sun::star::lang::XServiceInfo;
@@ -736,10 +737,10 @@ bool SvxNumberFormatTabPage::FillItemSet( SfxItemSet& rCoreAttrs )
if ( nDelCount > 0 )
{
- sal_uInt32* pDelArr = new sal_uInt32[nDelCount];
+ boost::scoped_array<sal_uInt32> pDelArr(new sal_uInt32[nDelCount]);
- pNumFmtShell->GetUpdateData( pDelArr, nDelCount );
- pNumItem->SetDelFormatArray( pDelArr, nDelCount );
+ pNumFmtShell->GetUpdateData( pDelArr.get(), nDelCount );
+ pNumItem->SetDelFormatArray( pDelArr.get(), nDelCount );
if(bNumItemFlag==sal_True)
{
@@ -755,7 +756,6 @@ bool SvxNumberFormatTabPage::FillItemSet( SfxItemSet& rCoreAttrs )
if ( pDocSh )
pDocSh->PutItem( *pNumItem );
}
- delete [] pDelArr;
}