loplugin:useuniqueptr in OutlineBulletDlg and SdPresLayoutTemplateDlg

Change-Id: I4bd0a9dd7be5b6ad7c1307f73c89ab0ee915ce9f
Reviewed-on: https://gerrit.libreoffice.org/56495
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2018-06-25 17:10:22 +02:00
parent 47e334edd0
commit add887972d
4 changed files with 8 additions and 8 deletions

View File

@@ -59,7 +59,7 @@ OutlineBulletDlg::OutlineBulletDlg(
aInputSet.MergeRange( SID_PARAM_NUM_PRESET, SID_PARAM_CUR_NUM_LEVEL );
aInputSet.Put( *pAttr );
pOutputSet = new SfxItemSet( *pAttr );
pOutputSet.reset( new SfxItemSet( *pAttr ) );
pOutputSet->ClearItem();
bool bOutliner = false;
@@ -142,7 +142,7 @@ OutlineBulletDlg::~OutlineBulletDlg()
void OutlineBulletDlg::dispose()
{
delete pOutputSet;
pOutputSet.reset();
SfxTabDialog::dispose();
}
@@ -191,7 +191,7 @@ const SfxItemSet* OutlineBulletDlg::GetOutputItemSet() const
pRule->SetFeatureFlag( SvxNumRuleFlags::NO_NUMBERS, false );
}
return pOutputSet;
return pOutputSet.get();
}
} // end of namespace sd

View File

@@ -90,7 +90,7 @@ SdPresLayoutTemplateDlg::SdPresLayoutTemplateDlg( SfxObjectShell const * pDocSh,
if( pParentItemSet )
aInputSet.SetParent( pParentItemSet );
pOutSet = new SfxItemSet( rStyleBase.GetItemSet() );
pOutSet.reset( new SfxItemSet( rStyleBase.GetItemSet() ) );
pOutSet->ClearItem();
// If there is no bullet item in this stylesheet, we get it
@@ -222,7 +222,7 @@ SdPresLayoutTemplateDlg::~SdPresLayoutTemplateDlg()
void SdPresLayoutTemplateDlg::dispose()
{
delete pOutSet;
pOutSet.reset();
SfxTabDialog::dispose();
}
@@ -294,7 +294,7 @@ const SfxItemSet* SdPresLayoutTemplateDlg::GetOutputItemSet() const
const SvxNumBulletItem *pSvxNumBulletItem = nullptr;
if( SfxItemState::SET == pOutSet->GetItemState(EE_PARA_NUMBULLET, false, reinterpret_cast<const SfxPoolItem**>(&pSvxNumBulletItem) ))
SdBulletMapper::MapFontsInNumRule( *pSvxNumBulletItem->GetNumRule(), *pOutSet );
return pOutSet;
return pOutSet.get();
}
else
return SfxTabDialog::GetOutputItemSet();

View File

@@ -49,7 +49,7 @@ private:
using SfxTabDialog::GetOutputItemSet;
SfxItemSet aInputSet;
SfxItemSet *pOutputSet;
std::unique_ptr<SfxItemSet> pOutputSet;
sal_uInt16 m_nOptionsId;
sal_uInt16 m_nPositionId;
bool bTitle;

View File

@@ -60,7 +60,7 @@ private:
// for mapping with the new SvxNumBulletItem
SfxItemSet aInputSet;
SfxItemSet* pOutSet;
std::unique_ptr<SfxItemSet> pOutSet;
const SfxItemSet* pOrgSet;
sal_uInt16 GetOutlineLevel() const;