summaryrefslogtreecommitdiff
path: root/basctl/source/basicide/moduldlg.cxx
diff options
context:
space:
mode:
authorUray M. János <uray.janos@gmail.com>2012-09-02 16:21:08 +0200
committerAndras Timar <atimar@suse.com>2012-09-07 11:20:48 +0200
commit81f72a3c3a30ef00dfb03bd7fab148d2fcf3e4f8 (patch)
treed5586410e1f0d6b7413f1cab952c76c1978e0a7f /basctl/source/basicide/moduldlg.cxx
parent5764c51f2c9870c91727464c0d889d3554a5663e (diff)
Cleanup in basctl (raw pointers)
Lots of raw pointers have been converted to boost::scoped_ptr to reduce the number of 'delete's and the possibility of memory leaks. Some pointers have been converted to references, to reduce the needless checking for nullptrs, and so simplifying the code. Also some #define-s have been converted to C++ constants or enumerations. Change-Id: Ifbeb78f744bac7a96c8a446ff4db90dedf85fe26
Diffstat (limited to 'basctl/source/basicide/moduldlg.cxx')
-rw-r--r--basctl/source/basicide/moduldlg.cxx20
1 files changed, 9 insertions, 11 deletions
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index 4ad0faaf06f9..0d0d867c4e4a 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -805,13 +805,12 @@ void ObjectPage::NewDialog()
{
aDocument.getOrCreateLibrary( E_DIALOGS, aLibName );
- boost::scoped_ptr< NewObjectDialog > xNewDlg(
- new NewObjectDialog(this, NEWOBJECTMODE_DLG, true));
- xNewDlg->SetObjectName( aDocument.createObjectName( E_DIALOGS, aLibName ) );
+ NewObjectDialog aNewDlg(this, ObjectMode::Dialog, true);
+ aNewDlg.SetObjectName( aDocument.createObjectName( E_DIALOGS, aLibName ) );
- if (xNewDlg->Execute() != 0)
+ if (aNewDlg.Execute() != 0)
{
- ::rtl::OUString aDlgName( xNewDlg->GetObjectName() );
+ rtl::OUString aDlgName = aNewDlg.GetObjectName();
if (aDlgName.isEmpty())
aDlgName = aDocument.createObjectName( E_DIALOGS, aLibName);
@@ -961,14 +960,13 @@ SbModule* createModImpl( Window* pWin, const ScriptDocument& rDocument,
if ( aModName.isEmpty() )
aModName = rDocument.createObjectName( E_SCRIPTS, aLibName );
- boost::scoped_ptr< NewObjectDialog > xNewDlg(
- new NewObjectDialog( pWin, NEWOBJECTMODE_MOD, true ) );
- xNewDlg->SetObjectName( aModName );
+ NewObjectDialog aNewDlg(pWin, ObjectMode::Module, true);
+ aNewDlg.SetObjectName( aModName );
- if (xNewDlg->Execute() != 0)
+ if (aNewDlg.Execute() != 0)
{
- if ( xNewDlg->GetObjectName().Len() )
- aModName = xNewDlg->GetObjectName();
+ if (aNewDlg.GetObjectName().Len() )
+ aModName = aNewDlg.GetObjectName();
try
{