[Libreoffice-commits] core.git: svl/source
Stephan Bergmann
sbergman at redhat.com
Wed Apr 19 15:37:34 UTC 2017
svl/source/svdde/ddesvr.cxx | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
New commits:
commit 846c47fb0faaca505fec785db90384c093818db4
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Apr 19 17:37:07 2017 +0200
loplugin:useuniqueptr (clang-cl)
Change-Id: Ia854d1d6a8bd5f5f9a87aebb57337a992606c03f
diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx
index 8ece1071cf20..36fd9da26d90 100644
--- a/svl/source/svdde/ddesvr.cxx
+++ b/svl/source/svdde/ddesvr.cxx
@@ -17,10 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
#define UNICODE
#include "ddeimp.hxx"
#include <algorithm>
+#include <memory>
#include <comphelper/string.hxx>
#include <rtl/ustring.hxx>
#include <svl/svdde.hxx>
@@ -111,9 +111,9 @@ HDDEDATA CALLBACK DdeInternal::SvrCallback(
if( !nTopics )
return nullptr;
- HSZPAIR* pPairs = new HSZPAIR [nTopics + 1];
+ auto pPairs = std::unique_ptr<HSZPAIR[]>(new HSZPAIR [nTopics + 1]);
- HSZPAIR* q = pPairs;
+ HSZPAIR* q = pPairs.get();
for (DdeServices::iterator aI = rAll.begin(); aI != rAll.end(); ++aI)
{
pService = *aI;
@@ -143,10 +143,10 @@ HDDEDATA CALLBACK DdeInternal::SvrCallback(
q->hszSvc = nullptr;
q->hszTopic = nullptr;
HDDEDATA h = DdeCreateDataHandle(
- pInst->hDdeInstSvr, reinterpret_cast<LPBYTE>(pPairs),
+ pInst->hDdeInstSvr,
+ reinterpret_cast<LPBYTE>(pPairs.get()),
sizeof(HSZPAIR) * (nTopics+1),
0, nullptr, nCbType, 0);
- delete [] pPairs;
return h;
}
More information about the Libreoffice-commits
mailing list