Kaydet (Commit) 8ffb60d7 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Use unique_ptr in aAttrList

Change-Id: I15d5d724e506c0b81cf176af8ba086418693912c
üst a003f705
...@@ -797,7 +797,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) ...@@ -797,7 +797,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
// and the UserCall is stored in this list. This is because // and the UserCall is stored in this list. This is because
// at the following mpDrawView->SetAttributes( *pSet, sal_True ) // at the following mpDrawView->SetAttributes( *pSet, sal_True )
// they get lost and have to be restored. // they get lost and have to be restored.
std::vector<std::pair<SfxItemSet*,SdrObjUserCall*> > aAttrList; std::vector<std::pair<std::unique_ptr<SfxItemSet>,SdrObjUserCall*> > aAttrList;
SdPage* pPresPage = static_cast<SdPage*>( mpDrawView->GetSdrPageView()->GetPage() ); SdPage* pPresPage = static_cast<SdPage*>( mpDrawView->GetSdrPageView()->GetPage() );
for ( size_t i = 0; i < nCount; ++i ) for ( size_t i = 0; i < nCount; ++i )
...@@ -806,9 +806,9 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) ...@@ -806,9 +806,9 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if( pPresPage->IsPresObj( pObj ) ) if( pPresPage->IsPresObj( pObj ) )
{ {
SfxItemSet* pNewSet = new SfxItemSet( GetDoc()->GetPool(), SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_AUTOGROWHEIGHT, 0 ); auto pNewSet = o3tl::make_unique<SfxItemSet>( GetDoc()->GetPool(), SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_AUTOGROWHEIGHT, 0 );
pNewSet->Put(pObj->GetMergedItemSet()); pNewSet->Put(pObj->GetMergedItemSet());
aAttrList.push_back(std::make_pair(pNewSet, pObj->GetUserCall())); aAttrList.push_back(std::make_pair(std::move(pNewSet), pObj->GetUserCall()));
} }
} }
...@@ -848,9 +848,9 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) ...@@ -848,9 +848,9 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if( pPresPage->IsPresObj( pObj ) ) if( pPresPage->IsPresObj( pObj ) )
{ {
std::pair<SfxItemSet*,SdrObjUserCall*> &rAttr = aAttrList[j++]; std::pair<std::unique_ptr<SfxItemSet>,SdrObjUserCall*> &rAttr = aAttrList[j++];
std::unique_ptr<SfxItemSet> pNewSet(rAttr.first); std::unique_ptr<SfxItemSet> & pNewSet(rAttr.first);
SdrObjUserCall* pUserCall = rAttr.second; SdrObjUserCall* pUserCall = rAttr.second;
if ( pNewSet && pNewSet->GetItemState( SDRATTR_TEXT_MINFRAMEHEIGHT ) == SfxItemState::SET ) if ( pNewSet && pNewSet->GetItemState( SDRATTR_TEXT_MINFRAMEHEIGHT ) == SfxItemState::SET )
......
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