diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-06-03 09:39:06 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-06-03 11:47:49 +0200 |
commit | 4bd56577ec4a3da5dae151ff82d957673fc8031d (patch) | |
tree | d202eacec3c1edf3c6034f9063dc2f4e2440df49 /editeng | |
parent | 027c7b411389127d77a271e53922edb4d7095a2e (diff) |
use std::make_unique instead of new
Change-Id: Icc5cb2f5fa5720eb9f6e22ec380397bb88542689
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116644
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/rtf/svxrtf.cxx | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx index 9c3f4cd2af17..1e85b415828c 100644 --- a/editeng/source/rtf/svxrtf.cxx +++ b/editeng/source/rtf/svxrtf.cxx @@ -735,40 +735,39 @@ void SvxRTFParser::AttrGroupEnd() // process the current, delete from Stack // - all character attributes sre keep the area // - all paragraph attributes to get the area // up to the previous paragraph - std::unique_ptr<SvxRTFItemStackType> pNew( - new SvxRTFItemStackType(*pOld, *mxInsertPosition, true)); - pNew->aAttrSet.SetParent( pOld->aAttrSet.GetParent() ); + auto xNew = std::make_unique<SvxRTFItemStackType>(*pOld, *mxInsertPosition, true); + xNew->aAttrSet.SetParent( pOld->aAttrSet.GetParent() ); - // Delete all paragraph attributes from pNew + // Delete all paragraph attributes from xNew for( sal_uInt16 n = 0; n < (sizeof(aPardMap) / sizeof(sal_uInt16)) && - pNew->aAttrSet.Count(); ++n ) + xNew->aAttrSet.Count(); ++n ) if( reinterpret_cast<sal_uInt16*>(&aPardMap)[n] ) - pNew->aAttrSet.ClearItem( reinterpret_cast<sal_uInt16*>(&aPardMap)[n] ); - pNew->SetRTFDefaults( GetRTFDefaults() ); + xNew->aAttrSet.ClearItem( reinterpret_cast<sal_uInt16*>(&aPardMap)[n] ); + xNew->SetRTFDefaults( GetRTFDefaults() ); // Were there any? - if( pNew->aAttrSet.Count() == pOld->aAttrSet.Count() ) + if( xNew->aAttrSet.Count() == pOld->aAttrSet.Count() ) { - pNew.reset(); + xNew.reset(); } else { - pNew->nStyleNo = 0; + xNew->nStyleNo = 0; - // Now span the real area of pNew from old + // Now span the real area of xNew from old SetEndPrevPara( pOld->mxEndNodeIdx, pOld->nEndCnt ); - pNew->nSttCnt = 0; + xNew->nSttCnt = 0; if( IsChkStyleAttr() ) { ClearStyleAttr_( *pOld ); - ClearStyleAttr_( *pNew ); //#i10381#, methinks. + ClearStyleAttr_( *xNew ); //#i10381#, methinks. } if( pCurrent ) { pCurrent->Add(std::move(pOld)); - pCurrent->Add(std::move(pNew)); + pCurrent->Add(std::move(xNew)); } else { @@ -776,7 +775,7 @@ void SvxRTFParser::AttrGroupEnd() // process the current, delete from Stack // read. (Span no attributes!) m_AttrSetList.push_back(std::move(pOld)); - m_AttrSetList.push_back(std::move(pNew)); + m_AttrSetList.push_back(std::move(xNew)); } break; } |