diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-11 15:59:50 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-12 13:06:37 +0200 |
commit | c5a9da1e47dffcf7c15229612bcdd48d7491ce3d (patch) | |
tree | 91d997b4c0dc96bde2f22b9b20fc808ee4dff443 /sw | |
parent | 7ee808ba894db274a474febe39ace46deebf8896 (diff) |
loplugin:useuniqueptr in SwPaM::DoSearch
Change-Id: Ifcef51cc6b7168915076198bcd70dbf02883dc79
Reviewed-on: https://gerrit.libreoffice.org/60356
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/crsr/findtxt.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index 8d97635b4b93..243699f5de91 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -516,13 +516,13 @@ bool SwPaM::DoSearch( const i18nutil::SearchOptions2& rSearchOpt, utl::TextSearc sCleanStr = lcl_CleanStr(*pNode->GetTextNode(), nEnd, nStart, aFltArr, bRemoveSoftHyphens, bRemoveCommentAnchors); - SwScriptIterator* pScriptIter = nullptr; + std::unique_ptr<SwScriptIterator> pScriptIter; sal_uInt16 nSearchScript = 0; sal_uInt16 nCurrScript = 0; if (SearchAlgorithms2::APPROXIMATE == rSearchOpt.AlgorithmType2) { - pScriptIter = new SwScriptIterator( sCleanStr, nStart, bSrchForward ); + pScriptIter.reset(new SwScriptIterator( sCleanStr, nStart, bSrchForward )); nSearchScript = g_pBreakIt->GetRealScriptOfText( rSearchOpt.searchString, 0 ); } @@ -606,7 +606,7 @@ bool SwPaM::DoSearch( const i18nutil::SearchOptions2& rSearchOpt, utl::TextSearc nStart = nEnd; } - delete pScriptIter; + pScriptIter.reset(); if ( bFound ) return true; |