summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-09-11 20:55:17 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-09-13 22:17:45 +0200
commit9aeac1b2dd39f538f897602bd1ae6d37efa6cde4 (patch)
tree302b19b5783ad614e0ed20da47b7b85f3000bce0 /basctl
parent168ad25711c0bd6e3a025b083312e3ed2d237933 (diff)
Use move semantics
Change-Id: I9ba8265044d0f83afe44b6965b78cc733cace653
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/basicide/bastype2.cxx40
-rw-r--r--basctl/source/basicide/bastype2.hxx2
-rw-r--r--basctl/source/basicide/moduldl2.cxx9
-rw-r--r--basctl/source/basicide/moduldlg.cxx9
4 files changed, 30 insertions, 30 deletions
diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx
index eeee9c3ad5a2..4f2a614ac8c6 100644
--- a/basctl/source/basicide/bastype2.cxx
+++ b/basctl/source/basicide/bastype2.cxx
@@ -22,6 +22,7 @@
#include <bastype2.hxx>
#include <baside2.hrc>
#include <iderid.hxx>
+#include <o3tl/make_unique.hxx>
#include <tools/urlobj.hxx>
#include <tools/diagnose_ex.h>
#include <svtools/imagemgr.hxx>
@@ -245,11 +246,10 @@ void TreeListBox::ScanEntry( const ScriptDocument& rDocument, LibraryLocation eL
OUString aRootName( GetRootEntryName( rDocument, eLocation ) );
Image aImage;
GetRootEntryBitmaps( rDocument, aImage );
- std::unique_ptr<Entry> e(new DocumentEntry(rDocument, eLocation));
AddEntry(
aRootName,
aImage,
- 0, true, &e);
+ 0, true, o3tl::make_unique<DocumentEntry>(rDocument, eLocation));
}
SetUpdateMode(true);
@@ -308,11 +308,11 @@ void TreeListBox::ImpCreateLibEntries( SvTreeListEntry* pDocumentRootEntry, cons
}
else
{
- std::unique_ptr<Entry> e(new Entry(OBJ_TYPE_LIBRARY));
AddEntry(
aLibName,
Image( IDEResId( nId ) ),
- pDocumentRootEntry, true, &e);
+ pDocumentRootEntry, true,
+ o3tl::make_unique<Entry>(OBJ_TYPE_LIBRARY));
}
}
}
@@ -344,11 +344,11 @@ void TreeListBox::ImpCreateLibSubEntries( SvTreeListEntry* pLibRootEntry, const
SvTreeListEntry* pModuleEntry = FindEntry( pLibRootEntry, aModName, OBJ_TYPE_MODULE );
if ( !pModuleEntry )
{
- std::unique_ptr<Entry> e(new Entry(OBJ_TYPE_MODULE));
pModuleEntry = AddEntry(
aModName,
Image( IDEResId( RID_IMG_MODULE ) ),
- pLibRootEntry, false, &e);
+ pLibRootEntry, false,
+ o3tl::make_unique<Entry>(OBJ_TYPE_MODULE));
}
// methods
@@ -364,12 +364,12 @@ void TreeListBox::ImpCreateLibSubEntries( SvTreeListEntry* pLibRootEntry, const
SvTreeListEntry* pEntry = FindEntry( pModuleEntry, aName, OBJ_TYPE_METHOD );
if ( !pEntry )
{
- std::unique_ptr<Entry> e(
- new Entry(OBJ_TYPE_METHOD));
pEntry = AddEntry(
aName,
Image( IDEResId( RID_IMG_MACRO ) ),
- pModuleEntry, false, &e);
+ pModuleEntry, false,
+ o3tl::make_unique<Entry>(
+ OBJ_TYPE_METHOD));
}
}
}
@@ -403,11 +403,11 @@ void TreeListBox::ImpCreateLibSubEntries( SvTreeListEntry* pLibRootEntry, const
SvTreeListEntry* pDialogEntry = FindEntry( pLibRootEntry, aDlgName, OBJ_TYPE_DIALOG );
if ( !pDialogEntry )
{
- std::unique_ptr<Entry> e(new Entry(OBJ_TYPE_DIALOG));
pDialogEntry = AddEntry(
aDlgName,
Image( IDEResId( RID_IMG_DIALOG ) ),
- pLibRootEntry, false, &e);
+ pLibRootEntry, false,
+ o3tl::make_unique<Entry>(OBJ_TYPE_DIALOG));
}
}
}
@@ -439,11 +439,10 @@ void TreeListBox::ImpCreateLibSubEntriesInVBAMode( SvTreeListEntry* pLibRootEntr
}
else
{
- std::unique_ptr<Entry> e(new Entry(eType));
AddEntry(
aEntryName,
Image( IDEResId( RID_IMG_MODLIB ) ),
- pLibRootEntry, true, &e);
+ pLibRootEntry, true, o3tl::make_unique<Entry>(eType));
}
}
}
@@ -501,11 +500,11 @@ void TreeListBox::ImpCreateLibSubSubEntriesInVBAMode( SvTreeListEntry* pLibSubRo
SvTreeListEntry* pModuleEntry = FindEntry( pLibSubRootEntry, aEntryName, OBJ_TYPE_MODULE );
if ( !pModuleEntry )
{
- std::unique_ptr<Entry> e(new Entry(OBJ_TYPE_MODULE));
pModuleEntry = AddEntry(
aEntryName,
Image( IDEResId( RID_IMG_MODULE ) ),
- pLibSubRootEntry, false, &e);
+ pLibSubRootEntry, false,
+ o3tl::make_unique<Entry>(OBJ_TYPE_MODULE));
}
// methods
@@ -521,11 +520,11 @@ void TreeListBox::ImpCreateLibSubSubEntriesInVBAMode( SvTreeListEntry* pLibSubRo
SvTreeListEntry* pEntry = FindEntry( pModuleEntry, aName, OBJ_TYPE_METHOD );
if ( !pEntry )
{
- std::unique_ptr<Entry> e(new Entry(OBJ_TYPE_METHOD));
pEntry = AddEntry(
aName,
Image( IDEResId( RID_IMG_MACRO ) ),
- pModuleEntry, false, &e);
+ pModuleEntry, false,
+ o3tl::make_unique<Entry>(OBJ_TYPE_METHOD));
}
}
}
@@ -736,15 +735,14 @@ SvTreeListEntry* TreeListBox::AddEntry(
const Image& rImage,
SvTreeListEntry* pParent,
bool bChildrenOnDemand,
- std::unique_ptr<Entry> * aUserData
+ std::unique_ptr<Entry> && aUserData
)
{
- assert(aUserData != 0);
SvTreeListEntry* p = InsertEntry(
rText, rImage, rImage, pParent, bChildrenOnDemand, TREELIST_APPEND,
- aUserData->get()
+ aUserData.get()
);
- aUserData->release();
+ aUserData.release();
return p;
}
diff --git a/basctl/source/basicide/bastype2.hxx b/basctl/source/basicide/bastype2.hxx
index d009735b6c01..8801567d717a 100644
--- a/basctl/source/basicide/bastype2.hxx
+++ b/basctl/source/basicide/bastype2.hxx
@@ -231,7 +231,7 @@ public:
SvTreeListEntry* AddEntry(
const OUString& rText, const Image& rImage,
SvTreeListEntry* pParent, bool bChildrenOnDemand,
- std::unique_ptr<Entry> * aUserData
+ std::unique_ptr<Entry> && aUserData
);
void RemoveEntry (SvTreeListEntry*);
void RemoveEntry (ScriptDocument const&);
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 1bccb0560742..02fdd4f4c439 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -23,6 +23,7 @@
#include <baside2.hrc>
#include <iderdll.hxx>
#include <iderdll2.hxx>
+#include <o3tl/make_unique.hxx>
#include <svx/passwd.hxx>
#include <ucbhelper/content.hxx>
#include <rtl/uri.hxx>
@@ -1555,20 +1556,20 @@ void createLibImpl( vcl::Window* pWin, const ScriptDocument& rDocument,
sal_uInt16 nMode = pBasicBox->GetMode();
bool bDlgMode = ( nMode & BROWSEMODE_DIALOGS ) && !( nMode & BROWSEMODE_MODULES );
sal_uInt16 nId = bDlgMode ? RID_IMG_DLGLIB : RID_IMG_MODLIB;
- std::unique_ptr<Entry> e(new Entry(OBJ_TYPE_LIBRARY));
SvTreeListEntry* pNewLibEntry = pBasicBox->AddEntry(
aLibName,
Image( IDEResId( nId ) ),
- pRootEntry, false, &e);
+ pRootEntry, false,
+ o3tl::make_unique<Entry>(OBJ_TYPE_LIBRARY));
DBG_ASSERT( pNewLibEntry, "InsertEntry fehlgeschlagen!" );
if( pNewLibEntry )
{
- e.reset(new Entry(OBJ_TYPE_MODULE));
SvTreeListEntry* pEntry_ = pBasicBox->AddEntry(
aModName,
Image( IDEResId( RID_IMG_MODULE ) ),
- pNewLibEntry, false, &e);
+ pNewLibEntry, false,
+ o3tl::make_unique<Entry>(OBJ_TYPE_MODULE));
DBG_ASSERT( pEntry_, "InsertEntry fehlgeschlagen!" );
pBasicBox->SetCurEntry( pEntry_ );
pBasicBox->Select( pBasicBox->GetCurEntry() ); // OV-Bug?!
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index 0403038aa33c..f8cb3ce7da8e 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -28,6 +28,7 @@
#include <basic/basmgr.hxx>
#include <com/sun/star/script/XLibraryContainerPassword.hpp>
#include <comphelper/processfactory.hxx>
+#include <o3tl/make_unique.hxx>
#include <sfx2/app.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/request.hxx>
@@ -858,11 +859,11 @@ void ObjectPage::NewDialog()
SvTreeListEntry* pEntry = m_pBasicBox->FindEntry( pLibEntry, aDlgName, OBJ_TYPE_DIALOG );
if ( !pEntry )
{
- std::unique_ptr<Entry> e(new Entry(OBJ_TYPE_DIALOG));
pEntry = m_pBasicBox->AddEntry(
aDlgName,
Image( IDEResId( RID_IMG_DIALOG ) ),
- pLibEntry, false, &e);
+ pLibEntry, false,
+ o3tl::make_unique<Entry>(OBJ_TYPE_DIALOG));
DBG_ASSERT( pEntry, "InsertEntry fehlgeschlagen!" );
}
m_pBasicBox->SetCurEntry( pEntry );
@@ -1029,11 +1030,11 @@ SbModule* createModImpl( vcl::Window* pWin, const ScriptDocument& rDocument,
SvTreeListEntry* pEntry = rBasicBox.FindEntry( pSubRootEntry, aModName, OBJ_TYPE_MODULE );
if ( !pEntry )
{
- std::unique_ptr<Entry> e(new Entry(OBJ_TYPE_MODULE));
pEntry = rBasicBox.AddEntry(
aModName,
Image( IDEResId( RID_IMG_MODULE ) ),
- pSubRootEntry, false, &e);
+ pSubRootEntry, false,
+ o3tl::make_unique<Entry>(OBJ_TYPE_MODULE));
DBG_ASSERT( pEntry, "InsertEntry fehlgeschlagen!" );
}
rBasicBox.SetCurEntry( pEntry );