diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/PostItMgr.hxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/docvw/PostItMgr.cxx | 5 |
2 files changed, 3 insertions, 5 deletions
diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx index 1bb0ff09bf23..8e60929ca4b7 100644 --- a/sw/inc/PostItMgr.hxx +++ b/sw/inc/PostItMgr.hxx @@ -25,6 +25,7 @@ #include <cstddef> #include <list> +#include <memory> #include <vector> #include <editeng/outlobj.hxx> #include <rtl/ustring.hxx> @@ -163,7 +164,7 @@ class SwPostItMgr: public SfxListener bool mbIsShowAnchor; // data structure to collect the <SwAnnotationWin> instances for certain <SwFrame> instances. - sw::sidebarwindows::SwFrameSidebarWinContainer* mpFrameSidebarWinContainer; + std::unique_ptr<sw::sidebarwindows::SwFrameSidebarWinContainer> mpFrameSidebarWinContainer; void AddPostIts(bool bCheckExistence = true,bool bFocus = true); void RemoveSidebarWin(); diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index 8e39efa3726c..145659405482 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -238,9 +238,6 @@ SwPostItMgr::~SwPostItMgr() for (auto const& page : mPages) delete page; mPages.clear(); - - delete mpFrameSidebarWinContainer; - mpFrameSidebarWinContainer = nullptr; } void SwPostItMgr::CheckForRemovedPostIts() @@ -2313,7 +2310,7 @@ void SwPostItMgr::ConnectSidebarWinToFrame( const SwFrame& rFrame, { if ( mpFrameSidebarWinContainer == nullptr ) { - mpFrameSidebarWinContainer = new SwFrameSidebarWinContainer(); + mpFrameSidebarWinContainer.reset(new SwFrameSidebarWinContainer()); } const bool bInserted = mpFrameSidebarWinContainer->insert( rFrame, rFormatField, rSidebarWin ); |