summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-09-21 15:32:32 +0200
committerMichael Stahl <mstahl@redhat.com>2012-09-21 18:05:03 +0200
commit8e72fd8866fbef881a12049fd4ca87f5dea8d671 (patch)
tree1b178d87e58074bc3f2380b884973c2419db14d1 /sw
parent2422544bb81170f7248046aa0a77efc14033deb9 (diff)
use scoped_array in lcl_UnMerge
Change-Id: I00c899612d499273725ff8071aff1c93c7d17327
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/table/swnewtable.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx
index ed0c47ecef50..6ba86f58ed39 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -43,6 +43,7 @@
#include <set>
#include <list>
#include <memory>
+#include <boost/scoped_array.hpp>
#include <editeng/boxitem.hxx>
#include <editeng/protitem.hxx>
#include <swtblfmt.hxx>
@@ -1097,10 +1098,10 @@ void lcl_UnMerge( const SwTable& rTable, SwTableBox& rBox, size_t nCnt,
return;
if( nCnt > nCount )
nCnt = nCount;
- size_t *const pSplitIdx = new size_t[ nCnt ];
+ ::boost::scoped_array<size_t> const pSplitIdx(new size_t[nCnt]);
if( bSameHeight )
{
- SwTwips *pHeights = new SwTwips[ nCount ];
+ ::boost::scoped_array<SwTwips> const pHeights(new SwTwips[nCount]);
SwTwips nHeight = 0;
for (size_t i = 0; i < nCount; ++i)
{
@@ -1118,7 +1119,6 @@ void lcl_UnMerge( const SwTable& rTable, SwTableBox& rBox, size_t nCnt,
nSumH += pHeights[ nIdx++ ];
pSplitIdx[ i - 1 ] = nIdx;
}
- delete[] pHeights;
}
else
{
@@ -1136,7 +1136,6 @@ void lcl_UnMerge( const SwTable& rTable, SwTableBox& rBox, size_t nCnt,
while( ++nIdx < nNextIdx )
aBoxes[ nIdx ]->setRowSpan( nIdx - nNextIdx );
}
- delete[] pSplitIdx;
}
/** lcl_FillSelBoxes(..) puts all boxes of a given line into the selection structure