summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2017-02-08 14:26:08 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-02-09 19:21:13 +0000
commitdca6eefc211cc36b5e3ba7157d45e12ee6b9f5f8 (patch)
tree267a0b95d14c1600d26d5417d3d03c94f8598329 /sc
parent1d2c7fd407bb617c0617d8c8bceb41fa013e6fed (diff)
use std::unique_ptr
Change-Id: I6d80d47dcc40daf2749eeec58a7ca19d09c4b803 Reviewed-on: https://gerrit.libreoffice.org/34045 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/excel/excrecds.cxx28
-rw-r--r--sc/source/filter/inc/excrecds.hxx4
2 files changed, 14 insertions, 18 deletions
diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx
index d0e96abc9eb1..92b5460f77ba 100644
--- a/sc/source/filter/excel/excrecds.cxx
+++ b/sc/source/filter/excel/excrecds.cxx
@@ -874,9 +874,7 @@ void XclExpAutofilter::SaveXml( XclExpXmlStream& rStrm )
ExcAutoFilterRecs::ExcAutoFilterRecs( const XclExpRoot& rRoot, SCTAB nTab, const ScDBData* pDefinedData ) :
XclExpRoot( rRoot ),
- pFilterMode( nullptr ),
- pFilterInfo( nullptr )
- , mbAutoFilter (false)
+ mbAutoFilter (false)
{
XclExpNameManager& rNameMgr = GetNameManager();
@@ -920,7 +918,7 @@ ExcAutoFilterRecs::ExcAutoFilterRecs( const XclExpRoot& rRoot, SCTAB nTab, const
rNameMgr.InsertBuiltInName( EXC_BUILTIN_EXTRACT, aDestRange );
}
- pFilterMode = new XclExpFiltermode;
+ m_pFilterMode.reset(new XclExpFiltermode);
}
// AutoFilter
else
@@ -963,8 +961,8 @@ ExcAutoFilterRecs::ExcAutoFilterRecs( const XclExpRoot& rRoot, SCTAB nTab, const
maFilterList.RemoveAllRecords();
if( !maFilterList.IsEmpty() )
- pFilterMode = new XclExpFiltermode;
- pFilterInfo = new XclExpAutofilterinfo( aRange.aStart, nColCnt );
+ m_pFilterMode.reset(new XclExpFiltermode);
+ m_pFilterInfo.reset(new XclExpAutofilterinfo( aRange.aStart, nColCnt ));
if (maFilterList.IsEmpty () && !bConflict)
mbAutoFilter = true;
@@ -974,8 +972,6 @@ ExcAutoFilterRecs::ExcAutoFilterRecs( const XclExpRoot& rRoot, SCTAB nTab, const
ExcAutoFilterRecs::~ExcAutoFilterRecs()
{
- delete pFilterMode;
- delete pFilterInfo;
}
XclExpAutofilter* ExcAutoFilterRecs::GetByCol( SCCOL nCol )
@@ -1002,10 +998,10 @@ bool ExcAutoFilterRecs::IsFiltered( SCCOL nCol )
void ExcAutoFilterRecs::AddObjRecs()
{
- if( pFilterInfo )
+ if( m_pFilterInfo )
{
- ScAddress aAddr( pFilterInfo->GetStartPos() );
- for( SCCOL nObj = 0, nCount = pFilterInfo->GetColCount(); nObj < nCount; nObj++ )
+ ScAddress aAddr( m_pFilterInfo->GetStartPos() );
+ for( SCCOL nObj = 0, nCount = m_pFilterInfo->GetColCount(); nObj < nCount; nObj++ )
{
XclObj* pObjRec = new XclObjDropDown( GetObjectManager(), aAddr, IsFiltered( nObj ) );
GetObjectManager().AddObj( pObjRec );
@@ -1016,10 +1012,10 @@ void ExcAutoFilterRecs::AddObjRecs()
void ExcAutoFilterRecs::Save( XclExpStream& rStrm )
{
- if( pFilterMode )
- pFilterMode->Save( rStrm );
- if( pFilterInfo )
- pFilterInfo->Save( rStrm );
+ if( m_pFilterMode )
+ m_pFilterMode->Save( rStrm );
+ if( m_pFilterInfo )
+ m_pFilterInfo->Save( rStrm );
maFilterList.Save( rStrm );
}
@@ -1040,7 +1036,7 @@ void ExcAutoFilterRecs::SaveXml( XclExpXmlStream& rStrm )
bool ExcAutoFilterRecs::HasFilterMode() const
{
- return pFilterMode != nullptr;
+ return m_pFilterMode != nullptr;
}
XclExpFilterManager::XclExpFilterManager( const XclExpRoot& rRoot ) :
diff --git a/sc/source/filter/inc/excrecds.hxx b/sc/source/filter/inc/excrecds.hxx
index 3636c8953107..a2997097214e 100644
--- a/sc/source/filter/inc/excrecds.hxx
+++ b/sc/source/filter/inc/excrecds.hxx
@@ -424,8 +424,8 @@ private:
typedef XclExpAutofilterList::RecordRefType XclExpAutofilterRef;
XclExpAutofilterList maFilterList;
- XclExpFiltermode* pFilterMode;
- XclExpAutofilterinfo* pFilterInfo;
+ std::unique_ptr<XclExpFiltermode> m_pFilterMode;
+ std::unique_ptr<XclExpAutofilterinfo> m_pFilterInfo;
ScRange maRef;
bool mbAutoFilter;
};