diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-11 15:17:32 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-20 09:46:39 +0200 |
commit | 6a99ac6ad5afa0f3c127c1ef2f36ed3f09ebaf17 (patch) | |
tree | 20bba01ef8b6b0b3b5e3a9dd8c934313f0d0344b /cui/source | |
parent | c116f3c5b3dc30650d9109d34187e439d2489654 (diff) |
loplugin:useuniqueptr in SvxColorOptionsTabPage
Change-Id: Iefd1719a4f9c529840b4c584df8c7f2104d29fb3
Reviewed-on: https://gerrit.libreoffice.org/56102
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/options/optcolor.cxx | 12 | ||||
-rw-r--r-- | cui/source/options/optcolor.hxx | 4 |
2 files changed, 6 insertions, 10 deletions
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx index daa240157889..2e73996d46ef 100644 --- a/cui/source/options/optcolor.cxx +++ b/cui/source/options/optcolor.cxx @@ -1016,13 +1016,11 @@ void SvxColorOptionsTabPage::dispose() } pColorConfig->ClearModified(); pColorConfig->EnableBroadcast(); - delete pColorConfig; - pColorConfig = nullptr; + pColorConfig.reset(); pExtColorConfig->ClearModified(); pExtColorConfig->EnableBroadcast(); - delete pExtColorConfig; - pExtColorConfig = nullptr; + pExtColorConfig.reset(); } m_pColorSchemeLB.clear(); m_pSaveSchemePB.clear(); @@ -1057,18 +1055,16 @@ void SvxColorOptionsTabPage::Reset( const SfxItemSet* ) { pColorConfig->ClearModified(); pColorConfig->DisableBroadcast(); - delete pColorConfig; } - pColorConfig = new EditableColorConfig; + pColorConfig.reset(new EditableColorConfig); m_pColorConfigCT->SetConfig(*pColorConfig); if(pExtColorConfig) { pExtColorConfig->ClearModified(); pExtColorConfig->DisableBroadcast(); - delete pExtColorConfig; } - pExtColorConfig = new EditableExtendedColorConfig; + pExtColorConfig.reset(new EditableExtendedColorConfig); m_pColorConfigCT->SetExtendedConfig(*pExtColorConfig); OUString sUser = GetUserData(); diff --git a/cui/source/options/optcolor.hxx b/cui/source/options/optcolor.hxx index 36e1063f35b5..5e9b2b558bc2 100644 --- a/cui/source/options/optcolor.hxx +++ b/cui/source/options/optcolor.hxx @@ -38,8 +38,8 @@ class SvxColorOptionsTabPage : public SfxTabPage bool bFillItemSetCalled; - svtools::EditableColorConfig* pColorConfig; - svtools::EditableExtendedColorConfig* pExtColorConfig; + std::unique_ptr<svtools::EditableColorConfig> pColorConfig; + std::unique_ptr<svtools::EditableExtendedColorConfig> pExtColorConfig; DECL_LINK(SchemeChangedHdl_Impl, ListBox&, void); DECL_LINK(SaveDeleteHdl_Impl, Button*, void); |