summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-11-16 11:05:11 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-11-17 08:11:00 +0100
commit49e1d1f0482969520f8ac64d5ff5fbba5f7c00bf (patch)
tree1ae7bd828be7a52beda6a68f6e3867c75e7dbbf5 /sw
parenta9f6478561a65b97f28de2ee3a428a3f99e87f16 (diff)
loplugin:useuniqueptr in SwPostItMgr
Change-Id: I567ec14112ee8d5224c19c7616fd8ed06619c228 Reviewed-on: https://gerrit.libreoffice.org/44822 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/PostItMgr.hxx3
-rw-r--r--sw/source/uibase/docvw/PostItMgr.cxx5
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 );