From 7bc1c79c26e52d5196fb36eee5c2f12f12d49ba6 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Sun, 29 May 2016 20:46:29 +0200 Subject: [PATCH] tdf#89329: use unique_ptr for pImpl in defaultoptions Change-Id: I355888c44d1413f8d0ebd7a247649b79647c38ec Reviewed-on: https://gerrit.libreoffice.org/25629 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/unotools/defaultoptions.hxx | 3 ++- unotools/source/config/defaultoptions.cxx | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/unotools/defaultoptions.hxx b/include/unotools/defaultoptions.hxx index 7877087e6a94..f4937662d4c2 100644 --- a/include/unotools/defaultoptions.hxx +++ b/include/unotools/defaultoptions.hxx @@ -22,6 +22,7 @@ #include #include #include +#include class SvtDefaultOptions_Impl; @@ -29,7 +30,7 @@ class SvtDefaultOptions_Impl; class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtDefaultOptions : public utl::detail::Options { private: - SvtDefaultOptions_Impl* pImp; + std::unique_ptr pImpl; public: diff --git a/unotools/source/config/defaultoptions.cxx b/unotools/source/config/defaultoptions.cxx index 92d5a046c686..6f021d4240c4 100644 --- a/unotools/source/config/defaultoptions.cxx +++ b/unotools/source/config/defaultoptions.cxx @@ -326,7 +326,7 @@ SvtDefaultOptions::SvtDefaultOptions() ItemHolder1::holdConfigItem(E_DEFAULTOPTIONS); } ++nRefCount; - pImp = pOptions; + pImpl.reset(pOptions); } SvtDefaultOptions::~SvtDefaultOptions() @@ -343,7 +343,7 @@ SvtDefaultOptions::~SvtDefaultOptions() OUString SvtDefaultOptions::GetDefaultPath( sal_uInt16 nId ) const { - return pImp->GetDefaultPath( nId ); + return pImpl->GetDefaultPath( nId ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */