From dfb3be7e15bf5a02a6c35a3b6f84aceb6214ce55 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 17 Nov 2015 09:02:55 +0200 Subject: use unique_ptr for pImpl in vcl,vbahelper,uui Change-Id: Icb7573c24c681a8fc0570d61b6a30dab91378eb8 --- include/vbahelper/vbaapplicationbase.hxx | 3 ++- include/vcl/textview.hxx | 7 ++++--- uui/source/requeststringresolver.cxx | 1 - uui/source/requeststringresolver.hxx | 3 ++- vbahelper/source/vbahelper/vbaapplicationbase.cxx | 1 - vcl/source/edit/textview.cxx | 1 - 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/vbahelper/vbaapplicationbase.hxx b/include/vbahelper/vbaapplicationbase.hxx index 7f46069f4b5e..5d809b8a8fe9 100644 --- a/include/vbahelper/vbaapplicationbase.hxx +++ b/include/vbahelper/vbaapplicationbase.hxx @@ -23,6 +23,7 @@ #include #include #include +#include typedef InheritedHelperInterfaceWeakImpl< ov::XApplicationBase > ApplicationBase_BASE; @@ -30,7 +31,7 @@ struct VbaApplicationBase_Impl; class VBAHELPER_DLLPUBLIC VbaApplicationBase : public ApplicationBase_BASE { - VbaApplicationBase_Impl* m_pImpl; + std::unique_ptr m_pImpl; protected: VbaApplicationBase( const css::uno::Reference< css::uno::XComponentContext >& xContext ); diff --git a/include/vcl/textview.hxx b/include/vcl/textview.hxx index 44e4ef52d3ae..e5bc8c0e93e1 100644 --- a/include/vcl/textview.hxx +++ b/include/vcl/textview.hxx @@ -26,6 +26,7 @@ #include #include #include +#include class TextEngine; class OutputDevice; @@ -53,10 +54,10 @@ class VCL_DLLPUBLIC TextView : public vcl::unohelper::DragAndDropClient friend class ExtTextView; private: - ImpTextView* mpImpl; + std::unique_ptr mpImpl; - TextView( const TextView& ) : vcl::unohelper::DragAndDropClient() {} - TextView& operator=( const TextView& ) { return *this; } + TextView( const TextView& ) = delete; + TextView& operator=( const TextView& ) = delete; protected: void ShowSelection(); diff --git a/uui/source/requeststringresolver.cxx b/uui/source/requeststringresolver.cxx index daf33164b667..d2ed7dc9b7c9 100644 --- a/uui/source/requeststringresolver.cxx +++ b/uui/source/requeststringresolver.cxx @@ -33,7 +33,6 @@ UUIInteractionRequestStringResolver::UUIInteractionRequestStringResolver( UUIInteractionRequestStringResolver::~UUIInteractionRequestStringResolver() { - delete m_pImpl; } OUString SAL_CALL diff --git a/uui/source/requeststringresolver.hxx b/uui/source/requeststringresolver.hxx index f15b292ef874..8d7c21e12a2a 100644 --- a/uui/source/requeststringresolver.hxx +++ b/uui/source/requeststringresolver.hxx @@ -25,6 +25,7 @@ #include #include #include +#include class UUIInteractionHelper; @@ -47,7 +48,7 @@ public: rServiceFactory); private: - UUIInteractionHelper * m_pImpl; + std::unique_ptr m_pImpl; UUIInteractionRequestStringResolver(UUIInteractionRequestStringResolver &) = delete; void operator =(UUIInteractionRequestStringResolver&) = delete; diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx index 84230667651b..b468f8c0e16c 100644 --- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx +++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx @@ -175,7 +175,6 @@ VbaApplicationBase::VbaApplicationBase( const uno::Reference< uno::XComponentCon VbaApplicationBase::~VbaApplicationBase() { - delete m_pImpl; } sal_Bool SAL_CALL diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx index 28bdd32ac37d..cde8c85d6925 100644 --- a/vcl/source/edit/textview.cxx +++ b/vcl/source/edit/textview.cxx @@ -243,7 +243,6 @@ TextView::~TextView() mpImpl->mpWindow->SetCursor( nullptr ); delete mpImpl->mpCursor; delete mpImpl->mpDDInfo; - delete mpImpl; } void TextView::Invalidate() -- cgit