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

use unique_ptr in SwXFrame

Change-Id: I3671bf7ab7913a2f07eec347c1e07d036bfca4c4
Reviewed-on: https://gerrit.libreoffice.org/66122
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 9e2ca20b
...@@ -1548,7 +1548,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& ...@@ -1548,7 +1548,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any&
UnoActionContext aAction(pFormat->GetDoc()); UnoActionContext aAction(pFormat->GetDoc());
SfxItemSet* pSet = nullptr; std::unique_ptr<SfxItemSet> pSet;
// #i31771#, #i25798# - No adjustment of // #i31771#, #i25798# - No adjustment of
// anchor ( no call of method <sw_ChkAndSetNewAnchor(..)> ), // anchor ( no call of method <sw_ChkAndSetNewAnchor(..)> ),
// if document is currently in reading mode. // if document is currently in reading mode.
...@@ -1563,21 +1563,18 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& ...@@ -1563,21 +1563,18 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any&
const ::SfxPoolItem* pItem; const ::SfxPoolItem* pItem;
if( SfxItemState::SET == pFrameFormat->GetItemState( RES_ANCHOR, false, &pItem )) if( SfxItemState::SET == pFrameFormat->GetItemState( RES_ANCHOR, false, &pItem ))
{ {
pSet = new SfxItemSet( pDoc->GetAttrPool(), aFrameFormatSetRange ); pSet.reset(new SfxItemSet( pDoc->GetAttrPool(), aFrameFormatSetRange ));
pSet->Put( *pItem ); pSet->Put( *pItem );
if ( pFormat->GetDoc()->GetEditShell() != nullptr if ( pFormat->GetDoc()->GetEditShell() != nullptr
&& !sw_ChkAndSetNewAnchor( *pFly, *pSet ) ) && !sw_ChkAndSetNewAnchor( *pFly, *pSet ) )
{ {
delete pSet; pSet.reset();
pSet = nullptr;
} }
} }
} }
} }
pFormat->GetDoc()->SetFrameFormatToFly( *pFormat, *pFrameFormat, pSet ); pFormat->GetDoc()->SetFrameFormatToFly( *pFormat, *pFrameFormat, pSet.get() );
delete pSet;
} }
else if (FN_UNO_GRAPHIC_FILTER == pEntry->nWID) else if (FN_UNO_GRAPHIC_FILTER == pEntry->nWID)
{ {
......
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