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

use unique_ptr in SfxBaseModel::storeSelf

Change-Id: I73524a15b5ac33ee6243a2e0e563b9986e887e40
Reviewed-on: https://gerrit.libreoffice.org/64528
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 0cc70223
......@@ -1515,7 +1515,7 @@ void SAL_CALL SfxBaseModel::storeSelf( const Sequence< beans::PropertyValue >
}
}
SfxAllItemSet *pParams = new SfxAllItemSet( SfxGetpApp()->GetPool() );
std::unique_ptr<SfxAllItemSet> pParams(new SfxAllItemSet( SfxGetpApp()->GetPool() ));
TransformParameters( nSlotId, aArgs, *pParams );
SfxGetpApp()->NotifyEvent( SfxEventHint( SfxEventHintId::SaveDoc, GlobalEventConfig::GetEventName(GlobalEventId::SAVEDOC), m_pData->m_pObjectShell.get() ) );
......@@ -1537,18 +1537,18 @@ void SAL_CALL SfxBaseModel::storeSelf( const Sequence< beans::PropertyValue >
}
else
{
bRet = m_pData->m_pObjectShell->Save_Impl( pParams );
bRet = m_pData->m_pObjectShell->Save_Impl( pParams.get() );
}
}
else
{
// Tell the SfxMedium if we are in checkin instead of normal save
m_pData->m_pObjectShell->GetMedium( )->SetInCheckIn( nSlotId == SID_CHECKIN );
bRet = m_pData->m_pObjectShell->Save_Impl( pParams );
bRet = m_pData->m_pObjectShell->Save_Impl( pParams.get() );
m_pData->m_pObjectShell->GetMedium( )->SetInCheckIn( nSlotId != SID_CHECKIN );
}
DELETEZ( pParams );
pParams.reset();
ErrCode nErrCode = m_pData->m_pObjectShell->GetError() ? m_pData->m_pObjectShell->GetError()
: ERRCODE_IO_CANTWRITE;
......
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