diff options
-rw-r--r-- | sc/inc/conditio.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/conditio.cxx | 12 | ||||
-rw-r--r-- | sc/source/filter/excel/xecontent.cxx | 6 |
3 files changed, 10 insertions, 10 deletions
diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx index ae1097078c15..4651f7453b04 100644 --- a/sc/inc/conditio.hxx +++ b/sc/inc/conditio.hxx @@ -380,7 +380,7 @@ public: /** Create a flat copy using ScTokenArray copy-ctor with shared tokens. */ - ScTokenArray* CreateFlatCopiedTokenArray( sal_uInt16 nPos ) const; + std::unique_ptr<ScTokenArray> CreateFlatCopiedTokenArray( sal_uInt16 nPos ) const; void CompileAll(); void CompileXML(); diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index c992bd6f3ec3..359a76986da9 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -1277,18 +1277,18 @@ OUString ScConditionEntry::GetExpression( const ScAddress& rCursor, sal_uInt16 n return aRet; } -ScTokenArray* ScConditionEntry::CreateFlatCopiedTokenArray( sal_uInt16 nIndex ) const +std::unique_ptr<ScTokenArray> ScConditionEntry::CreateFlatCopiedTokenArray( sal_uInt16 nIndex ) const { assert(nIndex <= 1); - ScTokenArray* pRet = nullptr; + std::unique_ptr<ScTokenArray> pRet; if ( nIndex==0 ) { if ( pFormula1 ) - pRet = new ScTokenArray( *pFormula1 ); + pRet.reset(new ScTokenArray( *pFormula1 )); else { - pRet = new ScTokenArray(); + pRet.reset(new ScTokenArray()); if (bIsStr1) { svl::SharedStringPool& rSPool = mpDoc->GetSharedStringPool(); @@ -1301,10 +1301,10 @@ ScTokenArray* ScConditionEntry::CreateFlatCopiedTokenArray( sal_uInt16 nIndex ) else if ( nIndex==1 ) { if ( pFormula2 ) - pRet = new ScTokenArray( *pFormula2 ); + pRet.reset(new ScTokenArray( *pFormula2 )); else { - pRet = new ScTokenArray(); + pRet.reset(new ScTokenArray()); if (bIsStr2) { svl::SharedStringPool& rSPool = mpDoc->GetSharedStringPool(); diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index 1bc2697aa518..779f5d710ddd 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -719,7 +719,7 @@ void XclExpCFImpl::WriteBody( XclExpStream& rStrm ) if (mbFormula2) { - xScTokArr.reset( mrFormatEntry.CreateFlatCopiedTokenArray( 1 ) ); + xScTokArr = mrFormatEntry.CreateFlatCopiedTokenArray( 1 ); mxTokArr2 = rFmlaComp.CreateFormula( EXC_FMLATYPE_CONDFMT, *xScTokArr ); } @@ -1712,7 +1712,7 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) : std::unique_ptr< ScTokenArray > xScTokArr; // first formula - xScTokArr.reset( pValData->CreateFlatCopiedTokenArray( 0 ) ); + xScTokArr = pValData->CreateFlatCopiedTokenArray( 0 ); if (xScTokArr) { if( pValData->GetDataMode() == SC_VALID_LIST ) @@ -1785,7 +1785,7 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) : } // second formula - xScTokArr.reset( pValData->CreateFlatCopiedTokenArray( 1 ) ); + xScTokArr = pValData->CreateFlatCopiedTokenArray( 1 ); if (xScTokArr) { if(GetOutput() == EXC_OUTPUT_BINARY) |