summaryrefslogtreecommitdiff
path: root/sw/source/uibase/utlui/glbltree.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-25 12:04:39 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-26 08:33:11 +0200
commit78e940247fbf576c7e6e4ae8d62dc3531bba21fe (patch)
tree01b9affa585ec9d26ce423a110c9539b26c4197b /sw/source/uibase/utlui/glbltree.cxx
parent0e714e412c9831e4cd710fd9d250615bf3e1547c (diff)
loplugin:useuniqueptr in SwGlobalTree
Change-Id: I3499860f02e8fcdd5177f66cb648f7bdb12e4f6e Reviewed-on: https://gerrit.libreoffice.org/58012 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase/utlui/glbltree.cxx')
-rw-r--r--sw/source/uibase/utlui/glbltree.cxx16
1 files changed, 5 insertions, 11 deletions
diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx
index d1f4025f5b8b..13cc616041fe 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -174,9 +174,7 @@ SwGlobalTree::SwGlobalTree(vcl::Window* pParent, SwNavigationPI* pDialog)
, m_pActiveShell(nullptr)
, m_pEmphasisEntry(nullptr)
, m_pDDSource(nullptr)
- , m_pSwGlblDocContents(nullptr)
, m_pDocContent(nullptr)
- , m_pDocInserter(nullptr)
, m_bIsInternalDrag(false)
, m_bLastEntryEmphasis(false)
{
@@ -204,10 +202,8 @@ SwGlobalTree::~SwGlobalTree()
void SwGlobalTree::dispose()
{
- delete m_pSwGlblDocContents;
- m_pSwGlblDocContents = nullptr;
- delete m_pDocInserter;
- m_pDocInserter = nullptr;
+ m_pSwGlblDocContents.reset();
+ m_pDocInserter.reset();
m_aUpdateTimer.Stop();
m_xDialog.clear();
SvTreeListBox::dispose();
@@ -740,8 +736,7 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* pCont, const OUString*
Sequence< OUString > aFileNames;
if ( !pFileName )
{
- delete m_pDocInserter;
- m_pDocInserter = new ::sfx2::DocumentInserter(GetFrameWeld(), "swriter", sfx2::DocumentInserter::Mode::InsertMulti);
+ m_pDocInserter.reset(new ::sfx2::DocumentInserter(GetFrameWeld(), "swriter", sfx2::DocumentInserter::Mode::InsertMulti));
m_pDocInserter->StartExecuteModal( LINK( this, SwGlobalTree, DialogClosedHdl ) );
}
else if ( !pFileName->isEmpty() )
@@ -1112,12 +1107,11 @@ bool SwGlobalTree::Update(bool bHard)
m_pActiveShell = pActView->GetWrtShellPtr();
if(m_pActiveShell != pOldShell)
{
- delete m_pSwGlblDocContents;
- m_pSwGlblDocContents = nullptr;
+ m_pSwGlblDocContents.reset();
}
if(!m_pSwGlblDocContents)
{
- m_pSwGlblDocContents = new SwGlblDocContents;
+ m_pSwGlblDocContents.reset(new SwGlblDocContents);
bRet = true;
m_pActiveShell->GetGlobalDocContent(*m_pSwGlblDocContents);
}