summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-02 09:54:39 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-03 08:16:36 +0200
commitb82d6a3ddc1e70c2f61b8f8fdbfeb9345206472f (patch)
tree191acd15eeb0f4b9a0fa95403b3c1af40c1dcb3c /svtools
parent904c97bbdf4c76709dbcacb11292668b98a9efd8 (diff)
return by std::unique_ptr from CreateViewData
Change-Id: I83572646fb2ebe8afe8cff581e574375798e74f7 Reviewed-on: https://gerrit.libreoffice.org/56818 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/contnr/treelist.cxx7
-rw-r--r--svtools/source/contnr/treelistbox.cxx5
2 files changed, 6 insertions, 6 deletions
diff --git a/svtools/source/contnr/treelist.cxx b/svtools/source/contnr/treelist.cxx
index e4d66eec25e0..e20e571f2d4a 100644
--- a/svtools/source/contnr/treelist.cxx
+++ b/svtools/source/contnr/treelist.cxx
@@ -21,6 +21,7 @@
#include <svtools/treelistentry.hxx>
#include <svtools/viewdataentry.hxx>
#include <osl/diagnose.h>
+#include <o3tl/make_unique.hxx>
#include <memory>
#include <map>
@@ -1139,7 +1140,7 @@ void SvListView::Impl::InitTable()
pEntry = m_rThis.pModel->First();
while( pEntry )
{
- pViewData.reset(m_rThis.CreateViewData( pEntry ));
+ pViewData = m_rThis.CreateViewData( pEntry );
DBG_ASSERT(pViewData,"InitTable:No ViewData");
m_rThis.InitViewData( pViewData.get(), pEntry );
m_DataTable.insert(std::make_pair(pEntry, std::move(pViewData)));
@@ -1147,9 +1148,9 @@ void SvListView::Impl::InitTable()
}
}
-SvViewDataEntry* SvListView::CreateViewData( SvTreeListEntry* )
+std::unique_ptr<SvViewDataEntry> SvListView::CreateViewData( SvTreeListEntry* )
{
- return new SvViewDataEntry;
+ return o3tl::make_unique<SvViewDataEntry>();
}
void SvListView::Clear()
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index 8338033e2263..5d9bc907ae24 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -810,10 +810,9 @@ const SvViewDataItem* SvTreeListBox::GetViewDataItem(const SvTreeListEntry* pEnt
return &pEntryData->GetItem(nItemPos);
}
-SvViewDataEntry* SvTreeListBox::CreateViewData( SvTreeListEntry* )
+std::unique_ptr<SvViewDataEntry> SvTreeListBox::CreateViewData( SvTreeListEntry* )
{
- SvViewDataEntry* pEntryData = new SvViewDataEntry;
- return pEntryData;
+ return o3tl::make_unique<SvViewDataEntry>();
}
void SvTreeListBox::InitViewData( SvViewDataEntry* pData, SvTreeListEntry* pEntry )