Kaydet (Commit) 07d0c305 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in SwImplShellAction

Change-Id: Iab0844b8ad5bbe57c4f1fb5a706bc742abf4cdb5
Reviewed-on: https://gerrit.libreoffice.org/57868
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst c92d89b4
...@@ -92,7 +92,7 @@ using namespace com::sun::star; ...@@ -92,7 +92,7 @@ using namespace com::sun::star;
class SwImplShellAction class SwImplShellAction
{ {
SwWrtShell* pSh; SwWrtShell* pSh;
CurrShell* pCurrSh; std::unique_ptr<CurrShell> pCurrSh;
public: public:
explicit SwImplShellAction( SwDoc& rDoc ); explicit SwImplShellAction( SwDoc& rDoc );
~SwImplShellAction() COVERITY_NOEXCEPT_FALSE; ~SwImplShellAction() COVERITY_NOEXCEPT_FALSE;
...@@ -110,7 +110,7 @@ SwImplShellAction::SwImplShellAction( SwDoc& rDoc ) ...@@ -110,7 +110,7 @@ SwImplShellAction::SwImplShellAction( SwDoc& rDoc )
if( pSh ) if( pSh )
{ {
pCurrSh = new CurrShell( pSh ); pCurrSh.reset( new CurrShell( pSh ) );
pSh->StartAllAction(); pSh->StartAllAction();
} }
} }
...@@ -120,7 +120,7 @@ SwImplShellAction::~SwImplShellAction() COVERITY_NOEXCEPT_FALSE ...@@ -120,7 +120,7 @@ SwImplShellAction::~SwImplShellAction() COVERITY_NOEXCEPT_FALSE
if( pCurrSh ) if( pCurrSh )
{ {
pSh->EndAllAction(); pSh->EndAllAction();
delete pCurrSh; pCurrSh.reset();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment