summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/uibase/inc/navipi.hxx3
-rw-r--r--sw/source/uibase/utlui/navipi.cxx6
2 files changed, 5 insertions, 4 deletions
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") );