diff options
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/macrodlg.cxx | 5 | ||||
-rw-r--r-- | basctl/source/basicide/moduldl2.cxx | 10 |
2 files changed, 8 insertions, 7 deletions
diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx index 0802b17424c7..d5969d18becf 100644 --- a/basctl/source/basicide/macrodlg.cxx +++ b/basctl/source/basicide/macrodlg.cxx @@ -48,6 +48,7 @@ #include <com/sun/star/document/MacroExecMode.hpp> #include <map> +#include <boost/scoped_ptr.hpp> namespace basctl { @@ -765,9 +766,9 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) StoreMacroDescription(); EntryDescriptor aDesc = m_pBasicBox->GetEntryDescriptor(m_pBasicBox->FirstSelected()); - OrganizeDialog* pDlg = new OrganizeDialog( this, 0, aDesc ); + boost::scoped_ptr<OrganizeDialog> pDlg(new OrganizeDialog( this, 0, aDesc )); sal_uInt16 nRet = pDlg->Execute(); - delete pDlg; + pDlg.reset(); if ( nRet ) // not only closed { diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index 7c6cca87672c..3a22d5714c16 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -64,6 +64,7 @@ #include <com/sun/star/script/ModuleSizeExceededRequest.hpp> #include <cassert> +#include <boost/scoped_ptr.hpp> namespace basctl { @@ -636,7 +637,7 @@ IMPL_LINK( LibPage, ButtonHdl, Button *, pButton ) bool const bProtected = xPasswd->isLibraryPasswordProtected( aLibName ); // change password dialog - SvxPasswordDialog* pDlg = new SvxPasswordDialog( this, true, !bProtected ); + boost::scoped_ptr<SvxPasswordDialog> pDlg(new SvxPasswordDialog( this, true, !bProtected )); pDlg->SetCheckPasswordHdl( LINK( this, LibPage, CheckPasswordHdl ) ); if ( pDlg->Execute() == RET_OK ) @@ -653,7 +654,6 @@ IMPL_LINK( LibPage, ButtonHdl, Button *, pButton ) MarkDocumentModified( m_aCurDocument ); } - delete pDlg; } } } @@ -775,7 +775,7 @@ void LibPage::InsertLib() if ( xModLibContImport.is() || xDlgLibContImport.is() ) { - LibDialog* pLibDlg = 0; + boost::scoped_ptr<LibDialog> pLibDlg; Reference< script::XLibraryContainer > xModLibContImp( xModLibContImport, UNO_QUERY ); Reference< script::XLibraryContainer > xDlgLibContImp( xDlgLibContImport, UNO_QUERY ); @@ -787,7 +787,7 @@ void LibPage::InsertLib() // library import dialog if ( !pLibDlg ) { - pLibDlg = new LibDialog( this ); + pLibDlg.reset(new LibDialog( this )); pLibDlg->SetStorageName( aURLObj.getName() ); pLibDlg->GetLibBox().SetMode(ObjectMode::Library); } @@ -1044,7 +1044,7 @@ void LibPage::InsertLib() m_pLibBox->SetCurEntry( pFirstNew ); } - delete pLibDlg; + pLibDlg.reset(); if ( bChanges ) MarkDocumentModified( m_aCurDocument ); } |