diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-15 10:54:44 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-15 14:21:31 +0100 |
commit | a98465920f0c82759d3e74b437c4fb4dd9f2c4c6 (patch) | |
tree | ee74aefd790b7f586010ea65314bde6ead1a3694 /sd/source/ui/docshell | |
parent | 509c69a9936f6af051f4888bbc88b7f2678783b3 (diff) |
loplugin:useuniqueptr in SdModule
Change-Id: I3b79696f06b33703cf61b73867014e4fd86ee9c7
Reviewed-on: https://gerrit.libreoffice.org/51313
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui/docshell')
-rw-r--r-- | sd/source/ui/docshell/docshel3.cxx | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx index e65d0729b009..c49841bcb969 100644 --- a/sd/source/ui/docshell/docshel3.cxx +++ b/sd/source/ui/docshell/docshel3.cxx @@ -147,11 +147,7 @@ void DrawDocShell::Execute( SfxRequest& rReq ) { const SvxSearchItem* pSearchItem = static_cast<const SvxSearchItem*>( &pReqArgs->Get(SID_SEARCH_ITEM) ); - // would be nice to have an assign operation at SearchItem - SvxSearchItem* pAppSearchItem = SD_MOD()->GetSearchItem(); - delete pAppSearchItem; - pAppSearchItem = static_cast<SvxSearchItem*>( pSearchItem->Clone() ); - SD_MOD()->SetSearchItem(pAppSearchItem); + SD_MOD()->SetSearchItem(std::unique_ptr<SvxSearchItem>(static_cast<SvxSearchItem*>(pSearchItem->Clone()))); } rReq.Done(); @@ -215,11 +211,7 @@ void DrawDocShell::Execute( SfxRequest& rReq ) const SvxSearchItem* pSearchItem = static_cast<const SvxSearchItem*>( &pReqArgs->Get(SID_SEARCH_ITEM) ); - // would be nice to have an assign operation at SearchItem - SvxSearchItem* pAppSearchItem = SD_MOD()->GetSearchItem(); - delete pAppSearchItem; - pAppSearchItem = static_cast<SvxSearchItem*>( pSearchItem->Clone() ); - SD_MOD()->SetSearchItem(pAppSearchItem); + SD_MOD()->SetSearchItem(std::unique_ptr<SvxSearchItem>(static_cast<SvxSearchItem*>( pSearchItem->Clone() ))); xFuSearch->SearchAndReplace(pSearchItem); } } |