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

loplugin:useuniqueptr in SwGlobalTree

Change-Id: I3499860f02e8fcdd5177f66cb648f7bdb12e4f6e
Reviewed-on: https://gerrit.libreoffice.org/58012
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 0e714e41
......@@ -265,10 +265,10 @@ private:
SwWrtShell* m_pActiveShell;
SvTreeListEntry* m_pEmphasisEntry; // Drag'n Drop emphasis
SvTreeListEntry* m_pDDSource; // source for Drag'n Drop
SwGlblDocContents* m_pSwGlblDocContents; // array with sorted content
std::unique_ptr<SwGlblDocContents> m_pSwGlblDocContents; // array with sorted content
SwGlblDocContent* m_pDocContent;
sfx2::DocumentInserter* m_pDocInserter;
std::unique_ptr<sfx2::DocumentInserter> m_pDocInserter;
bool m_bIsInternalDrag :1;
bool m_bLastEntryEmphasis :1; // Drag'n Drop
......
......@@ -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);
}
......
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