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

loplugin:useuniqueptr in ScProgress

Change-Id: I92d3c3c52b5735de915db1a208cb7c0d68b4c7a0
Reviewed-on: https://gerrit.libreoffice.org/52342Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 9d037cb8
......@@ -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;
......
......@@ -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;
......
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