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(-)

New commits:
commit a1467c8a526d7dda6e51d2af6a15f274feed30a1
Author: Stephan Bergmann <[email protected]>
Date:   Mon Jul 17 17:24:48 2017 +0200

    loplugin:useuniqueptr: svl (clang-cl)
    
    Change-Id: Id8705c82ab87724b0542acbfe0ad165f889f267a

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<DdeTransaction*> aTransactions;
     DdeString*      pService;
     DdeString*      pTopic;
-    DdeImp*         pImp;
+    std::unique_ptr<DdeImp> 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 <algorithm>
 #include "ddeimp.hxx"
 #include <svl/svdde.hxx>
-
+#include <o3tl/make_unique.hxx>
 #include <osl/thread.h>
 #include <comphelper/solarmutex.hxx>
 
@@ -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<DdeImp>())
 {
-    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;
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to