diff options
author | Aleksas Pantechovskis <alex.pantec@gmail.com> | 2016-03-09 14:27:10 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-03-10 08:03:17 +0000 |
commit | 50336412f775af154509d67b1ebbdb4b5feb147b (patch) | |
tree | eadb37cfda36b5cffa571800a9baf8e69780ef87 /svtools | |
parent | 3a8844752c22e18d27aa310ae859f8cb660865b9 (diff) |
tdf#89329 Use std::unique_ptr for pImpl in svparser
Change-Id: Ia791bade1a1f9d27a48994f8bb380ffec50e23bb
Reviewed-on: https://gerrit.libreoffice.org/23072
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/svrtf/svparser.cxx | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/svtools/source/svrtf/svparser.cxx b/svtools/source/svrtf/svparser.cxx index 33504923a684..a17ca8a8fc66 100644 --- a/svtools/source/svrtf/svparser.cxx +++ b/svtools/source/svrtf/svparser.cxx @@ -94,8 +94,6 @@ SvParser::~SvParser() rtl_destroyTextToUnicodeConverter( pImplData->hConv ); } - delete pImplData; - delete [] pTokenStack; } @@ -124,7 +122,7 @@ void SvParser::SetSrcEncoding( rtl_TextEncoding eEnc ) { eSrcEnc = eEnc; if( !pImplData ) - pImplData = new SvParser_Impl; + pImplData.reset(new SvParser_Impl); pImplData->hConv = rtl_createTextToUnicodeConverter( eSrcEnc ); DBG_ASSERT( pImplData->hConv, "SvParser::SetSrcEncoding: no converter for source encoding" ); @@ -523,7 +521,7 @@ void SvParser::SaveState( int nToken ) // save actual status if( !pImplData ) { - pImplData = new SvParser_Impl; + pImplData.reset(new SvParser_Impl); pImplData->nSaveToken = 0; } @@ -672,10 +670,7 @@ struct SvKeyValueIterator::Impl SvKeyValueIterator::SvKeyValueIterator() : mpImpl(new Impl) {} -SvKeyValueIterator::~SvKeyValueIterator() -{ - delete mpImpl; -} +SvKeyValueIterator::~SvKeyValueIterator() = default; bool SvKeyValueIterator::GetFirst (SvKeyValue &rKeyVal) { |