diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-16 16:05:49 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-29 07:17:24 +0100 |
commit | 084571ee6ce7daf0d94f6c3e1ef7186edcf2b969 (patch) | |
tree | 55ed9c2a74e7f4fb0b1b396729271d1c999079fc /sfx2 | |
parent | 5da6e7d2066565c99827127c703b705c2ff0a6de (diff) |
loplugin:useuniqueptr in ModelData_Impl
Change-Id: I66866ed1698fafe59ba31f99df09fb792da410e3
Reviewed-on: https://gerrit.libreoffice.org/48702
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/guisaveas.cxx | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index 4240f62f16e2..4f878d32f14d 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -275,8 +275,8 @@ class ModelData_Impl uno::Reference< frame::XStorable2 > m_xStorable2; OUString m_aModuleName; - ::comphelper::SequenceAsHashMap* m_pDocumentPropsHM; - ::comphelper::SequenceAsHashMap* m_pModulePropsHM; + std::unique_ptr<::comphelper::SequenceAsHashMap> m_pDocumentPropsHM; + std::unique_ptr<::comphelper::SequenceAsHashMap> m_pModulePropsHM; ::comphelper::SequenceAsHashMap m_aMediaDescrHM; @@ -381,18 +381,14 @@ ModelData_Impl::ModelData_Impl( SfxStoringHelper& aOwner, ModelData_Impl::~ModelData_Impl() { FreeDocumentProps(); - delete m_pDocumentPropsHM; - delete m_pModulePropsHM; + m_pDocumentPropsHM.reset(); + m_pModulePropsHM.reset(); } void ModelData_Impl::FreeDocumentProps() { - if ( m_pDocumentPropsHM ) - { - delete m_pDocumentPropsHM; - m_pDocumentPropsHM = nullptr; - } + m_pDocumentPropsHM.reset(); } @@ -430,7 +426,7 @@ uno::Reference< frame::XStorable2 > const & ModelData_Impl::GetStorable2() const ::comphelper::SequenceAsHashMap& ModelData_Impl::GetDocProps() { if ( !m_pDocumentPropsHM ) - m_pDocumentPropsHM = new ::comphelper::SequenceAsHashMap( GetModel()->getArgs() ); + m_pDocumentPropsHM.reset( new ::comphelper::SequenceAsHashMap( GetModel()->getArgs() ) ); return *m_pDocumentPropsHM; } @@ -457,7 +453,7 @@ const ::comphelper::SequenceAsHashMap& ModelData_Impl::GetModuleProps() m_pOwner->GetModuleManager()->getByName( GetModuleName() ) >>= aModuleProps; if ( !aModuleProps.getLength() ) throw uno::RuntimeException(); // TODO; - m_pModulePropsHM = new ::comphelper::SequenceAsHashMap( aModuleProps ); + m_pModulePropsHM.reset( new ::comphelper::SequenceAsHashMap( aModuleProps ) ); } return *m_pModulePropsHM; |