From 048a32d903c8cc81a8836c7c7209b92e0bfd6cd7 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 17 Nov 2015 11:05:49 +0200 Subject: use unique_ptr for pImpl in tools/ Change-Id: I7ac7eca32a67524f6c87696c16b16128e6d8518b --- tools/source/generic/fract.cxx | 1 - tools/source/rc/resary.cxx | 1 - tools/source/ref/errinf.cxx | 11 ++++------- 3 files changed, 4 insertions(+), 9 deletions(-) (limited to 'tools') diff --git a/tools/source/generic/fract.cxx b/tools/source/generic/fract.cxx index 72ce43d954f8..d2c60b8b4090 100644 --- a/tools/source/generic/fract.cxx +++ b/tools/source/generic/fract.cxx @@ -90,7 +90,6 @@ Fraction::Fraction( double dVal ) : mpImpl(new Impl) Fraction::~Fraction() { - delete mpImpl; } bool Fraction::HasOverflowValue() diff --git a/tools/source/rc/resary.cxx b/tools/source/rc/resary.cxx index 03854d31eec0..078b5a63b8f7 100644 --- a/tools/source/rc/resary.cxx +++ b/tools/source/rc/resary.cxx @@ -70,7 +70,6 @@ ResStringArray::ResStringArray( const ResId& rResId ) : ResStringArray::~ResStringArray() { - delete mpImpl; } OUString ResStringArray::GetString( sal_uInt32 nIndex ) const diff --git a/tools/source/ref/errinf.cxx b/tools/source/ref/errinf.cxx index 61efff495395..5e589baeaca6 100644 --- a/tools/source/ref/errinf.cxx +++ b/tools/source/ref/errinf.cxx @@ -116,9 +116,9 @@ DynamicErrorInfo::operator sal_uIntPtr() const } DynamicErrorInfo::DynamicErrorInfo(sal_uIntPtr lArgUserId, sal_uInt16 nMask) -: ErrorInfo(lArgUserId) +: ErrorInfo(lArgUserId), + pImpl(new EDcr_Impl) { - pImpl=new EDcr_Impl; pImpl->RegisterEDcr(this); pImpl->nMask=nMask; } @@ -126,7 +126,6 @@ DynamicErrorInfo::DynamicErrorInfo(sal_uIntPtr lArgUserId, sal_uInt16 nMask) DynamicErrorInfo::~DynamicErrorInfo() { EDcr_Impl::UnRegisterEDcr(this); - delete pImpl; } ErrorInfo* EDcr_Impl::GetDynamicErrorInfo(sal_uIntPtr lId) @@ -175,8 +174,8 @@ struct ErrorContextImpl }; ErrorContext::ErrorContext(vcl::Window *pWinP) + : pImpl( new ErrorContextImpl ) { - pImpl = new ErrorContextImpl(); ErrorContext *&pHdl = TheEDcrData::get().pFirstCtx; pImpl->pWin = pWinP; pImpl->pNext = pHdl; @@ -190,7 +189,6 @@ ErrorContext::~ErrorContext() ppCtx=&((*ppCtx)->pImpl->pNext); if(*ppCtx) *ppCtx=(*ppCtx)->pImpl->pNext; - delete pImpl; } ErrorContext *ErrorContext::GetContext() @@ -199,8 +197,8 @@ ErrorContext *ErrorContext::GetContext() } ErrorHandler::ErrorHandler() + : pImpl(new ErrHdl_Impl) { - pImpl=new ErrHdl_Impl; EDcrData &pData=TheEDcrData::get(); ErrorHandler *&pHdl=pData.pFirstHdl; pImpl->pNext=pHdl; @@ -216,7 +214,6 @@ ErrorHandler::~ErrorHandler() ppHdl=&((*ppHdl)->pImpl->pNext); if(*ppHdl) *ppHdl=(*ppHdl)->pImpl->pNext; - delete pImpl; } vcl::Window* ErrorContext::GetParent() -- cgit