summaryrefslogtreecommitdiff
path: root/ucb/source/ucp/webdav-neon/LockEntrySequence.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-19 09:09:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-20 06:56:32 +0000
commit84defbc556c17aa58851fd14f8af0deaa3cc6e05 (patch)
tree8eb1b3dceea8ca8b6d2e62b3c20c8d121deb8a9e /ucb/source/ucp/webdav-neon/LockEntrySequence.cxx
parent3bb8bdb93f1546f64ff3f183d6162c41a03856bf (diff)
new loplugin: useuniqueptr: ucb..ucbhelper
Change-Id: Ib19ca3225b96d1bfec8a43bb762e16597f33b690 Reviewed-on: https://gerrit.libreoffice.org/33297 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb/source/ucp/webdav-neon/LockEntrySequence.cxx')
-rw-r--r--ucb/source/ucp/webdav-neon/LockEntrySequence.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/ucb/source/ucp/webdav-neon/LockEntrySequence.cxx b/ucb/source/ucp/webdav-neon/LockEntrySequence.cxx
index d27f6b212924..7d3a839d5eec 100644
--- a/ucb/source/ucp/webdav-neon/LockEntrySequence.cxx
+++ b/ucb/source/ucp/webdav-neon/LockEntrySequence.cxx
@@ -30,6 +30,7 @@
#include <string.h>
#include <ne_xml.h>
#include "LockEntrySequence.hxx"
+#include <memory>
using namespace webdav_ucp;
using namespace com::sun::star;
@@ -37,13 +38,13 @@ using namespace com::sun::star;
struct LockEntrySequenceParseContext
{
- ucb::LockEntry * pEntry;
+ std::unique_ptr<ucb::LockEntry> pEntry;
bool hasScope;
bool hasType;
LockEntrySequenceParseContext()
: pEntry( nullptr ), hasScope( false ), hasType( false ) {}
- ~LockEntrySequenceParseContext() { delete pEntry; }
+ ~LockEntrySequenceParseContext() { }
};
#define STATE_TOP (1)
@@ -140,7 +141,7 @@ extern "C" int LockEntrySequence_endelement_callback(
LockEntrySequenceParseContext * pCtx
= static_cast< LockEntrySequenceParseContext * >( userdata );
if ( !pCtx->pEntry )
- pCtx->pEntry = new ucb::LockEntry;
+ pCtx->pEntry.reset( new ucb::LockEntry );
switch ( state )
{