From a1467c8a526d7dda6e51d2af6a15f274feed30a1 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 17 Jul 2017 17:24:48 +0200 Subject: [PATCH] loplugin:useuniqueptr: svl (clang-cl) Change-Id: Id8705c82ab87724b0542acbfe0ad165f889f267a --- include/svl/svdde.hxx | 2 +- svl/source/svdde/ddecli.cxx | 7 +++---- svl/unx/source/svdde/ddedummy.cxx | 2 ++ 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/svl/svdde.hxx b/include/svl/svdde.hxx index d90dbed606e7..2415ad8e03ba 100644 --- a/include/svl/svdde.hxx +++ b/include/svl/svdde.hxx @@ -180,7 +180,7 @@ class SVL_DLLPUBLIC DdeConnection std::vector aTransactions; DdeString* pService; DdeString* pTopic; - DdeImp* pImp; + std::unique_ptr pImp; public: DdeConnection( SAL_UNUSED_PARAMETER const OUString&, SAL_UNUSED_PARAMETER const OUString& ); diff --git a/svl/source/svdde/ddecli.cxx b/svl/source/svdde/ddecli.cxx index 5707b0c40878..d97a9cdf4fe6 100644 --- a/svl/source/svdde/ddecli.cxx +++ b/svl/source/svdde/ddecli.cxx @@ -23,7 +23,7 @@ #include #include "ddeimp.hxx" #include - +#include #include #include @@ -144,9 +144,9 @@ HDDEDATA CALLBACK DdeInternal::CliCallback( UINT nCode, UINT nCbType, return nRet; } -DdeConnection::DdeConnection( const OUString& rService, const OUString& rTopic ) +DdeConnection::DdeConnection( const OUString& rService, const OUString& rTopic ): + pImp(o3tl::make_unique()) { - pImp = new DdeImp; pImp->nStatus = DMLERR_NO_ERROR; pImp->hConv = nullptr; @@ -206,7 +206,6 @@ DdeConnection::~DdeConnection() ImpDeinitInstData(); } } - delete pImp; } bool DdeConnection::IsConnected() diff --git a/svl/unx/source/svdde/ddedummy.cxx b/svl/unx/source/svdde/ddedummy.cxx index 7f032ef20446..856d79dc5db2 100644 --- a/svl/unx/source/svdde/ddedummy.cxx +++ b/svl/unx/source/svdde/ddedummy.cxx @@ -77,6 +77,8 @@ void const * DdeData::getData() const return nullptr; } +struct DdeImp {}; + long DdeConnection::GetError() { return 0L;