summaryrefslogtreecommitdiff
path: root/sc/source/filter/dif
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-07-12 18:58:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-07-13 08:30:26 +0200
commit647e11dc2fcbf0c8f7e39f4260d2b89057267e36 (patch)
treeb90e69042d1b95c59c3d4e5918d64ed3b2bbad3e /sc/source/filter/dif
parentd9e8fdbcd2f834a483890b409ede1b44c2da5da3 (diff)
loplugin:useuniqueptr in sc
Change-Id: I004e1f0292c8a40515880546574255ab835dbdbe Reviewed-on: https://gerrit.libreoffice.org/39875 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/filter/dif')
-rw-r--r--sc/source/filter/dif/difimp.cxx20
1 files changed, 5 insertions, 15 deletions
diff --git a/sc/source/filter/dif/difimp.cxx b/sc/source/filter/dif/difimp.cxx
index 5df754cc6f94..2603e06bf4ae 100644
--- a/sc/source/filter/dif/difimp.cxx
+++ b/sc/source/filter/dif/difimp.cxx
@@ -668,38 +668,28 @@ void DifColumn::Apply( ScDocument& rDoc, const SCCOL nCol, const SCTAB nTab )
DifAttrCache::DifAttrCache()
{
- ppCols = new DifColumn *[ MAXCOL + 1 ];
- for( SCCOL nCnt = 0 ; nCnt <= MAXCOL ; nCnt++ )
- ppCols[ nCnt ] = nullptr;
}
DifAttrCache::~DifAttrCache()
{
- for( SCCOL nCnt = 0 ; nCnt <= MAXCOL ; nCnt++ )
- {
- if( ppCols[ nCnt ] )
- delete ppCols[ nCnt ];
- }
-
- delete[] ppCols;
}
void DifAttrCache::SetNumFormat( const SCCOL nCol, const SCROW nRow, const sal_uInt32 nNumFormat )
{
OSL_ENSURE( ValidCol(nCol), "-DifAttrCache::SetNumFormat(): Col too big!" );
- if( !ppCols[ nCol ] )
- ppCols[ nCol ] = new DifColumn;
+ if( !mvCols[ nCol ] )
+ mvCols[ nCol ].reset( new DifColumn );
- ppCols[ nCol ]->SetNumFormat( nRow, nNumFormat );
+ mvCols[ nCol ]->SetNumFormat( nRow, nNumFormat );
}
void DifAttrCache::Apply( ScDocument& rDoc, SCTAB nTab )
{
for( SCCOL nCol = 0 ; nCol <= MAXCOL ; nCol++ )
{
- if( ppCols[ nCol ] )
- ppCols[ nCol ]->Apply( rDoc, nCol, nTab );
+ if( mvCols[ nCol ] )
+ mvCols[ nCol ]->Apply( rDoc, nCol, nTab );
}
}