diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-14 14:36:52 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-17 07:23:22 +0200 |
commit | db3860062ebf4109f48139c2556ff4041aff5d6e (patch) | |
tree | b6ab4df909c8922e48a9c4eefa9a8f0f6a47c41f /ucb/source | |
parent | 846f557fd591626931a9dadb38180786e090104c (diff) |
extend loplugin useuniqueptr to OUString pointers
Change-Id: Ieb5bab3895e1edaff497c4a1a88303ccac097edc
Reviewed-on: https://gerrit.libreoffice.org/39948
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb/source')
-rw-r--r-- | ucb/source/ucp/webdav-neon/UCBDeadPropertyValue.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/ucb/source/ucp/webdav-neon/UCBDeadPropertyValue.cxx b/ucb/source/ucp/webdav-neon/UCBDeadPropertyValue.cxx index 85e6ab1794c5..29891c3afddb 100644 --- a/ucb/source/ucp/webdav-neon/UCBDeadPropertyValue.cxx +++ b/ucb/source/ucp/webdav-neon/UCBDeadPropertyValue.cxx @@ -31,6 +31,7 @@ #include <ne_xml.h> #include <rtl/ustrbuf.hxx> #include "UCBDeadPropertyValue.hxx" +#include <memory> using namespace webdav_ucp; using namespace com::sun::star; @@ -38,11 +39,10 @@ using namespace com::sun::star; struct UCBDeadPropertyValueParseContext { - OUString * pType; - OUString * pValue; + std::unique_ptr<OUString> pType; + std::unique_ptr<OUString> pValue; - UCBDeadPropertyValueParseContext() : pType( nullptr ), pValue( nullptr ) {} - ~UCBDeadPropertyValueParseContext() { delete pType; delete pValue; } + UCBDeadPropertyValueParseContext() {} }; static const char aTypeString[] = "string"; @@ -110,16 +110,14 @@ extern "C" int UCBDeadPropertyValue_chardata_callback( assert( !pCtx->pType && "UCBDeadPropertyValue_endelement_callback - " "Type already set!" ); - pCtx->pType - = new OUString( buf, len, RTL_TEXTENCODING_ASCII_US ); + pCtx->pType.reset( new OUString( buf, len, RTL_TEXTENCODING_ASCII_US ) ); break; case STATE_VALUE: assert( !pCtx->pValue && "UCBDeadPropertyValue_endelement_callback - " "Value already set!" ); - pCtx->pValue - = new OUString( buf, len, RTL_TEXTENCODING_ASCII_US ); + pCtx->pValue.reset( new OUString( buf, len, RTL_TEXTENCODING_ASCII_US ) ); break; } return 0; // zero to continue, non-zero to abort parsing |