diff options
author | Sheikha AL-Hinai <sheikha443@gmail.com> | 2015-12-28 13:56:23 +0400 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-01-05 11:47:50 +0000 |
commit | d75b9fd582f0aa83bd2fc99028b3f83eb7171d61 (patch) | |
tree | ec1f2a307f773b18e0bf17a281a001fb0aa43bbf /svtools | |
parent | f961fef03906fc059a4a0c008799f68fc22727c1 (diff) |
tdf#94205: Use o3tl::make_unique insted of new+std::move.
Change-Id: I9ff14760479d2ac882546e2e5b74ab750ba2fa4b
Reviewed-on: https://gerrit.libreoffice.org/20984
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/contnr/svtabbx.cxx | 5 | ||||
-rw-r--r-- | svtools/source/contnr/treelistbox.cxx | 13 | ||||
-rw-r--r-- | svtools/source/uno/treecontrolpeer.cxx | 6 |
3 files changed, 8 insertions, 16 deletions
diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx index 068758ac8e62..8e845bbf0fb0 100644 --- a/svtools/source/contnr/svtabbx.cxx +++ b/svtools/source/contnr/svtabbx.cxx @@ -27,7 +27,7 @@ #include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <com/sun/star/accessibility/AccessibleEventId.hpp> #include "svtaccessiblefactory.hxx" - +#include <o3tl/make_unique.hxx> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::accessibility; @@ -83,8 +83,7 @@ void SvTabListBox::InitEntry(SvTreeListEntry* pEntry, const OUString& rStr, for( sal_uInt16 nToken = 0; nToken < nCount; nToken++ ) { const OUString aToken = GetToken(aCurEntry, nIndex); - std::unique_ptr<SvLBoxString> pStr(new SvLBoxString(pEntry, 0, aToken)); - pEntry->AddItem(std::move(pStr)); + pEntry->AddItem(o3tl::make_unique<SvLBoxString>(pEntry, 0, aToken)); } } SvTabListBox::SvTabListBox( vcl::Window* pParent, WinBits nBits ) diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index 540f5b0f2019..0397aed3c281 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -44,7 +44,7 @@ #include <set> #include <string.h> #include <vector> - +#include <o3tl/make_unique.hxx> using namespace css::accessibility; // Drag&Drop @@ -1730,17 +1730,12 @@ void SvTreeListBox::InitEntry(SvTreeListEntry* pEntry, { if( nTreeFlags & SvTreeFlags::CHKBTN ) { - std::unique_ptr<SvLBoxButton> pButton( - new SvLBoxButton(pEntry, eButtonKind, 0, pCheckButtonData)); - pEntry->AddItem(std::move(pButton)); + pEntry->AddItem(o3tl::make_unique<SvLBoxButton>(pEntry, eButtonKind, 0, pCheckButtonData)); } - std::unique_ptr<SvLBoxContextBmp> pContextBmp(new SvLBoxContextBmp( - pEntry,0, aCollEntryBmp,aExpEntryBmp, mbContextBmpExpanded)); - pEntry->AddItem(std::move(pContextBmp)); + pEntry->AddItem(o3tl::make_unique<SvLBoxContextBmp>( pEntry,0, aCollEntryBmp,aExpEntryBmp, mbContextBmpExpanded)); - std::unique_ptr<SvLBoxString> pString(new SvLBoxString(pEntry, 0, aStr)); - pEntry->AddItem(std::move(pString)); + pEntry->AddItem(o3tl::make_unique<SvLBoxString>(pEntry, 0, aStr)); } OUString SvTreeListBox::GetEntryText(SvTreeListEntry* pEntry) const diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx index 0f4ed9b865d0..e2699e97887e 100644 --- a/svtools/source/uno/treecontrolpeer.cxx +++ b/svtools/source/uno/treecontrolpeer.cxx @@ -39,7 +39,7 @@ #include <svtools/svlbitm.hxx> #include <map> - +#include <o3tl/make_unique.hxx> using namespace ::com::sun::star; using namespace css::uno; using namespace css::lang; @@ -239,10 +239,8 @@ UnoTreeListEntry* TreeControlPeer::createEntry( const Reference< XTreeNode >& xN Image aImage; pEntry = new UnoTreeListEntry( xNode, this ); { - std::unique_ptr<ImplContextGraphicItem> pContextBmp( - new ImplContextGraphicItem(pEntry, 0, aImage, aImage, true)); - pEntry->AddItem(std::move(pContextBmp)); + pEntry->AddItem(o3tl::make_unique<ImplContextGraphicItem>(pEntry, 0, aImage, aImage, true)); } std::unique_ptr<UnoTreeListItem> pUnoItem(new UnoTreeListItem(pEntry)); |