diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-07-20 17:33:40 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-07-20 22:43:27 +0200 |
commit | 1fc105cec523a081f18ca78fff43e58e3a881232 (patch) | |
tree | 6e6030e44e51668f55c6977131733c25129601a0 /sfx2 | |
parent | 63de1888f67dc43c30d5a102651b7c2738243efb (diff) |
svtools: change these SvTreeListEntry functions to unique_ptr
... parameters to make it clear that they take ownership.
Change-Id: I572c5fa6268438a86d0a4fa1d2aef15382cb5607
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/templdlg.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index c0d53ad9a26c..608a573a6a6c 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -643,8 +643,9 @@ SvTreeListEntry* FillBox_Impl(SvTreeListBox* pBox, if (officecfg::Office::Common::StylesAndFormatting::Preview::get()) { - StyleLBoxString* pStyleLBoxString = new StyleLBoxString(pTreeListEntry, 0, pEntry->getName(), eStyleFamily); - pTreeListEntry->ReplaceItem(pStyleLBoxString, 1); + std::unique_ptr<StyleLBoxString> pStyleLBoxString( + new StyleLBoxString(pTreeListEntry, 0, pEntry->getName(), eStyleFamily)); + pTreeListEntry->ReplaceItem(std::move(pStyleLBoxString), 1); } pBox->GetModel()->InvalidateEntry(pTreeListEntry); @@ -1263,8 +1264,9 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags) SvTreeListEntry* pTreeListEntry = aFmtLb->InsertEntry(aStrings[nPos], 0, false, nPos); if (officecfg::Office::Common::StylesAndFormatting::Preview::get()) { - StyleLBoxString* pStyleLBoxString = new StyleLBoxString(pTreeListEntry, 0, aStrings[nPos], eFam); - pTreeListEntry->ReplaceItem(pStyleLBoxString, 1); + std::unique_ptr<StyleLBoxString> pStyleLBoxString( + new StyleLBoxString(pTreeListEntry, 0, aStrings[nPos], eFam)); + pTreeListEntry->ReplaceItem(std::move(pStyleLBoxString), 1); } aFmtLb->GetModel()->InvalidateEntry(pTreeListEntry); } |