diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-14 14:36:52 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-17 07:23:22 +0200 |
commit | db3860062ebf4109f48139c2556ff4041aff5d6e (patch) | |
tree | b6ab4df909c8922e48a9c4eefa9a8f0f6a47c41f /comphelper | |
parent | 846f557fd591626931a9dadb38180786e090104c (diff) |
extend loplugin useuniqueptr to OUString pointers
Change-Id: Ieb5bab3895e1edaff497c4a1a88303ccac097edc
Reviewed-on: https://gerrit.libreoffice.org/39948
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/officeinstdir/officeinstallationdirectories.cxx | 6 | ||||
-rw-r--r-- | comphelper/source/officeinstdir/officeinstallationdirectories.hxx | 5 |
2 files changed, 5 insertions, 6 deletions
diff --git a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx index 48295a494841..63d88868add6 100644 --- a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx +++ b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx @@ -89,8 +89,6 @@ OfficeInstallationDirectories::OfficeInstallationDirectories( // virtual OfficeInstallationDirectories::~OfficeInstallationDirectories() { - delete m_pOfficeBrandDir; - delete m_pUserDir; } @@ -216,8 +214,8 @@ void OfficeInstallationDirectories::initDirs() osl::MutexGuard aGuard( m_aMutex ); if ( m_pOfficeBrandDir == nullptr ) { - m_pOfficeBrandDir = new OUString; - m_pUserDir = new OUString; + m_pOfficeBrandDir.reset( new OUString ); + m_pUserDir.reset( new OUString ); uno::Reference< util::XMacroExpander > xExpander = util::theMacroExpander::get(m_xCtx); diff --git a/comphelper/source/officeinstdir/officeinstallationdirectories.hxx b/comphelper/source/officeinstdir/officeinstallationdirectories.hxx index b1b235622a73..4437951b7dec 100644 --- a/comphelper/source/officeinstdir/officeinstallationdirectories.hxx +++ b/comphelper/source/officeinstdir/officeinstallationdirectories.hxx @@ -26,6 +26,7 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/util/XOfficeInstallationDirectories.hpp> +#include <memory> namespace comphelper { @@ -71,8 +72,8 @@ private: OUString m_aOfficeBrandDirMacro; OUString m_aUserDirMacro; css::uno::Reference< css::uno::XComponentContext > m_xCtx; - OUString * m_pOfficeBrandDir; - OUString * m_pUserDir; + std::unique_ptr<OUString> m_pOfficeBrandDir; + std::unique_ptr<OUString> m_pUserDir; }; } // namespace comphelper |