summaryrefslogtreecommitdiff
path: root/sfx2/source/doc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-03-07 12:58:41 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-03-15 01:30:54 +0100
commit1b54ea0fb976d0dd322f833cab83afc1a12c5582 (patch)
treef0c1ae063b4a00954209ecc6cc23e78628187481 /sfx2/source/doc
parentff98426745b76fef17e78d75f9b18b26ebc69a74 (diff)
use a scoped_ptr here
Change-Id: Iac59e450521b427c5ddb77cb944dd12ef4bb0cea
Diffstat (limited to 'sfx2/source/doc')
-rw-r--r--sfx2/source/doc/guisaveas.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 092bf89bd33f..29905f57ef6e 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -922,7 +922,7 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
aDialogFlags = SFXWB_EXPORT;
}
- sfx2::FileDialogHelper* pFileDlg = NULL;
+ boost::scoped_ptr<sfx2::FileDialogHelper> pFileDlg;
::rtl::OUString aDocServiceName = GetDocServiceName();
DBG_ASSERT( !aDocServiceName.isEmpty(), "No document service for this module set!" );
@@ -941,13 +941,13 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UIName")),
::rtl::OUString() );
- pFileDlg = new sfx2::FileDialogHelper( aDialogMode, aDialogFlags, aFilterUIName, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "pdf" ) ), rStandardDir, rBlackList );
+ pFileDlg.reset(new sfx2::FileDialogHelper( aDialogMode, aDialogFlags, aFilterUIName, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "pdf" ) ), rStandardDir, rBlackList ));
pFileDlg->SetCurrentFilter( aFilterUIName );
}
else
{
// This is the normal dialog
- pFileDlg = new sfx2::FileDialogHelper( aDialogMode, aDialogFlags, aDocServiceName, nDialog, nMust, nDont, rStandardDir, rBlackList );
+ pFileDlg.reset(new sfx2::FileDialogHelper( aDialogMode, aDialogFlags, aDocServiceName, nDialog, nMust, nDont, rStandardDir, rBlackList ));
}
if ( aDocServiceName == "com.sun.star.drawing.DrawingDocument" )
@@ -978,7 +978,7 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
else
{
// This is the normal dialog
- pFileDlg = new sfx2::FileDialogHelper( aDialogMode, aDialogFlags, aDocServiceName, nDialog, nMust, nDont, rStandardDir, rBlackList );
+ pFileDlg.reset(new sfx2::FileDialogHelper( aDialogMode, aDialogFlags, aDocServiceName, nDialog, nMust, nDont, rStandardDir, rBlackList ));
pFileDlg->CreateMatcher( aDocServiceName );
}
@@ -1066,7 +1066,6 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
String aStringTypeFN;
if ( pFileDlg->Execute( pDialogParams, aStringTypeFN ) != ERRCODE_NONE )
{
- delete pFileDlg;
throw task::ErrorCodeIOException( ::rtl::OUString(), uno::Reference< uno::XInterface >(), ERRCODE_IO_ABORT );
}
@@ -1166,8 +1165,6 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
}
}
- delete pFileDlg;
-
// merge in results of the dialog execution
GetMediaDescr()[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL"))] <<=
::rtl::OUString( aURL.GetMainURL( INetURLObject::NO_DECODE ));