[Libreoffice-commits] core.git: sw/source
Noel Grandin
noel.grandin at collabora.co.uk
Thu Dec 14 08:40:08 UTC 2017
sw/source/uibase/inc/navipi.hxx | 3 ++-
sw/source/uibase/utlui/navipi.cxx | 6 +++---
2 files changed, 5 insertions(+), 4 deletions(-)
New commits:
commit 9f713bd753afd7b0ed8c16a17dc22755b5862d36
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Wed Dec 13 15:49:39 2017 +0200
DELETEZ->std::unique_ptr in SwNavigationPI
Change-Id: Ie8990e2efd43cc9ad5cd7e6d71514dffcc3ade49
Reviewed-on: https://gerrit.libreoffice.org/46398
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sw/source/uibase/inc/navipi.hxx b/sw/source/uibase/inc/navipi.hxx
index 8dd55101fc1e..db1b8714b782 100644
--- a/sw/source/uibase/inc/navipi.hxx
+++ b/sw/source/uibase/inc/navipi.hxx
@@ -30,6 +30,7 @@
#include <svx/sidebar/PanelLayout.hxx>
#include "conttree.hxx"
#include <ndarr.hxx>
+#include <memory>
class SwWrtShell;
class SwNavigationPI;
@@ -78,7 +79,7 @@ class SwNavigationPI : public PanelLayout,
OUString m_aContextArr[3];
OUString m_aStatusArr[4];
- SfxObjectShellLock *m_pxObjectShell;
+ std::unique_ptr<SfxObjectShellLock> m_pxObjectShell;
SwView *m_pContentView;
SwWrtShell *m_pContentWrtShell;
SwView *m_pActContView;
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index 47d261547c6e..c98dba2dafb1 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -772,7 +772,7 @@ void SwNavigationPI::dispose()
{
if (m_pxObjectShell->Is())
(*m_pxObjectShell)->DoClose();
- delete m_pxObjectShell;
+ m_pxObjectShell.reset();
}
if (IsBound())
@@ -1019,7 +1019,7 @@ IMPL_LINK(SwNavigationPI, DoneLink, SfxPoolItem *, pItem, void)
m_pContentWrtShell = m_pContentView->GetWrtShellPtr();
else
m_pContentWrtShell = nullptr;
- m_pxObjectShell = new SfxObjectShellLock(pFrame->GetObjectShell());
+ m_pxObjectShell.reset( new SfxObjectShellLock(pFrame->GetObjectShell()) );
FillBox();
m_aContentTree->Update();
}
@@ -1102,7 +1102,7 @@ sal_Int8 SwNavigationPI::ExecuteDrop( const ExecuteDropEvent& rEvt )
{
m_aContentTree->SetHiddenShell( nullptr );
(*m_pxObjectShell)->DoClose();
- DELETEZ( m_pxObjectShell);
+ m_pxObjectShell.reset();
}
SfxStringItem aFileItem(SID_FILE_NAME, sFileName );
SfxStringItem aOptionsItem( SID_OPTIONS, OUString("HRC") );
More information about the Libreoffice-commits
mailing list