summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-03 14:31:11 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-04 08:30:15 +0200
commita9d6a2584fcd36fd9e91b7339b38cc6bd524361a (patch)
tree9831f5f0e2c2655ea9ca78bcb0806215280822af /sc
parent9d037cb837d74708358168333a0b457952de23a6 (diff)
loplugin:useuniqueptr in ScProgress
Change-Id: I92d3c3c52b5735de915db1a208cb7c0d68b4c7a0 Reviewed-on: https://gerrit.libreoffice.org/52342 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/progress.hxx2
-rw-r--r--sc/source/core/tool/progress.cxx6
2 files changed, 4 insertions, 4 deletions
diff --git a/sc/inc/progress.hxx b/sc/inc/progress.hxx
index 89fe38a40340..68cda2341bfb 100644
--- a/sc/inc/progress.hxx
+++ b/sc/inc/progress.hxx
@@ -50,7 +50,7 @@ private:
static bool bIdleWasEnabled;
bool bEnabled;
- SfxProgress* pProgress;
+ std::unique_ptr<SfxProgress> pProgress;
ScProgress( const ScProgress& ) = delete;
ScProgress& operator=( const ScProgress& ) = delete;
diff --git a/sc/source/core/tool/progress.cxx b/sc/source/core/tool/progress.cxx
index b6b09e98bacb..12ac9d857d90 100644
--- a/sc/source/core/tool/progress.cxx
+++ b/sc/source/core/tool/progress.cxx
@@ -106,8 +106,8 @@ ScProgress::ScProgress(SfxObjectShell* pObjSh, const OUString& rText,
}
else
{
- pProgress = new SfxProgress( pObjSh, rText, nRange, bWait );
- pGlobalProgress = pProgress;
+ pProgress.reset(new SfxProgress( pObjSh, rText, nRange, bWait ));
+ pGlobalProgress = pProgress.get();
nGlobalRange = nRange;
nGlobalPercent = 0;
}
@@ -124,7 +124,7 @@ ScProgress::~ScProgress()
{
if ( pProgress )
{
- delete pProgress;
+ pProgress.reset();
pGlobalProgress = nullptr;
nGlobalRange = 0;
nGlobalPercent = 0;