diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-28 14:37:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-05 07:27:31 +0100 |
commit | c9f01cc7855a20b1e0bff662cfbb75fe3665cd8a (patch) | |
tree | 16a303215b6de2fa1ac9352f8be4a67203b70048 /sfx2/source/control | |
parent | 260a443be052ba2c0c57584130a638341a2d3014 (diff) |
loplugin:useuniqueptr in StyleTree_Impl
Change-Id: I0541283ad9b5719f0b181ba1bdedeb287316c8a2
Reviewed-on: https://gerrit.libreoffice.org/50661
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/control')
-rw-r--r-- | sfx2/source/control/objface.cxx | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/sfx2/source/control/objface.cxx b/sfx2/source/control/objface.cxx index 244c8781fee5..78f561e3cedf 100644 --- a/sfx2/source/control/objface.cxx +++ b/sfx2/source/control/objface.cxx @@ -73,8 +73,10 @@ typedef std::vector<SfxObjectUI_Impl*> SfxObjectUIArr_Impl; struct SfxInterface_Impl { - SfxObjectUIArr_Impl aObjectBars; // registered ObjectBars - SfxObjectUIArr_Impl aChildWindows; // registered ChildWindows + std::vector<std::unique_ptr<SfxObjectUI_Impl>> + aObjectBars; // registered ObjectBars + std::vector<std::unique_ptr<SfxObjectUI_Impl>> + aChildWindows; // registered ChildWindows OUString aPopupName; // registered PopupMenu StatusBarId eStatBarResId; // registered StatusBar SfxModule* pModule; @@ -86,15 +88,6 @@ struct SfxInterface_Impl , bRegistered(false) { } - - ~SfxInterface_Impl() - { - for (auto const& objectBar : aObjectBars) - delete objectBar; - - for (auto const& childWindow : aChildWindows) - delete childWindow; - } }; static SfxObjectUI_Impl* CreateObjectBarUI_Impl(sal_uInt16 nPos, SfxVisibilityFlags nFlags, ToolbarId eId, SfxShellFeature nFeature); @@ -280,7 +273,7 @@ void SfxInterface::RegisterObjectBar(sal_uInt16 nPos, SfxVisibilityFlags nFlags, { SfxObjectUI_Impl* pUI = CreateObjectBarUI_Impl(nPos, nFlags, eId, nFeature); if ( pUI ) - pImplData->aObjectBars.push_back(pUI); + pImplData->aObjectBars.emplace_back(pUI); } SfxObjectUI_Impl* CreateObjectBarUI_Impl(sal_uInt16 nPos, SfxVisibilityFlags nFlags, ToolbarId eId, SfxShellFeature nFeature) @@ -365,7 +358,7 @@ void SfxInterface::RegisterChildWindow(sal_uInt16 nId, bool bContext, SfxShellFe { SfxObjectUI_Impl* pUI = new SfxObjectUI_Impl(0, SfxVisibilityFlags::Invisible, nId, nFeature); pUI->bContext = bContext; - pImplData->aChildWindows.push_back(pUI); + pImplData->aChildWindows.emplace_back(pUI); } void SfxInterface::RegisterStatusBar(StatusBarId eId) |