Kaydet (Commit) 49e1d1f0 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in SwPostItMgr

Change-Id: I567ec14112ee8d5224c19c7616fd8ed06619c228
Reviewed-on: https://gerrit.libreoffice.org/44822Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst a9f64785
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <cstddef> #include <cstddef>
#include <list> #include <list>
#include <memory>
#include <vector> #include <vector>
#include <editeng/outlobj.hxx> #include <editeng/outlobj.hxx>
#include <rtl/ustring.hxx> #include <rtl/ustring.hxx>
...@@ -163,7 +164,7 @@ class SwPostItMgr: public SfxListener ...@@ -163,7 +164,7 @@ class SwPostItMgr: public SfxListener
bool mbIsShowAnchor; bool mbIsShowAnchor;
// data structure to collect the <SwAnnotationWin> instances for certain <SwFrame> instances. // 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 AddPostIts(bool bCheckExistence = true,bool bFocus = true);
void RemoveSidebarWin(); void RemoveSidebarWin();
......
...@@ -238,9 +238,6 @@ SwPostItMgr::~SwPostItMgr() ...@@ -238,9 +238,6 @@ SwPostItMgr::~SwPostItMgr()
for (auto const& page : mPages) for (auto const& page : mPages)
delete page; delete page;
mPages.clear(); mPages.clear();
delete mpFrameSidebarWinContainer;
mpFrameSidebarWinContainer = nullptr;
} }
void SwPostItMgr::CheckForRemovedPostIts() void SwPostItMgr::CheckForRemovedPostIts()
...@@ -2313,7 +2310,7 @@ void SwPostItMgr::ConnectSidebarWinToFrame( const SwFrame& rFrame, ...@@ -2313,7 +2310,7 @@ void SwPostItMgr::ConnectSidebarWinToFrame( const SwFrame& rFrame,
{ {
if ( mpFrameSidebarWinContainer == nullptr ) if ( mpFrameSidebarWinContainer == nullptr )
{ {
mpFrameSidebarWinContainer = new SwFrameSidebarWinContainer(); mpFrameSidebarWinContainer.reset(new SwFrameSidebarWinContainer());
} }
const bool bInserted = mpFrameSidebarWinContainer->insert( rFrame, rFormatField, rSidebarWin ); const bool bInserted = mpFrameSidebarWinContainer->insert( rFrame, rFormatField, rSidebarWin );
......
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