diff options
-rw-r--r-- | include/tools/errinf.hxx | 7 | ||||
-rw-r--r-- | include/tools/fract.hxx | 3 | ||||
-rw-r--r-- | include/tools/resary.hxx | 3 | ||||
-rw-r--r-- | tools/source/generic/fract.cxx | 1 | ||||
-rw-r--r-- | tools/source/rc/resary.cxx | 1 | ||||
-rw-r--r-- | tools/source/ref/errinf.cxx | 11 |
6 files changed, 12 insertions, 14 deletions
diff --git a/include/tools/errinf.hxx b/include/tools/errinf.hxx index 950a65ec5ea9..28c1c260f18c 100644 --- a/include/tools/errinf.hxx +++ b/include/tools/errinf.hxx @@ -26,6 +26,7 @@ #include <rtl/ustring.hxx> #include <tools/errcode.hxx> #include <tools/toolsdllapi.h> +#include <memory> // FIXME: horrible legacy dependency on VCL from tools. namespace vcl { class Window; } @@ -54,7 +55,7 @@ class TOOLS_DLLPUBLIC DynamicErrorInfo : public ErrorInfo friend class EDcr_Impl; private: - EDcr_Impl* pImpl; + std::unique_ptr<EDcr_Impl> pImpl; public: @@ -117,7 +118,7 @@ class TOOLS_DLLPUBLIC ErrorContext friend class ErrorHandler; private: - ErrorContextImpl *pImpl; + std::unique_ptr<ErrorContextImpl> pImpl; public: ErrorContext(vcl::Window *pWin=nullptr); @@ -140,7 +141,7 @@ class TOOLS_DLLPUBLIC ErrorHandler friend class ErrHdl_Impl; private: - ErrHdl_Impl* pImpl; + std::unique_ptr<ErrHdl_Impl> pImpl; static sal_uInt16 HandleError_Impl( sal_uIntPtr lId, sal_uInt16 nFlags, diff --git a/include/tools/fract.hxx b/include/tools/fract.hxx index 93663aca8ad2..efa7a17dc028 100644 --- a/include/tools/fract.hxx +++ b/include/tools/fract.hxx @@ -21,6 +21,7 @@ #include <sal/types.h> #include <tools/toolsdllapi.h> +#include <memory> class SvStream; @@ -30,7 +31,7 @@ class TOOLS_DLLPUBLIC SAL_WARN_UNUSED Fraction { struct Impl; - Impl* mpImpl; + std::unique_ptr<Impl> mpImpl; bool HasOverflowValue(); diff --git a/include/tools/resary.hxx b/include/tools/resary.hxx index 4e15feb5ee08..0cec8eb351b8 100644 --- a/include/tools/resary.hxx +++ b/include/tools/resary.hxx @@ -21,6 +21,7 @@ #include <tools/toolsdllapi.h> #include <rtl/ustring.hxx> +#include <memory> #define RESARRAY_INDEX_NOTFOUND (0xffffffff) @@ -29,7 +30,7 @@ class ResId; class TOOLS_DLLPUBLIC ResStringArray { struct Impl; - Impl* mpImpl; + std::unique_ptr<Impl> mpImpl; ResStringArray( const ResStringArray& ) = delete; ResStringArray& operator=( const ResStringArray& ) = delete; 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() |