Kaydet (Commit) 5da6e7d2 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in SfxShell_Impl

Change-Id: If59142c2d55da5f3ccf2de101dbd9f18a8bda84c
Reviewed-on: https://gerrit.libreoffice.org/48701Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 85b3c799
...@@ -62,8 +62,8 @@ struct SfxShell_Impl: public SfxBroadcaster ...@@ -62,8 +62,8 @@ struct SfxShell_Impl: public SfxBroadcaster
SfxRepeatTarget* pRepeatTarget; // SbxObjectRef xParent; SfxRepeatTarget* pRepeatTarget; // SbxObjectRef xParent;
bool bActive; bool bActive;
SfxDisableFlags nDisableFlags; SfxDisableFlags nDisableFlags;
svtools::AsynchronLink* pExecuter; std::unique_ptr<svtools::AsynchronLink> pExecuter;
svtools::AsynchronLink* pUpdater; std::unique_ptr<svtools::AsynchronLink> pUpdater;
std::vector<std::unique_ptr<SfxSlot> > aSlotArr; std::vector<std::unique_ptr<SfxSlot> > aSlotArr;
css::uno::Sequence < css::embed::VerbDescriptor > aVerbList; css::uno::Sequence < css::embed::VerbDescriptor > aVerbList;
...@@ -80,7 +80,7 @@ struct SfxShell_Impl: public SfxBroadcaster ...@@ -80,7 +80,7 @@ struct SfxShell_Impl: public SfxBroadcaster
{ {
} }
virtual ~SfxShell_Impl() override { delete pExecuter; delete pUpdater;} virtual ~SfxShell_Impl() override { pExecuter.reset(); pUpdater.reset();}
}; };
...@@ -400,8 +400,8 @@ void SfxShell::ExecuteSlot( SfxRequest& rReq, bool bAsync ) ...@@ -400,8 +400,8 @@ void SfxShell::ExecuteSlot( SfxRequest& rReq, bool bAsync )
else else
{ {
if( !pImpl->pExecuter ) if( !pImpl->pExecuter )
pImpl->pExecuter = new svtools::AsynchronLink( pImpl->pExecuter.reset( new svtools::AsynchronLink(
Link<void*,void>( this, ShellCall_Impl ) ); Link<void*,void>( this, ShellCall_Impl ) ) );
pImpl->pExecuter->Call( new SfxRequest( rReq ) ); pImpl->pExecuter->Call( new SfxRequest( rReq ) );
} }
} }
...@@ -654,7 +654,7 @@ void SfxShell::UIFeatureChanged() ...@@ -654,7 +654,7 @@ void SfxShell::UIFeatureChanged()
// something my get stuck in the bunkered tools. Asynchronous call to // something my get stuck in the bunkered tools. Asynchronous call to
// prevent recursion. // prevent recursion.
if ( !pImpl->pUpdater ) if ( !pImpl->pUpdater )
pImpl->pUpdater = new svtools::AsynchronLink( Link<void*,void>( this, DispatcherUpdate_Impl ) ); pImpl->pUpdater.reset( new svtools::AsynchronLink( Link<void*,void>( this, DispatcherUpdate_Impl ) ) );
// Multiple views allowed // Multiple views allowed
pImpl->pUpdater->Call( pFrame->GetDispatcher(), true ); pImpl->pUpdater->Call( pFrame->GetDispatcher(), true );
......
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