summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-13 13:11:19 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-13 13:26:05 +0100
commit2d4988070b06567ce145403294dd402ac0f996d5 (patch)
treef799d29f3907bf5f79e2f196387da505547e311e
parentebd9a6a6521859a465dbbe134e75ead45e1383c1 (diff)
loplugin:useuniqueptr in SdDrawDocument
Change-Id: Ia207c25b091923738811aad4f367a76e9e026283 Reviewed-on: https://gerrit.libreoffice.org/51207 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sd/inc/drawdoc.hxx4
-rw-r--r--sd/source/core/drawdoc.cxx6
-rw-r--r--sd/source/core/drawdoc2.cxx5
-rw-r--r--sd/source/core/drawdoc3.cxx4
4 files changed, 8 insertions, 11 deletions
diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index 1b6425dc795c..5ddb69a9b451 100644
--- a/sd/inc/drawdoc.hxx
+++ b/sd/inc/drawdoc.hxx
@@ -142,14 +142,14 @@ private:
mpOutliner; ///< local outliner for outline mode
std::unique_ptr<SdOutliner>
mpInternalOutliner; ///< internal outliner for creation of text objects
- Timer* mpWorkStartupTimer;
+ std::unique_ptr<Timer> mpWorkStartupTimer;
Idle* mpOnlineSpellingIdle;
sd::ShapeList* mpOnlineSpellingList;
std::unique_ptr<SvxSearchItem>
mpOnlineSearchItem;
std::vector<std::unique_ptr<sd::FrameView>>
maFrameViewList;
- SdCustomShowList* mpCustomShowList;
+ std::unique_ptr<SdCustomShowList> mpCustomShowList;
::sd::DrawDocShell* mpDocSh;
SdTransferable * mpCreatingTransferable;
bool mbHasOnlineSpellErrors;
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index d0f6506804ac..d6335e3671d3 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -351,8 +351,7 @@ SdDrawDocument::~SdDrawDocument()
if ( mpWorkStartupTimer->IsActive() )
mpWorkStartupTimer->Stop();
- delete mpWorkStartupTimer;
- mpWorkStartupTimer = nullptr;
+ mpWorkStartupTimer.reset();
}
StopOnlineSpelling();
@@ -386,8 +385,7 @@ SdDrawDocument::~SdDrawDocument()
delete pCustomShow;
}
- delete mpCustomShowList;
- mpCustomShowList = nullptr;
+ mpCustomShowList.reset();
}
mpOutliner.reset();
diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index 3da22f3dfb3b..0652a9aa812d 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -681,7 +681,7 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument const * pRefDocument /* =
if( !pRefPage && (meDocType != DocumentType::Draw) )
pPage->SetAutoLayout( AUTOLAYOUT_TITLE, true, true );
- mpWorkStartupTimer = new Timer("DrawWorkStartupTimer");
+ mpWorkStartupTimer.reset( new Timer("DrawWorkStartupTimer") );
mpWorkStartupTimer->SetInvokeHandler( LINK(this, SdDrawDocument, WorkStartupHdl) );
mpWorkStartupTimer->SetTimeout(2000);
mpWorkStartupTimer->Start();
@@ -968,8 +968,7 @@ void SdDrawDocument::StopWorkStartupDelay()
WorkStartupHdl(nullptr);
}
- delete mpWorkStartupTimer;
- mpWorkStartupTimer = nullptr;
+ mpWorkStartupTimer.reset();
}
}
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index bd731f255465..5df4c3d2b930 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -1181,10 +1181,10 @@ SdCustomShowList* SdDrawDocument::GetCustomShowList(bool bCreate)
{
if (!mpCustomShowList && bCreate)
{
- mpCustomShowList = new SdCustomShowList;
+ mpCustomShowList.reset(new SdCustomShowList);
}
- return mpCustomShowList;
+ return mpCustomShowList.get();
}
// Remove unused master pages and layouts