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 /dbaccess | |
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 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/control/dbtreelistbox.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/control/tabletree.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/WNameMatch.cxx | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx index 191984d33a03..1944410d72f6 100644 --- a/dbaccess/source/ui/control/dbtreelistbox.cxx +++ b/dbaccess/source/ui/control/dbtreelistbox.cxx @@ -142,8 +142,8 @@ void DBTreeListBox::InitEntry(SvTreeListEntry* _pEntry, const OUString& aStr, co { SvTreeListBox::InitEntry( _pEntry, aStr, _rCollEntryBmp,_rExpEntryBmp, eButtonKind); SvLBoxItem* pTextItem(_pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); - SvLBoxString* pString = new OBoldListboxString( _pEntry, 0, aStr ); - _pEntry->ReplaceItem( pString,_pEntry->GetPos(pTextItem)); + std::unique_ptr<SvLBoxString> pString(new OBoldListboxString(_pEntry, 0, aStr)); + _pEntry->ReplaceItem(std::move(pString), _pEntry->GetPos(pTextItem)); } void DBTreeListBox::implStopSelectionTimer() diff --git a/dbaccess/source/ui/control/tabletree.cxx b/dbaccess/source/ui/control/tabletree.cxx index 352b85c945ba..d2434126c177 100644 --- a/dbaccess/source/ui/control/tabletree.cxx +++ b/dbaccess/source/ui/control/tabletree.cxx @@ -409,7 +409,8 @@ void OTableTreeListBox::InitEntry(SvTreeListEntry* _pEntry, const OUString& _rSt size_t nTextPos = _pEntry->GetPos(pTextItem); OSL_ENSURE(SvTreeListEntry::ITEM_NOT_FOUND != nTextPos, "OTableTreeListBox::InitEntry: no text item pos!"); - _pEntry->ReplaceItem(new OBoldListboxString(_pEntry, 0, _rString), nTextPos); + _pEntry->ReplaceItem(std::unique_ptr<OBoldListboxString>( + new OBoldListboxString(_pEntry, 0, _rString)), nTextPos); } SvTreeListEntry* OTableTreeListBox::implAddEntry( diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx index aa1ba97bf273..f005583b8761 100644 --- a/dbaccess/source/ui/misc/WNameMatch.cxx +++ b/dbaccess/source/ui/misc/WNameMatch.cxx @@ -382,8 +382,8 @@ VCL_BUILDER_FACTORY(OColumnTreeBox) void OColumnTreeBox::InitEntry(SvTreeListEntry* pEntry, const OUString& rStr, const Image& rImg1, const Image& rImg2, SvLBoxButtonKind eButtonKind) { DBTreeListBox::InitEntry(pEntry, rStr, rImg1, rImg2, eButtonKind); - SvLBoxString* pString = new OColumnString(pEntry, 0, rStr,false); - pEntry->ReplaceItem( pString, pEntry->ItemCount() - 1 ); + std::unique_ptr<SvLBoxString> pString(new OColumnString(pEntry, 0, rStr,false)); + pEntry->ReplaceItem(std::move(pString), pEntry->ItemCount() - 1); } bool OColumnTreeBox::Select( SvTreeListEntry* pEntry, bool bSelect ) |