Kaydet (Commit) bf9d2c6f authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in RootData

Change-Id: Ibb053d17a1da6e3db74b97b4f66a4ad03147b3bc
Reviewed-on: https://gerrit.libreoffice.org/57297
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 807d5f11
...@@ -50,14 +50,10 @@ ...@@ -50,14 +50,10 @@
RootData::RootData() RootData::RootData()
{ {
eDateiTyp = BiffX; eDateiTyp = BiffX;
pExtSheetBuff = nullptr;
pShrfmlaBuff = nullptr;
pExtNameBuff = nullptr;
pFmlaConverter = nullptr; pFmlaConverter = nullptr;
pAutoFilterBuffer = nullptr; pPrintRanges.reset( new ScRangeListTabs );
pPrintRanges = new ScRangeListTabs; pPrintTitles.reset( new ScRangeListTabs );
pPrintTitles = new ScRangeListTabs;
pTabId = nullptr; pTabId = nullptr;
pUserBViewList = nullptr; pUserBViewList = nullptr;
...@@ -69,12 +65,12 @@ RootData::RootData() ...@@ -69,12 +65,12 @@ RootData::RootData()
RootData::~RootData() RootData::~RootData()
{ {
delete pExtSheetBuff; pExtSheetBuff.reset();
delete pShrfmlaBuff; pShrfmlaBuff.reset();
delete pExtNameBuff; pExtNameBuff.reset();
delete pAutoFilterBuffer; pAutoFilterBuffer.reset();
delete pPrintRanges; pPrintRanges.reset();
delete pPrintTitles; pPrintTitles.reset();
} }
XclImpOutlineBuffer::XclImpOutlineBuffer( SCSIZE nNewSize ) : XclImpOutlineBuffer::XclImpOutlineBuffer( SCSIZE nNewSize ) :
......
...@@ -125,9 +125,9 @@ ImportExcel::ImportExcel( XclImpRootData& rImpData, SvStream& rStrm ): ...@@ -125,9 +125,9 @@ ImportExcel::ImportExcel( XclImpRootData& rImpData, SvStream& rStrm ):
pExcRoot = &GetOldRoot(); pExcRoot = &GetOldRoot();
pExcRoot->pIR = this; // ExcRoot -> XclImpRoot pExcRoot->pIR = this; // ExcRoot -> XclImpRoot
pExcRoot->eDateiTyp = BiffX; pExcRoot->eDateiTyp = BiffX;
pExcRoot->pExtSheetBuff = new ExtSheetBuffer( pExcRoot ); //&aExtSheetBuff; pExcRoot->pExtSheetBuff.reset( new ExtSheetBuffer( pExcRoot ) ); //&aExtSheetBuff;
pExcRoot->pShrfmlaBuff = new SharedFormulaBuffer( pExcRoot ); //&aShrfrmlaBuff; pExcRoot->pShrfmlaBuff.reset( new SharedFormulaBuffer( pExcRoot ) ); //&aShrfrmlaBuff;
pExcRoot->pExtNameBuff = new ExtNameBuff ( *this ); pExcRoot->pExtNameBuff.reset( new ExtNameBuff ( *this ) );
pOutlineListBuffer = new XclImpOutlineListBuffer; pOutlineListBuffer = new XclImpOutlineListBuffer;
......
...@@ -74,7 +74,7 @@ XclImpRoot::XclImpRoot( XclImpRootData& rImpRootData ) : ...@@ -74,7 +74,7 @@ XclImpRoot::XclImpRoot( XclImpRootData& rImpRootData ) :
mrImpData.mxCondFmtMgr.reset( new XclImpCondFormatManager( GetRoot() ) ); mrImpData.mxCondFmtMgr.reset( new XclImpCondFormatManager( GetRoot() ) );
mrImpData.mxValidMgr.reset( new XclImpValidationManager( GetRoot() ) ); mrImpData.mxValidMgr.reset( new XclImpValidationManager( GetRoot() ) );
// TODO still in old RootData (deleted by RootData) // TODO still in old RootData (deleted by RootData)
GetOldRoot().pAutoFilterBuffer = new XclImpAutoFilterBuffer; GetOldRoot().pAutoFilterBuffer.reset( new XclImpAutoFilterBuffer );
mrImpData.mxWebQueryBfr.reset( new XclImpWebQueryBuffer( GetRoot() ) ); mrImpData.mxWebQueryBfr.reset( new XclImpWebQueryBuffer( GetRoot() ) );
mrImpData.mxPTableMgr.reset( new XclImpPivotTableManager( GetRoot() ) ); mrImpData.mxPTableMgr.reset( new XclImpPivotTableManager( GetRoot() ) );
mrImpData.mxTabProtect.reset( new XclImpSheetProtectBuffer( GetRoot() ) ); mrImpData.mxTabProtect.reset( new XclImpSheetProtectBuffer( GetRoot() ) );
......
...@@ -52,17 +52,17 @@ class XclExpRoot; ...@@ -52,17 +52,17 @@ class XclExpRoot;
struct RootData // -> incarnation in each case in the ImportExcel object! struct RootData // -> incarnation in each case in the ImportExcel object!
{ {
BiffTyp eDateiTyp; // fine differentiation BiffTyp eDateiTyp; // fine differentiation
ExtSheetBuffer* pExtSheetBuff; std::unique_ptr<ExtSheetBuffer> pExtSheetBuff;
SharedFormulaBuffer* pShrfmlaBuff; std::unique_ptr<SharedFormulaBuffer> pShrfmlaBuff;
ExtNameBuff* pExtNameBuff; std::unique_ptr<ExtNameBuff> pExtNameBuff;
ExcelToSc* pFmlaConverter; ExcelToSc* pFmlaConverter;
XclImpColRowSettings* pColRowBuff; // col/row settings 1 table XclImpColRowSettings* pColRowBuff; // col/row settings 1 table
// Biff8 // Biff8
XclImpAutoFilterBuffer* pAutoFilterBuffer; // ranges for autofilter and advanced filter std::unique_ptr<XclImpAutoFilterBuffer> pAutoFilterBuffer; // ranges for autofilter and advanced filter
ScRangeListTabs* pPrintRanges; std::unique_ptr<ScRangeListTabs> pPrintRanges;
ScRangeListTabs* pPrintTitles; std::unique_ptr<ScRangeListTabs> pPrintTitles;
// extensions for export // extensions for export
XclExpChTrTabId* pTabId; // pointer to rec list, do not destroy XclExpChTrTabId* pTabId; // pointer to rec list, do not destroy
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment