diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-27 14:18:28 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-28 08:34:00 +0200 |
commit | e53ed47e9d9eb8bde2054943db8655ec12ace128 (patch) | |
tree | 86b291348a5d26b3eed140b6b1846309b7f16917 /sc/source/ui/docshell/docsh5.cxx | |
parent | 9954df6905804fb2bd72072a7e44145508b86a8d (diff) |
loplugin:useuniqueptr in ScUndoDBData
Change-Id: I6107079f8474a2ddc76a9cb6e93552d95861dc6c
Reviewed-on: https://gerrit.libreoffice.org/56563
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/docshell/docsh5.cxx')
-rw-r--r-- | sc/source/ui/docshell/docsh5.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx index 06fe4e22c7ba..5a7734749b5a 100644 --- a/sc/source/ui/docshell/docsh5.cxx +++ b/sc/source/ui/docshell/docsh5.cxx @@ -55,6 +55,7 @@ #include <clipparam.hxx> #include <rowheightcontext.hxx> #include <refupdatecontext.hxx> +#include <o3tl/make_unique.hxx> using com::sun::star::script::XLibraryContainer; using com::sun::star::script::vba::XVBACompatibility; @@ -286,12 +287,12 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe } else { - ScDBCollection* pUndoColl = nullptr; + std::unique_ptr<ScDBCollection> pUndoColl; if (eMode==SC_DB_IMPORT) { m_aDocument.PreprocessDBDataUpdate(); - pUndoColl = new ScDBCollection( *pColl ); // Undo for import range + pUndoColl.reset( new ScDBCollection( *pColl ) ); // Undo for import range OUString aImport = ScResId( STR_DBNAME_IMPORT ); long nCount = 0; @@ -323,8 +324,9 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe { m_aDocument.CompileHybridFormula(); - ScDBCollection* pRedoColl = new ScDBCollection( *pColl ); - GetUndoManager()->AddUndoAction( new ScUndoDBData( this, pUndoColl, pRedoColl ) ); + GetUndoManager()->AddUndoAction( new ScUndoDBData( this, + std::move(pUndoColl), + o3tl::make_unique<ScDBCollection>( *pColl ) ) ); } // no longer needed to register new range at the Sba |