diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-12-04 14:59:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-12-05 07:50:39 +0100 |
commit | a8694d21a87c44f6008a3547f0b004a17253fdd6 (patch) | |
tree | 40463d623a243a7b32f32f60ba19fc5e4810c778 | |
parent | 73d667e3a0db5f0d3ee1f9d001b6220190c02bfa (diff) |
use unique_ptr in SfxViewFrame::ExecReload_Impl
Change-Id: I35a8a3a6ccbf811e529f761f840bfc7acf870056
Reviewed-on: https://gerrit.libreoffice.org/64526
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 61cb945c738a..a642771b2c1f 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -616,11 +616,11 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) DELETEZ( xOldObj->Get_Impl()->pReloadTimer ); - SfxItemSet* pNewSet = nullptr; + std::unique_ptr<SfxItemSet> pNewSet; std::shared_ptr<const SfxFilter> pFilter = pMedium->GetFilter(); if( pURLItem ) { - pNewSet = new SfxAllItemSet( pApp->GetPool() ); + pNewSet.reset(new SfxAllItemSet( pApp->GetPool() )); pNewSet->Put( *pURLItem ); // Filter Detection @@ -637,7 +637,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) } else { - pNewSet = new SfxAllItemSet( *pMedium->GetItemSet() ); + pNewSet.reset(new SfxAllItemSet( *pMedium->GetItemSet() )); pNewSet->ClearItem( SID_VIEW_ID ); pNewSet->ClearItem( SID_STREAM ); pNewSet->ClearItem( SID_INPUTSTREAM ); @@ -657,7 +657,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) // If a salvaged file is present, do not enclose the OrigURL // again, since the Template is invalid after reload. - const SfxStringItem* pSalvageItem = SfxItemSet::GetItem<SfxStringItem>(pNewSet, SID_DOC_SALVAGE, false); + const SfxStringItem* pSalvageItem = SfxItemSet::GetItem<SfxStringItem>(pNewSet.get(), SID_DOC_SALVAGE, false); if( pSalvageItem ) { pNewSet->ClearItem( SID_DOC_SALVAGE ); @@ -680,9 +680,9 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) if ( pSilentItem && pSilentItem->GetValue() ) pNewSet->Put( SfxBoolItem( SID_SILENT, true ) ); - const SfxUnoAnyItem* pInteractionItem = SfxItemSet::GetItem<SfxUnoAnyItem>(pNewSet, SID_INTERACTIONHANDLER, false); - const SfxUInt16Item* pMacroExecItem = SfxItemSet::GetItem<SfxUInt16Item>(pNewSet, SID_MACROEXECMODE, false); - const SfxUInt16Item* pDocTemplateItem = SfxItemSet::GetItem<SfxUInt16Item>(pNewSet, SID_UPDATEDOCMODE, false); + const SfxUnoAnyItem* pInteractionItem = SfxItemSet::GetItem<SfxUnoAnyItem>(pNewSet.get(), SID_INTERACTIONHANDLER, false); + const SfxUInt16Item* pMacroExecItem = SfxItemSet::GetItem<SfxUInt16Item>(pNewSet.get(), SID_MACROEXECMODE, false); + const SfxUInt16Item* pDocTemplateItem = SfxItemSet::GetItem<SfxUInt16Item>(pNewSet.get(), SID_UPDATEDOCMODE, false); if (!pInteractionItem) { @@ -734,7 +734,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) xNewObj = nullptr; } - DELETEZ( pNewSet ); + pNewSet.reset(); if( !xNewObj.Is() ) { |